本文整理匯總了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;
}
}