当前位置: 首页>>代码示例>>Java>>正文


Java RuleXmlParser类代码示例

本文整理汇总了Java中org.kuali.rice.kew.xml.RuleXmlParser的典型用法代码示例。如果您正苦于以下问题:Java RuleXmlParser类的具体用法?Java RuleXmlParser怎么用?Java RuleXmlParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RuleXmlParser类属于org.kuali.rice.kew.xml包,在下文中一共展示了RuleXmlParser类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadXml

import org.kuali.rice.kew.xml.RuleXmlParser; //导入依赖的package包/类
public void loadXml(InputStream inputStream, String principalId) {
   	RuleXmlParser parser = new RuleXmlParser();
       try {
           parser.parseRuleDelegations(inputStream);
       } catch (Exception e) { //any other exception
           LOG.error("Error loading xml file", e);
           WorkflowServiceErrorException wsee = new WorkflowServiceErrorException("Error loading xml file", new WorkflowServiceErrorImpl("Error loading xml file", XML_PARSE_ERROR));
           wsee.initCause(e);
           throw wsee;
       }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:RuleDelegationServiceImpl.java

示例2: loadXml

import org.kuali.rice.kew.xml.RuleXmlParser; //导入依赖的package包/类
@Override
public void loadXml(InputStream inputStream, String principalId) {
    RuleXmlParser parser = new RuleXmlParser();
    try {
        parser.parseRules(inputStream);
    } catch (Exception e) { //any other exception
        LOG.error("Error loading xml file", e);
        WorkflowServiceErrorException wsee = new WorkflowServiceErrorException("Error loading xml file", new WorkflowServiceErrorImpl("Error loading xml file", XML_PARSE_ERROR));
        wsee.initCause(e);
        throw wsee;
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:RuleServiceInternalImpl.java

示例3: testParameterReplacement

import org.kuali.rice.kew.xml.RuleXmlParser; //导入依赖的package包/类
@Test public void testParameterReplacement() throws IOException, XmlException {
    ConfigContext.getCurrentContextConfig().putProperty("test.replacement.user", "user3");
    ConfigContext.getCurrentContextConfig().putProperty("test.replacement.workgroup", "WorkflowAdmin");
    List<RuleBaseValues> rules = new RuleXmlParser().parseRules(getClass().getResourceAsStream("ParameterizedRule.xml"));
    assertEquals(1, rules.size());
    RuleBaseValues rule = rules.get(0);
    assertEquals(2, rule.getRuleResponsibilities().size());
    RuleResponsibilityBo resp = (RuleResponsibilityBo) rule.getRuleResponsibilities().get(0);

    if (resp.isUsingPrincipal()) {
        assertEquals("user3", resp.getPrincipal().getPrincipalName());
    } else {
        assertEquals("WorkflowAdmin", resp.getGroup().getName());
    }

    ConfigContext.getCurrentContextConfig().putProperty("test.replacement.user", "user1");
    ConfigContext.getCurrentContextConfig().putProperty("test.replacement.workgroup", "TestWorkgroup");
    rules = new RuleXmlParser().parseRules(getClass().getResourceAsStream("ParameterizedRule.xml"));
    assertEquals(1, rules.size());
    rule = rules.get(0);
    assertEquals(2, rule.getRuleResponsibilities().size());
    resp = (RuleResponsibilityBo) rule.getRuleResponsibilities().get(0);

    if (resp.isUsingPrincipal())
    {
        assertEquals("user1", resp.getPrincipal().getPrincipalName());   
    } 
    else 
    {
        assertEquals("TestWorkgroup", resp.getGroup().getName());
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:RuleXmlParserTest.java

示例4: loadXml

import org.kuali.rice.kew.xml.RuleXmlParser; //导入依赖的package包/类
public void loadXml(InputStream inputStream, String principalId) {
    RuleXmlParser parser = new RuleXmlParser();
    try {
        parser.parseRules(inputStream);
    } catch (Exception e) { //any other exception
        LOG.error("Error loading xml file", e);
        WorkflowServiceErrorException wsee = new WorkflowServiceErrorException("Error loading xml file", new WorkflowServiceErrorImpl("Error loading xml file", XML_PARSE_ERROR));
        wsee.initCause(e);
        throw wsee;
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:12,代码来源:RuleServiceInternalImpl.java


注:本文中的org.kuali.rice.kew.xml.RuleXmlParser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。