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


Java RuleTemplateAttributeBo.isWorkflowAttribute方法代码示例

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


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

示例1: getRuleTemplateRows

import org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo; //导入方法依赖的package包/类
public static List<Row> getRuleTemplateRows(RuleBaseValues rule, boolean delegateRule) {
	List<Row> rows = new ArrayList<Row>();
	RuleTemplateBo ruleTemplate = rule.getRuleTemplate();
	Map<String, String> fieldNameMap = new HashMap<String, String>();
	// refetch rule template from service because after persistence in KNS, it comes back without any rule template attributes
	if (ruleTemplate != null && ruleTemplate.getId() != null) {
		ruleTemplate = KEWServiceLocator.getRuleTemplateService().findByRuleTemplateId(ruleTemplate.getId());
		if (ruleTemplate != null) {
			List<RuleTemplateAttributeBo> ruleTemplateAttributes = ruleTemplate.getActiveRuleTemplateAttributes();
			Collections.sort(ruleTemplateAttributes);
			for (RuleTemplateAttributeBo ruleTemplateAttribute : ruleTemplateAttributes) {
				if (!ruleTemplateAttribute.isWorkflowAttribute()) {
					continue;
				}
                Map<String, String> parameters = getFieldMapForRuleTemplateAttribute(rule, ruleTemplateAttribute);
                WorkflowRuleAttributeRows workflowRuleAttributeRows =
                        KEWServiceLocator.getWorkflowRuleAttributeMediator().getRuleRows(parameters, ruleTemplateAttribute);
                List<Row> attributeRows = transformAndPopulateAttributeRows(workflowRuleAttributeRows.getRows(),
                        ruleTemplateAttribute, rule, fieldNameMap, delegateRule);
                rows.addAll(attributeRows);
			}
		}
		transformFieldConversions(rows, fieldNameMap);
	}
	return rows;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:WebRuleUtils.java

示例2: loadFields

import org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo; //导入方法依赖的package包/类
private void loadFields() {
	fields.clear();
	if (getRuleTemplateId() != null) {
		RuleTemplateBo ruleTemplate = getRuleTemplateService().findByRuleTemplateId(getRuleTemplateId());
		if (ruleTemplate != null) {
			List ruleTemplateAttributes = ruleTemplate.getActiveRuleTemplateAttributes();
			Collections.sort(ruleTemplateAttributes);
			for (Iterator iter = ruleTemplateAttributes.iterator(); iter.hasNext();) {
				RuleTemplateAttributeBo ruleTemplateAttribute = (RuleTemplateAttributeBo) iter.next();
				if (!ruleTemplateAttribute.isWorkflowAttribute()) {
					continue;
				}
                WorkflowRuleAttributeRows workflowRuleAttributeRows =
                        KEWServiceLocator.getWorkflowRuleAttributeMediator().getRuleRows(null, ruleTemplateAttribute);
				for (Row row : workflowRuleAttributeRows.getRows()) {
					for (Field field : row.getFields()) {
                           String fieldValue = "";
                           RuleExtensionValue extensionValue = getRuleExtensionValue(ruleTemplateAttribute.getId(), field.getPropertyName());
                           fieldValue = (extensionValue != null) ? extensionValue.getValue() : field.getPropertyValue();
                           fields.add(new KeyValueId(field.getPropertyName(), fieldValue, ruleTemplateAttribute.getId()));
                       }
				}
			}
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:WebRuleBaseValues.java

示例3: loadRows

import org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo; //导入方法依赖的package包/类
private void loadRows() {
	getRoles().clear();
	if (getRuleTemplateId() != null) {
		RuleTemplateBo ruleTemplate = getRuleTemplateService().findByRuleTemplateId(getRuleTemplateId());
		if (ruleTemplate != null) {
			setRuleTemplateName(ruleTemplate.getName());
			List<RuleTemplateAttributeBo> ruleTemplateAttributes = ruleTemplate.getActiveRuleTemplateAttributes();
			Collections.sort(ruleTemplateAttributes);
			List<Row> rows = new ArrayList<Row>();
			for (RuleTemplateAttributeBo ruleTemplateAttribute : ruleTemplateAttributes) {
				if (!ruleTemplateAttribute.isWorkflowAttribute()) {
					continue;
				}
                WorkflowRuleAttributeRows workflowRuleAttributeRows =
                        KEWServiceLocator.getWorkflowRuleAttributeMediator().getRuleRows(getFieldMap(ruleTemplateAttribute.getId()), ruleTemplateAttribute);
                rows.addAll(workflowRuleAttributeRows.getRows());
                getRoles().addAll(KEWServiceLocator.getWorkflowRuleAttributeMediator().getRoleNames(ruleTemplateAttribute));
			}
			setRows(rows);
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:WebRuleBaseValues.java

示例4: 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

示例5: testIsWorkflowAttribute

import org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo; //导入方法依赖的package包/类
@Test
public void testIsWorkflowAttribute() throws Exception {
    RuleTemplateBo template = KEWServiceLocator.getRuleTemplateService().findByRuleTemplateName("TemplateWithRuleValidationAttribute");
    List<RuleTemplateAttributeBo> ruleTemplateAttributes = (List<RuleTemplateAttributeBo>) template.getRuleTemplateAttributes();
    int index = 0;
    for (RuleTemplateAttributeBo ruleTemplateAttribute : ruleTemplateAttributes) {
        boolean isWorkflowAttribute = ruleTemplateAttribute.isWorkflowAttribute();
        Object attribute = ruleTemplateAttribute.getAttribute();
        attribute = ClassLoaderUtils.unwrapFromProxy(attribute);
        if (index == 0) {
            // should be the TestRuleAttribute
            assertNotNull(attribute);
            assertEquals("Should be TestRuleAttribute", TestRuleAttribute.class, attribute.getClass());
            assertTrue("TestRuleAttribute is a workflow attribute.", isWorkflowAttribute);
        } else if (index == 1) {
            // should be the TestRuleValidationAttribute so should be null
            assertEquals("Should be TestRuleValidationAttribute", TestRuleValidationAttribute.class,
                    attribute.getClass());
            assertFalse("TestRuleValidationAttribute is not a workflow attribute", isWorkflowAttribute);
        }
        index++;
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:RuleTemplateAttributeTest.java

示例6: getRuleTemplateRows

import org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo; //导入方法依赖的package包/类
public static List<Row> getRuleTemplateRows(RuleBaseValues rule, boolean delegateRule) {
	List<Row> rows = new ArrayList<Row>();
	RuleTemplateBo ruleTemplate = rule.getRuleTemplate();
	Map<String, String> fieldNameMap = new HashMap<String, String>();
	// refetch rule template from service because after persistence in KNS, it comes back without any rule template attributes
	if (ruleTemplate != null) {
		ruleTemplate = KEWServiceLocator.getRuleTemplateService().findByRuleTemplateId(ruleTemplate.getId());
		if (ruleTemplate != null) {
			List<RuleTemplateAttributeBo> ruleTemplateAttributes = ruleTemplate.getActiveRuleTemplateAttributes();
			Collections.sort(ruleTemplateAttributes);
			for (RuleTemplateAttributeBo ruleTemplateAttribute : ruleTemplateAttributes) {
				if (!ruleTemplateAttribute.isWorkflowAttribute()) {
					continue;
				}
                Map<String, String> parameters = getFieldMapForRuleTemplateAttribute(rule, ruleTemplateAttribute);
                WorkflowRuleAttributeRows workflowRuleAttributeRows =
                        KEWServiceLocator.getWorkflowRuleAttributeMediator().getRuleRows(parameters, ruleTemplateAttribute);
                List<Row> attributeRows = transformAndPopulateAttributeRows(workflowRuleAttributeRows.getRows(),
                        ruleTemplateAttribute, rule, fieldNameMap, delegateRule);
                rows.addAll(attributeRows);
			}
		}
		transformFieldConversions(rows, fieldNameMap);
	}
	return rows;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:27,代码来源:WebRuleUtils.java

示例7: 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

示例8: testIsWorkflowAttribute

import org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo; //导入方法依赖的package包/类
@Test
public void testIsWorkflowAttribute() throws Exception {
    RuleTemplateBo template = KEWServiceLocator.getRuleTemplateService().findByRuleTemplateName("TemplateWithRuleValidationAttribute");
    List<RuleTemplateAttributeBo> ruleTemplateAttributes = (List<RuleTemplateAttributeBo>) template.getRuleTemplateAttributes();
    int index = 0;
    for (RuleTemplateAttributeBo ruleTemplateAttribute : ruleTemplateAttributes) {
        boolean isWorkflowAttribute = ruleTemplateAttribute.isWorkflowAttribute();
        Object attribute = ruleTemplateAttribute.getAttribute();
        attribute = ClassLoaderUtils.unwrapFromProxy(attribute);
        if (index == 0) {
            // should be the TestRuleAttribute
            assertNotNull(attribute);
            assertEquals("Should be TestRuleAttribute", TestRuleAttribute.class, attribute.getClass());
            assertTrue("TestRuleAttribute is a workflow attribute.", isWorkflowAttribute);
        } else if (index == 1) {
            // should be the TestRuleValidationAttribute so should be null
            assertEquals("Should be TestRuleValidationAttribute", TestRuleValidationAttribute.class, attribute.getClass());
            assertFalse("TestRuleValidationAttribute is not a workflow attribute", isWorkflowAttribute);
        }
        index++;
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:23,代码来源:RuleTemplateAttributeTest.java


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