org.kuali.rice.kew.rule.web
Class WebRuleUtils

java.lang.Object
  extended by org.kuali.rice.kew.rule.web.WebRuleUtils

public final class WebRuleUtils
extends Object

Some utilities which are utilized by the RuleAction.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
static String DOCUMENT_TYPE_NAME_PARAM
           
static String RESPONSIBILITY_ID_PARAM
           
static String RULE_TEMPLATE_ID_PARAM
           
static String RULE_TEMPLATE_NAME_PARAM
           
 
Method Summary
static void clearKeysForCopy(RuleBaseValues rule)
           
static void clearKeysForSave(RuleBaseValues rule)
          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.
static void clearKeysForSave(RuleDelegationBo ruleDelegation)
           
static void copyResponsibility(RuleResponsibilityBo source, RuleResponsibilityBo target)
           
static WebRuleBaseValues copyRuleOntoExistingDocument(WebRuleBaseValues rule)
          Copies the existing rule onto the current document.
static WebRuleBaseValues copyToNewRule(WebRuleBaseValues webRuleBaseValues)
          Makes a copy of the rule and clears the document id on the rule and any of its delegates.
static List<Section> customizeSections(RuleBaseValues rule, List<Section> sections, boolean delegateRule)
           
static void establishDefaultRuleValues(RuleBaseValues rule)
           
static Map<String,String> getFieldMapForRuleTemplateAttribute(RuleBaseValues rule, RuleTemplateAttributeContract ruleTemplateAttribute)
          Based on original logic implemented in Rule system.
static List<Row> getRuleTemplateRows(RuleBaseValues rule, boolean delegateRule)
           
static void populateForCopyOrEdit(RuleBaseValues oldRule, RuleBaseValues newRule)
           
static void populateRuleMaintenanceFields(RuleBaseValues rule)
          This method populates fields on RuleBaseValues which are used only for maintenance purposes.
static void processRuleForCopy(String documentNumber, RuleBaseValues oldRule, RuleBaseValues newRule)
           
static void processRuleForDelegationSave(RuleDelegationBo ruleDelegation)
           
static List<Row> transformAndPopulateAttributeRows(List<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 void transformFieldConversions(List<Row> rows, Map<String,String> fieldNameMap)
           
static void translateFieldValuesForSave(RuleBaseValues rule)
           
static void translateResponsibilitiesForLoad(RuleBaseValues rule)
           
static void translateResponsibilitiesForSave(RuleBaseValues rule)
           
static void translateRuleExtensionsForLoad(RuleBaseValues rule)
           
static void validateRuleAndResponsibility(RuleDelegationBo oldRuleDelegation, RuleDelegationBo newRuleDelegation, Map<String,String[]> parameters)
           
static void validateRuleTemplateAndDocumentType(RuleBaseValues oldRule, RuleBaseValues newRule, Map<String,String[]> parameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RULE_TEMPLATE_ID_PARAM

public static final String RULE_TEMPLATE_ID_PARAM
See Also:
Constant Field Values

RULE_TEMPLATE_NAME_PARAM

public static final String RULE_TEMPLATE_NAME_PARAM
See Also:
Constant Field Values

DOCUMENT_TYPE_NAME_PARAM

public static final String DOCUMENT_TYPE_NAME_PARAM
See Also:
Constant Field Values

RESPONSIBILITY_ID_PARAM

public static final String RESPONSIBILITY_ID_PARAM
See Also:
Constant Field Values
Method Detail

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

public static WebRuleBaseValues copyToNewRule(WebRuleBaseValues webRuleBaseValues)
                                       throws Exception
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

public static void establishDefaultRuleValues(RuleBaseValues rule)

customizeSections

public static List<Section> customizeSections(RuleBaseValues rule,
                                              List<Section> sections,
                                              boolean delegateRule)

getRuleTemplateRows

public static List<Row> getRuleTemplateRows(RuleBaseValues rule,
                                            boolean delegateRule)

transformFieldConversions

public static void transformFieldConversions(List<Row> rows,
                                             Map<String,String> fieldNameMap)

transformAndPopulateAttributeRows

public static List<Row> transformAndPopulateAttributeRows(List<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

public static void clearKeysForSave(RuleBaseValues rule)
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

public static void clearKeysForSave(RuleDelegationBo ruleDelegation)

translateResponsibilitiesForSave

public static void translateResponsibilitiesForSave(RuleBaseValues rule)

translateFieldValuesForSave

public static void translateFieldValuesForSave(RuleBaseValues rule)

getFieldMapForRuleTemplateAttribute

public static Map<String,String> getFieldMapForRuleTemplateAttribute(RuleBaseValues rule,
                                                                     RuleTemplateAttributeContract ruleTemplateAttribute)
Based on original logic implemented in Rule system. Essentially constructs a Map of field values related to the given RuleTemplateAttribute.


processRuleForDelegationSave

public static void processRuleForDelegationSave(RuleDelegationBo ruleDelegation)

populateForCopyOrEdit

public static void populateForCopyOrEdit(RuleBaseValues oldRule,
                                         RuleBaseValues newRule)

populateRuleMaintenanceFields

public static void populateRuleMaintenanceFields(RuleBaseValues rule)
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

public static void translateResponsibilitiesForLoad(RuleBaseValues rule)

copyResponsibility

public static void copyResponsibility(RuleResponsibilityBo source,
                                      RuleResponsibilityBo target)

translateRuleExtensionsForLoad

public static void translateRuleExtensionsForLoad(RuleBaseValues rule)

processRuleForCopy

public static void processRuleForCopy(String documentNumber,
                                      RuleBaseValues oldRule,
                                      RuleBaseValues newRule)

clearKeysForCopy

public static void clearKeysForCopy(RuleBaseValues rule)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.