org.kuali.rice.kew.rule
Class FlexRM

java.lang.Object
  extended by org.kuali.rice.kew.rule.FlexRM
Direct Known Subclasses:
FlexRMAdapter

public class FlexRM
extends Object

Generates Action Requests for a Document using the rule system and the specified RuleTemplate.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
ActionRequestValue, RuleTemplate, RuleBaseValues

Field Summary
static String DEFAULT_RULE_SELECTOR
          The default type of rule selector implementation to use if none is explicitly specified for the node.
private  Timestamp effectiveDate
           
private static org.apache.log4j.Logger LOG
           
private static String RULE_SELECTOR_PACKAGE
          Package in which rule selector implementations live
private static String RULE_SELECTOR_SUFFIX
          The class name suffix all rule selectors should have; e.g.
private  int selectedRules
          An accumulator that keeps track of the number of rules that have been selected over the lifespan of this FlexRM instance.
 
Constructor Summary
FlexRM()
           
FlexRM(Timestamp effectiveDate)
           
 
Method Summary
private  void buildDelegationGraph(ActionRequestFactory arFactory, RouteContext context, RuleBaseValues delegationRule, DocumentRouteHeaderValue routeHeaderValue, ActionRequestValue parentRequest, RuleDelegation ruleDelegation)
           
 List<ActionRequestValue> getActionRequests(DocumentRouteHeaderValue routeHeader, RouteNodeInstance nodeInstance, String ruleTemplateName)
          Generates action requests
 List<ActionRequestValue> getActionRequests(DocumentRouteHeaderValue routeHeader, RouteNode routeNodeDef, RouteNodeInstance nodeInstance, String ruleTemplateName)
          Generates action requests
private  ActionRequestService getActionRequestService()
           
 int getNumberOfMatchingRules()
           
 RuleDelegationService getRuleDelegationService()
           
 RuleService getRuleService()
           
private  boolean isDuplicateActionRequestDetected(DocumentRouteHeaderValue routeHeader, RouteNodeInstance nodeInstance, RuleResponsibility resp, String qualifiedRoleName)
           
protected  RuleSelector loadRuleSelector(RouteNode routeNodeDef, RouteNodeInstance nodeInstance)
           
private  void makeActionRequest(ActionRequestFactory arFactory, RouteContext context, RuleBaseValues rule, DocumentRouteHeaderValue routeHeader, RuleResponsibility resp, ActionRequestValue parentRequest, RuleDelegation ruleDelegation)
          Generates action requests for a non-role responsibility, either a user or workgroup
 void makeActionRequests(ActionRequestFactory arFactory, List<RuleResponsibility> responsibilities, RouteContext context, RuleBaseValues rule, DocumentRouteHeaderValue routeHeader, ActionRequestValue parentRequest, RuleDelegation ruleDelegation)
           
private  void makeActionRequests(ActionRequestFactory arFactory, RouteContext context, RuleBaseValues rule, DocumentRouteHeaderValue routeHeader, ActionRequestValue parentRequest, RuleDelegation ruleDelegation)
           
private  void makeRoleActionRequests(ActionRequestFactory arFactory, RouteContext context, RuleBaseValues rule, RuleResponsibility resp, DocumentRouteHeaderValue routeHeader, ActionRequestValue parentRequest, RuleDelegation ruleDelegation)
          Generates action requests for a role responsibility
 ResponsibleParty resolveResponsibilityId(String responsibilityId)
           
private  void setRuleAttribute(RoleAttribute roleAttribute, RuleBaseValues rule, String roleAttributeName)
          Determines if the attribute has a setRuleAttribute method and then sets the value appropriately if it does.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

DEFAULT_RULE_SELECTOR

public static final String DEFAULT_RULE_SELECTOR
The default type of rule selector implementation to use if none is explicitly specified for the node.

See Also:
Constant Field Values

RULE_SELECTOR_PACKAGE

private static final String RULE_SELECTOR_PACKAGE
Package in which rule selector implementations live

See Also:
Constant Field Values

RULE_SELECTOR_SUFFIX

private static final String RULE_SELECTOR_SUFFIX
The class name suffix all rule selectors should have; e.g. FooRuleSelector

See Also:
Constant Field Values

effectiveDate

private final Timestamp effectiveDate

selectedRules

