Package org.kuali.rice.kew.rule.web
Class WebRuleUtils
java.lang.Object
org.kuali.rice.kew.rule.web.WebRuleUtils
Some utilities which are utilized by the
RuleAction.- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidSince editing of a Rule should actually result in a rule with a new ID and new entries in the rule and rule responsibility tables, we need to clear out the primary keys of the rule and related objects.static voidclearKeysForSave(RuleDelegationBo ruleDelegation) static voidcopyResponsibility(RuleResponsibilityBo source, RuleResponsibilityBo target) static WebRuleBaseValuesCopies the existing rule onto the current document.static WebRuleBaseValuescopyToNewRule(WebRuleBaseValues webRuleBaseValues) Makes a copy of the rule and clears the document id on the rule and any of its delegates.static List<org.kuali.rice.kns.web.ui.Section> customizeSections(RuleBaseValues rule, List<org.kuali.rice.kns.web.ui.Section> sections, boolean delegateRule) static voidgetFieldMapForRuleTemplateAttribute(RuleBaseValues rule, org.kuali.rice.kew.api.rule.RuleTemplateAttributeContract ruleTemplateAttribute) Based on original logic implemented in Rule system.static List<org.kuali.rice.kns.web.ui.Row> getRuleTemplateRows(RuleBaseValues rule, boolean delegateRule) static voidpopulateForCopyOrEdit(RuleBaseValues oldRule, RuleBaseValues newRule) static voidThis method populates fields on RuleBaseValues which are used only for maintenance purposes.static voidprocessRuleForCopy(String documentNumber, RuleBaseValues oldRule, RuleBaseValues newRule) static voidprocessRuleForDelegationSave(RuleDelegationBo ruleDelegation) static List<org.kuali.rice.kns.web.ui.Row> transformAndPopulateAttributeRows(List<org.kuali.rice.kns.web.ui.Row> attributeRows, RuleTemplateAttributeBo ruleTemplateAttribute, RuleBaseValues rule, Map<String, String> fieldNameMap, boolean delegateRule) Processes the Fields on the various attributes Rows to assign an appropriate field name to them so that the field name rendered in the maintenance HTML will properly assign the value to RuleBaseValues.fieldValues.static voidtransformFieldConversions(List<org.kuali.rice.kns.web.ui.Row> rows, Map<String, String> fieldNameMap) static voidstatic voidstatic voidstatic voidstatic voidvalidateRuleAndResponsibility(RuleDelegationBo oldRuleDelegation, RuleDelegationBo newRuleDelegation, Map<String, String[]> parameters) static voidvalidateRuleTemplateAndDocumentType(RuleBaseValues oldRule, RuleBaseValues newRule, Map<String, String[]> parameters)
-
Field Details
-
RULE_TEMPLATE_ID_PARAM
- See Also:
-
RULE_TEMPLATE_NAME_PARAM
- See Also:
-
DOCUMENT_TYPE_NAME_PARAM
- See Also:
-
RESPONSIBILITY_ID_PARAM
- See Also:
-
-
Method Details
-
copyRuleOntoExistingDocument
public static WebRuleBaseValues copyRuleOntoExistingDocument(WebRuleBaseValues rule) throws Exception Copies the existing rule onto the current document. This is used within the web-based rule GUI to make a copy of a rule on the existing document. Essentially, this method makes a copy of the rule and all delegates but preserves the document ID of the original rule.- Throws:
Exception
-
copyToNewRule
Makes a copy of the rule and clears the document id on the rule and any of its delegates. This method is used for making a copy of a rule for a new document. It essentially calls the copyRuleOntoExistingDocument method and then clears out the document IDs.- Parameters:
webRuleBaseValues-- Throws:
Exception
-
validateRuleTemplateAndDocumentType
public static void validateRuleTemplateAndDocumentType(RuleBaseValues oldRule, RuleBaseValues newRule, Map<String, String[]> parameters) -
validateRuleAndResponsibility
public static void validateRuleAndResponsibility(RuleDelegationBo oldRuleDelegation, RuleDelegationBo newRuleDelegation, Map<String, String[]> parameters) -
establishDefaultRuleValues
-
customizeSections
public static List<org.kuali.rice.kns.web.ui.Section> customizeSections(RuleBaseValues rule, List<org.kuali.rice.kns.web.ui.Section> sections, boolean delegateRule) -
getRuleTemplateRows
public static List<org.kuali.rice.kns.web.ui.Row> getRuleTemplateRows(RuleBaseValues rule, boolean delegateRule) -
transformFieldConversions
-
transformAndPopulateAttributeRows
public static List<org.kuali.rice.kns.web.ui.Row> transformAndPopulateAttributeRows(List<org.kuali.rice.kns.web.ui.Row> attributeRows, RuleTemplateAttributeBo ruleTemplateAttribute, RuleBaseValues rule, Map<String, String> fieldNameMap, boolean delegateRule) Processes the Fields on the various attributes Rows to assign an appropriate field name to them so that the field name rendered in the maintenance HTML will properly assign the value to RuleBaseValues.fieldValues. -
clearKeysForSave
Since editing of a Rule should actually result in a rule with a new ID and new entries in the rule and rule responsibility tables, we need to clear out the primary keys of the rule and related objects. -
clearKeysForSave
-
translateResponsibilitiesForSave
-
translateFieldValuesForSave
-
getFieldMapForRuleTemplateAttribute
public static Map<String,String> getFieldMapForRuleTemplateAttribute(RuleBaseValues rule, org.kuali.rice.kew.api.rule.RuleTemplateAttributeContract ruleTemplateAttribute) Based on original logic implemented in Rule system. Essentially constructs a Map of field values related to the given RuleTemplateAttribute. -
processRuleForDelegationSave
-
populateForCopyOrEdit
-
populateRuleMaintenanceFields
This method populates fields on RuleBaseValues which are used only for maintenance purposes. In otherwords, it populates the non-persistent fields on the RuleBaseValues which the maintenance document needs to function (such as the extension field values and responsibilities). -
translateResponsibilitiesForLoad
-
copyResponsibility
-
translateRuleExtensionsForLoad
-
processRuleForCopy
public static void processRuleForCopy(String documentNumber, RuleBaseValues oldRule, RuleBaseValues newRule) -
clearKeysForCopy
-