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


Java RuleTemplateAttributeBo.getWorkflowAttribute方法代码示例

本文整理汇总了Java中org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo.getWorkflowAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java RuleTemplateAttributeBo.getWorkflowAttribute方法的具体用法?Java RuleTemplateAttributeBo.getWorkflowAttribute怎么用?Java RuleTemplateAttributeBo.getWorkflowAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo的用法示例。


在下文中一共展示了RuleTemplateAttributeBo.getWorkflowAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isMatch

import org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo; //导入方法依赖的package包/类
public boolean isMatch(DocumentContent docContent) {
    for (RuleTemplateAttributeBo ruleTemplateAttribute : getRuleTemplate().getActiveRuleTemplateAttributes()) {
        if (!ruleTemplateAttribute.isWorkflowAttribute()) {
            continue;
        }
        WorkflowRuleAttribute routingAttribute = ruleTemplateAttribute.getWorkflowAttribute();

        RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute();
        if (ruleAttribute.getType().equals(KewApiConstants.RULE_XML_ATTRIBUTE_TYPE)) {
            ((GenericXMLRuleAttribute) routingAttribute).setExtensionDefinition(RuleAttribute.to(ruleAttribute));
        }
        String className = ruleAttribute.getResourceDescriptor();
        List<RuleExtension> editedRuleExtensions = new ArrayList<RuleExtension>();
        for (RuleExtensionBo extension : getRuleExtensions()) {
            if (extension.getRuleTemplateAttribute().getRuleAttribute().getResourceDescriptor().equals(className)) {
                editedRuleExtensions.add(RuleExtensionBo.to(extension));
            }
        }
        if (!routingAttribute.isMatch(docContent, editedRuleExtensions)) {
            return false;
        }
    }
    return true;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:RuleBaseValues.java

示例2: isMatch

import org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo; //导入方法依赖的package包/类
public boolean isMatch(DocumentContent docContent) {
    for (RuleTemplateAttributeBo ruleTemplateAttribute : getRuleTemplate().getActiveRuleTemplateAttributes()) {
        if (!ruleTemplateAttribute.isWorkflowAttribute()) {
            continue;
        }
        WorkflowRuleAttribute routingAttribute = (WorkflowRuleAttribute) ruleTemplateAttribute.getWorkflowAttribute();

        RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute();
        if (ruleAttribute.getType().equals(KewApiConstants.RULE_XML_ATTRIBUTE_TYPE)) {
            ((GenericXMLRuleAttribute) routingAttribute).setExtensionDefinition(RuleAttribute.to(ruleAttribute));
        }
        String className = ruleAttribute.getResourceDescriptor();
        List<RuleExtension> editedRuleExtensions = new ArrayList<RuleExtension>();
        for (RuleExtensionBo extension : getRuleExtensions()) {
            if (extension.getRuleTemplateAttribute().getRuleAttribute().getResourceDescriptor().equals(className)) {
                editedRuleExtensions.add(RuleExtensionBo.to(extension));
            }
        }
        if (!routingAttribute.isMatch(docContent, editedRuleExtensions)) {
            return false;
        }
    }
    return true;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:25,代码来源:RuleBaseValues.java

示例3: testGetWorkflowAttribute

import org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo; //导入方法依赖的package包/类
@Test
public void testGetWorkflowAttribute() throws Exception {
    RuleTemplateBo template = KEWServiceLocator.getRuleTemplateService().findByRuleTemplateName("TemplateWithRuleValidationAttribute");
    List<RuleTemplateAttributeBo> ruleTemplateAttributes = (List<RuleTemplateAttributeBo>) template.getRuleTemplateAttributes();
    int index = 0;
    for (RuleTemplateAttributeBo ruleTemplateAttribute : ruleTemplateAttributes) {
        boolean runtimeThrown = false;
        WorkflowRuleAttribute attribute = null;
        try {
            attribute = ruleTemplateAttribute.getWorkflowAttribute();
        } catch (RuntimeException e) {
            runtimeThrown = true;
        }
        if (index == 0) {
            // should be the TestRuleAttribute
            assertFalse("RuntimeException should not have been thrown.", runtimeThrown);
            assertNotNull("Attribute should exist.", attribute);
            attribute = (WorkflowRuleAttribute) ClassLoaderUtils.unwrapFromProxy(attribute);
            assertEquals("Should be TestRuleAttribute", TestRuleAttribute.class, attribute.getClass());
        } else if (index == 1) {
            // should be the TestRuleDelegationAttribute so should be null
            assertTrue("RuntimeException should have been thrown.", runtimeThrown);
            assertNull("This should be the rule delegation attribute, not a WorkflowAttribute.", attribute);
        }
        index++;
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:RuleTemplateAttributeTest.java


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