private int selectedRules
An accumulator that keeps track of the number of rules that have been selected over the lifespan of this FlexRM instance.

Constructor Detail

FlexRM

public FlexRM()

FlexRM

public FlexRM(Timestamp effectiveDate)
Method Detail

loadRuleSelector

protected RuleSelector loadRuleSelector(RouteNode routeNodeDef,
                                        RouteNodeInstance nodeInstance)
                                 throws WorkflowException
Throws:
WorkflowException

getActionRequests

public List<ActionRequestValue> getActionRequests(DocumentRouteHeaderValue routeHeader,
                                                  RouteNodeInstance nodeInstance,
                                                  String ruleTemplateName)
                                           throws WorkflowException
Generates action requests

Parameters:
routeHeader - the document route header
nodeInstance - the route node instance; this may NOT be null
ruleTemplateName - the rule template
Returns:
list of action requests
Throws:
WorkflowException

getActionRequests

public List<ActionRequestValue> getActionRequests(DocumentRouteHeaderValue routeHeader,
                                                  RouteNode routeNodeDef,
                                                  RouteNodeInstance nodeInstance,
                                                  String ruleTemplateName)
                                           throws WorkflowException
Generates action requests

Parameters:
routeHeader - the document route header
routeNodeDef - the RouteNode definition of the route node instance
nodeInstance - the route node instance; this may be null!
ruleTemplateName - the rule template
Returns:
list of action requests
Throws:
WorkflowException

resolveResponsibilityId

public ResponsibleParty resolveResponsibilityId(String responsibilityId)

makeActionRequests

private void makeActionRequests(ActionRequestFactory arFactory,
                                RouteContext context,
                                RuleBaseValues rule,
                                DocumentRouteHeaderValue routeHeader,
                                ActionRequestValue parentRequest,
                                RuleDelegation ruleDelegation)
                         throws WorkflowException
Throws:
WorkflowException

makeActionRequests

public void makeActionRequests(ActionRequestFactory arFactory,
                               List<RuleResponsibility> responsibilities,
                               RouteContext context,
                               RuleBaseValues rule,
                               DocumentRouteHeaderValue routeHeader,
                               ActionRequestValue parentRequest,
                               RuleDelegation ruleDelegation)
                        throws WorkflowException
Throws:
WorkflowException

buildDelegationGraph

private void buildDelegationGraph(ActionRequestFactory arFactory,
                                  RouteContext context,
                                  RuleBaseValues delegationRule,
                                  DocumentRouteHeaderValue routeHeaderValue,
                                  ActionRequestValue parentRequest,
                                  RuleDelegation ruleDelegation)
                           throws WorkflowException
Throws:
WorkflowException

makeRoleActionRequests

private void makeRoleActionRequests(ActionRequestFactory arFactory,
                                    RouteContext context,
                                    RuleBaseValues rule,
                                    RuleResponsibility resp,
                                    DocumentRouteHeaderValue routeHeader,
                                    ActionRequestValue parentRequest,
                                    RuleDelegation ruleDelegation)
                             throws WorkflowException
Generates action requests for a role responsibility

Throws:
WorkflowException

setRuleAttribute

private void setRuleAttribute(RoleAttribute roleAttribute,
                              RuleBaseValues rule,
                              String roleAttributeName)
Determines if the attribute has a setRuleAttribute method and then sets the value appropriately if it does.


makeActionRequest

private void makeActionRequest(ActionRequestFactory arFactory,
                               RouteContext context,
                               RuleBaseValues rule,
                               DocumentRouteHeaderValue routeHeader,
                               RuleResponsibility resp,
                               ActionRequestValue parentRequest,
                               RuleDelegation ruleDelegation)
                        throws WorkflowException
Generates action requests for a non-role responsibility, either a user or workgroup

Throws:
WorkflowException

isDuplicateActionRequestDetected

private boolean isDuplicateActionRequestDetected(DocumentRouteHeaderValue routeHeader,
                                                 RouteNodeInstance nodeInstance,
                                                 RuleResponsibility resp,
                                                 String qualifiedRoleName)

getRuleService

public RuleService getRuleService()

getRuleDelegationService

public RuleDelegationService getRuleDelegationService()

getActionRequestService

private ActionRequestService getActionRequestService()

getNumberOfMatchingRules

public int getNumberOfMatchingRules()


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.