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