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