當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。