Package org.kuali.rice.kew.rule
Class GenericWorkflowAttribute
java.lang.Object
org.kuali.rice.kew.rule.AbstractWorkflowAttribute
org.kuali.rice.kew.rule.GenericWorkflowAttribute
- All Implemented Interfaces:
Serializable,WorkflowRuleAttribute
- Direct Known Subclasses:
GenericRoleAttribute
Generic base class that implements common functionality to simplify implementing
a WorkflowAttribute. This includes simplified template methods, as well as a generic
attribute content model.
Control flow (for isMatch):
The default matching algorithm will match:if any single attribute's properties are a match for all rule extension valuesThis implementation does not (yet!) implement a generic internal map of properties, so it is up to subclasses to expose specific named getters/setters to set data on an attribute of this ancestry.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final GenericAttributeContentprotected final org.apache.logging.log4j.LoggerFields inherited from class org.kuali.rice.kew.rule.AbstractWorkflowAttribute
required -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSimply defers to GenericAttributeContent to generate suitable XML content in a standard fashionTemplate method for subclasses to override to expose attribute stateI think the job of this method is to marshal the current state of the attribute into a representative list of rule extension values.protected booleanisMatch(List<Map<String, String>> propertiesList, List<org.kuali.rice.kew.api.rule.RuleExtension> ruleExtensions) Returns true if any single incoming attribute's properties are a match for all rule extension valuesprotected booleanisMatch(Map<String, String> properties, List<org.kuali.rice.kew.api.rule.RuleExtension> ruleExtensions) Returns true if all key/value pairs defined by the specified rule extensions are present in the incoming attribute's propertiesbooleanisMatch(DocumentContent docContent, List<org.kuali.rice.kew.api.rule.RuleExtension> ruleExtensions) Returns true if this Attribute finds a match in the given DocContent.validateRoutingData(Map paramMap) These guys should probably be implemented to set the parameters on an internal member property map this attribute should use to contain all properties set on it, like StandardGenericXmlAttribute.validateRuleData(Map paramMap) Validates ruleExtension values in the incoming map.Methods inherited from class org.kuali.rice.kew.rule.AbstractWorkflowAttribute
getIdFieldName, getLockFieldName, getRoutingDataRows, getRuleRows, isRequired, setRequired
-
Field Details
-
log
protected final org.apache.logging.log4j.Logger log -
attributeName
-
-
-
Constructor Details
-
GenericWorkflowAttribute
public GenericWorkflowAttribute() -
GenericWorkflowAttribute
-
-
Method Details
-
getProperties
Template method for subclasses to override to expose attribute state- Returns:
- map exposing attribute state
-
getDocContent
Simply defers to GenericAttributeContent to generate suitable XML content in a standard fashion- Specified by:
getDocContentin interfaceWorkflowRuleAttribute- Overrides:
getDocContentin classAbstractWorkflowAttribute
-
isMatch
public boolean isMatch(DocumentContent docContent, List<org.kuali.rice.kew.api.rule.RuleExtension> ruleExtensions) Description copied from interface:WorkflowRuleAttributeReturns true if this Attribute finds a match in the given DocContent. If true, the associated document will be routed to the users specifed by the UNF The isMatch method is responsible for determining whether content in a document matches content saved in workflow, thus determining whether to fire a rule or not. The isMatch method takes a DocumentContent object and a list of rule extension objects and returns a Boolean. The DocumentContent object contains the data in XML format that will be compared with the rules saved in workflow. Rule extension objects come from a potential rule that may match the document content on this eDoc. The potential rule is selected based on the Document Type and Rule Templates associated with this eDoc. Each rule extension object contains a list of rule extension value objects which have the data we will use in key value format to compare to the document content. The key will be determined by a unique string assigned by this attribute. The Value is determined when a rule is created and data is entered for the particular key. If a match is found, this method returns true and the eDoc will be routed based on this rule. If no match is found, the method returns false and the eDoc will not be routed based on this rule. -
isMatch
protected boolean isMatch(List<Map<String, String>> propertiesList, List<org.kuali.rice.kew.api.rule.RuleExtension> ruleExtensions) Returns true if any single incoming attribute's properties are a match for all rule extension values- Parameters:
propertiesList- the list of incoming attributes' propertiesruleExtensions- the rule extensions- Returns:
- true if any single attribute's properties are a match for all rule extension values
-
isMatch
protected boolean isMatch(Map<String, String> properties, List<org.kuali.rice.kew.api.rule.RuleExtension> ruleExtensions) Returns true if all key/value pairs defined by the specified rule extensions are present in the incoming attribute's properties- Parameters:
properties- incoming attribute's propertiesruleExtensions- list of rule extensions- Returns:
- true if all key/value pairs defined by the specified rule extensions are present in the incoming attribute's
-
validateRoutingData
These guys should probably be implemented to set the parameters on an internal member property map this attribute should use to contain all properties set on it, like StandardGenericXmlAttribute.- Specified by:
validateRoutingDatain interfaceWorkflowRuleAttribute- Overrides:
validateRoutingDatain classAbstractWorkflowAttribute- Parameters:
paramMap- Map containing the names and values of the routing data for this Attribute- See Also:
-
validateRuleData
Description copied from interface:WorkflowRuleAttributeValidates ruleExtension values in the incoming map. Called by the UI during rule creation. This method is responsible for validating and setting the data entered on the form from the UI of the rule creation to the Rule's attribute. The values will be in a Map with the key being the key of the RuleExtensionValue and the value being the value of the data entered from the UI. This method is used for rule creation which may have different fields than the routing report data.- Specified by:
validateRuleDatain interfaceWorkflowRuleAttribute- Overrides:
validateRuleDatain classAbstractWorkflowAttribute- Parameters:
paramMap- Map containing the names and values of the rule extensions for this Attribute
-
getRuleExtensionValues
I think the job of this method is to marshal the current state of the attribute into a representative list of rule extension values. On that assumption, this method should simply create a list of RuleExtensionValues based on the the property map this attribute uses to hold property values. TODO: this is not fully implemented! e.g. generic property map like StandardGenericXmlAttribute- Specified by:
getRuleExtensionValuesin interfaceWorkflowRuleAttribute- Overrides:
getRuleExtensionValuesin classAbstractWorkflowAttribute
-