本文整理汇总了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;
}
}
示例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;
}
}
示例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());
}
}
示例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;
}
}