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


Java WebRuleUtils.populateRuleMaintenanceFields方法代码示例

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


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

示例1: assertRuleBaseValuesStateIndependence

import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入方法依赖的package包/类
/**
 * verifies that rule exports are the same regardless of whether the rule is ready for render, or
 * for persistance.
 */
protected void assertRuleBaseValuesStateIndependence() throws Exception {
	for (Object o : KEWServiceLocator.getRuleService().fetchAllRules(true)) {
    	RuleBaseValues rule = (RuleBaseValues)o;
    	KewExportDataSet dataSet = new KewExportDataSet();
    	dataSet.getRules().add(rule);
    	
    	// first, do a conversion in the just-loaded state:
    	byte[] saveXmlBytes = CoreApiServiceLocator.getXmlExporterService().export(dataSet.createExportDataSet());
    	String saveStr = new String(saveXmlBytes);
    	
    	// now, convert for render:
    	WebRuleUtils.populateRuleMaintenanceFields(rule);
    	
    	// do another conversion in the ready-for-render state:
    	byte[] loadXmlBytes = CoreApiServiceLocator.getXmlExporterService().export(dataSet.createExportDataSet());
    	String loadStr = new String(loadXmlBytes);

        // FIXME: currently failing due to:
        // * WebRuleUtils.populateRuleMaintenanceFields clears rule extensions
        // * RuleXmlExporter detects missing extensions and re-adds them: but in a different order...

    	// check that the results are identical:
    	assertTrue("The load/render state of the RuleBaseValues shouldn't effect the export: \n" + 
    			saveStr + "\n\n != \n\n" + loadStr, 
    			StringUtils.equals(saveStr, loadStr));
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:RuleXmlExporterTest.java

示例2: retrieveDataObject

import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入方法依赖的package包/类
@Override
public Object retrieveDataObject(Map fieldValues){
	RuleBaseValues rule = (RuleBaseValues)super.retrieveDataObject(fieldValues);
	WebRuleUtils.populateRuleMaintenanceFields(rule);
	return rule;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:RuleBaseValuesInquirableImpl.java

示例3: getBusinessObject

import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入方法依赖的package包/类
/**
 * This overridden method ...
 * 
 * @see org.kuali.rice.krad.inquiry.Inquirable#getBusinessObject(java.util.Map)
 */
public BusinessObject getBusinessObject(Map fieldValues) {
	RuleBaseValues rule = (RuleBaseValues)super.getBusinessObject(fieldValues);
	WebRuleUtils.populateRuleMaintenanceFields(rule);
	return rule;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:11,代码来源:RuleBaseValuesInquirableImpl.java

示例4: retrieveDataObject

import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入方法依赖的package包/类
@Override
public Object retrieveDataObject(Map fieldValues){
	RuleDelegationBo rule = (RuleDelegationBo)super.retrieveDataObject(fieldValues);
	WebRuleUtils.populateRuleMaintenanceFields(rule.getDelegationRule());
	return rule;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:RuleDelegationInquirableImpl.java

示例5: getBusinessObject

import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入方法依赖的package包/类
/**
 * This overridden method ...
 *
 * @see org.kuali.rice.krad.inquiry.Inquirable#getBusinessObject(java.util.Map)
 */
public BusinessObject getBusinessObject(Map fieldValues) {
	RuleDelegationBo rule = (RuleDelegationBo)super.getBusinessObject(fieldValues);
	WebRuleUtils.populateRuleMaintenanceFields(rule.getDelegationRule());
	return rule;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:11,代码来源:RuleDelegationInquirableImpl.java

示例6: exportRule

import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入方法依赖的package包/类
public void exportRule(Element parent, RuleBaseValues rule) {
	Element ruleElement = renderer.renderElement(parent, RULE);
    if (rule.getName() != null) {
        renderer.renderTextElement(ruleElement, NAME, rule.getName());
    }
    renderer.renderTextElement(ruleElement, DOCUMENT_TYPE, rule.getDocTypeName());
    if (rule.getRuleTemplateName() != null) {
        renderer.renderTextElement(ruleElement, RULE_TEMPLATE, rule.getRuleTemplateName());
    }
    renderer.renderTextElement(ruleElement, DESCRIPTION, rule.getDescription());
    if(rule.getFromDateString() != null){
        renderer.renderTextElement(ruleElement, FROM_DATE, rule.getFromDateString());
    }
    if(rule.getToDateString() != null){
        renderer.renderTextElement(ruleElement, TO_DATE, rule.getToDateString());
    }
    if (rule.getRuleExpressionDef() != null) {
        Element expressionElement = renderer.renderTextElement(ruleElement, EXPRESSION, rule.getRuleExpressionDef().getExpression());
        if (rule.getRuleExpressionDef().getType() != null) {
            expressionElement.setAttribute("type", rule.getRuleExpressionDef().getType());
        }
    }
    renderer.renderBooleanElement(ruleElement, FORCE_ACTION, rule.isForceAction(), false);
    
    if (CollectionUtils.isEmpty(rule.getRuleExtensions()) &&
    		/* field values is not empty */
    		!(rule.getFieldValues() == null || rule.getFieldValues().size() == 0)) {
    	// the rule is in the wrong state (as far as we are concerned).
    	// translate it
    	WebRuleUtils.translateResponsibilitiesForSave(rule);
    	WebRuleUtils.translateFieldValuesForSave(rule);
    	
    	// do our exports
		exportRuleExtensions(ruleElement, rule.getRuleExtensions());
    	
    	// translate it back
    	WebRuleUtils.populateRuleMaintenanceFields(rule);
    } else { 
    	exportRuleExtensions(ruleElement, rule.getRuleExtensions());
    }
    
    // put responsibilities in a single collection 
    Set<RuleResponsibilityBo> responsibilities = new HashSet<RuleResponsibilityBo>();
    responsibilities.addAll(rule.getRuleResponsibilities());
    responsibilities.addAll(rule.getPersonResponsibilities());
    responsibilities.addAll(rule.getGroupResponsibilities());
    responsibilities.addAll(rule.getRoleResponsibilities());
    
    exportResponsibilities(ruleElement, responsibilities);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:51,代码来源:RuleXmlExporter.java


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