org.kuali.student.lum.workflow.node
Class OrganizationDynamicNode

java.lang.Object
  extended by org.kuali.student.lum.workflow.node.OrganizationDynamicNode
All Implemented Interfaces:
DynamicNode, Node

public class OrganizationDynamicNode
extends Object
implements DynamicNode

A Dynamic Node implementation that will use the KS Organization Hierarchy to dynamically generate route paths based on the organizations sent to Workflow for each document


Field Summary
static String NAMESPACE_ELEMENT
           
static String NODE_STATE_ORG_ID_KEY
           
protected static String ORG_HIERARCHY_NODE
           
static String QUALIFIER_RESOLVER_CLASS_ELEMENT
           
static String QUALIFIER_RESOLVER_ELEMENT
          The following 4 properties should match the RoleRouteModule constants which are currently set to 'protected' Created https://jira.kuali.org/browse/KULRICE-4448 to track change to Rice
static String RESPONSIBILITY_TEMPLATE_NAME_ELEMENT
           
 
Constructor Summary
OrganizationDynamicNode()
           
 
Method Summary
protected  RouteNodeInstance generateNextNodeInstance(String orgId, RouteContext context, Branch branch, RouteHelper helper)
          Generates a new node instance for the given organization id using the default prototype 'role' route node definition created by the setUpDocumentType(DocumentType, RouteNodeInstance) method.
protected  RouteNodeInstance generateNextNodeInstance(String orgId, RouteNode routeNodeDefinition, RouteContext context, Branch branch, RouteHelper helper)
          Generates a new node instance for the given organization id using the given route node definition.
protected  List<String> getInitialOrganizationIdsForRouting(RouteContext context, RouteNodeInstance dynamicNodeInstance, RouteHelper helper, ContextInfo contextInfo)
          This method is used by the transitioningInto(RouteContext, RouteNodeInstance, RouteHelper) method and the organization id values returned will be used to generate node instances that will begin the dynamic organization routing.
protected  RouteNode getKimRoleNode(String routeNodeName, RouteNodeInstance dynamicNodeInstance)
          Method generates the RouteNode definition that will be used as a prototype for any dynamically created route node instances for this dynamic node class.
protected  List<String> getNextOrganizationIdsForRouting(RouteContext context, RouteHelper helper, ContextInfo contextInfo)
          This method is used by the transitioningOutOf(RouteContext, RouteHelper) method and the organization id values returned will be used to generate node instances that will continue the dynamic organization routing.
protected  List<String> getOrganizationIdsFromDocumentContent(RouteContext context)
          Method to fetch the organization ids from the KEW document content xml
 OrganizationService getOrganizationService()
           
protected  String getOrgInfoForPrint(OrgInfo orgInfo)
          Convenience method to get a consistent organization data in order to print to the log
protected  ProcessDefinitionBo getPrototypeProcess(RouteNode node, DocumentType documentType)
           
 void setOrganizationService(OrganizationService organizationService)
           
protected  DocumentType setUpDocumentType(DocumentType documentType, RouteNodeInstance dynamicNodeInstance)
          Method verifies that the Organization Hierarchy Review node exists on the document type.
 DynamicResult transitioningInto(RouteContext routeContext, RouteNodeInstance routeNodeInstance, RouteHelper routeHelper)
           
 DynamicResult transitioningInto(RouteContext context, RouteNodeInstance dynamicNodeInstance, RouteHelper helper, ContextInfo contextInfo)
           
 DynamicResult transitioningOutOf(RouteContext routeContext, RouteHelper routeHelper)
           
 DynamicResult transitioningOutOf(RouteContext context, RouteHelper helper, ContextInfo contextInfo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORG_HIERARCHY_NODE

protected static final String ORG_HIERARCHY_NODE
See Also:
Constant Field Values

NODE_STATE_ORG_ID_KEY

public static final String NODE_STATE_ORG_ID_KEY
See Also:
Constant Field Values

QUALIFIER_RESOLVER_ELEMENT

public static final String QUALIFIER_RESOLVER_ELEMENT
The following 4 properties should match the RoleRouteModule constants which are currently set to 'protected' Created https://jira.kuali.org/browse/KULRICE-4448 to track change to Rice

See Also:
Constant Field Values

QUALIFIER_RESOLVER_CLASS_ELEMENT

public static final String QUALIFIER_RESOLVER_CLASS_ELEMENT
See Also:
Constant Field Values

RESPONSIBILITY_TEMPLATE_NAME_ELEMENT

public static final String RESPONSIBILITY_TEMPLATE_NAME_ELEMENT
See Also:
Constant Field Values

NAMESPACE_ELEMENT

public static final String NAMESPACE_ELEMENT
See Also:
Constant Field Values
Constructor Detail

OrganizationDynamicNode

public OrganizationDynamicNode()
Method Detail

getOrganizationService

public OrganizationService getOrganizationService()

setOrganizationService

public void setOrganizationService(OrganizationService organizationService)

transitioningInto

public DynamicResult transitioningInto(RouteContext context,
                                       RouteNodeInstance dynamicNodeInstance,
                                       RouteHelper helper,
                                       ContextInfo contextInfo)
                                throws Exception
Throws:
Exception

getInitialOrganizationIdsForRouting

protected List<String> getInitialOrganizationIdsForRouting(RouteContext context,
                                                           RouteNodeInstance dynamicNodeInstance,
                                                           RouteHelper helper,
                                                           ContextInfo contextInfo)
This method is used by the transitioningInto(RouteContext, RouteNodeInstance, RouteHelper) method and the organization id values returned will be used to generate node instances that will begin the dynamic organization routing.

Parameters:
context - - RouteContext class that holds data about the current document's routing and data
dynamicNodeInstance - - The initial instance of the dynamic node as determined by the route node configuration
helper - - RouteHelper convenience class used to make some routing operations a bit easier
Returns:
A list of organization ids that will be used to create next node instances in the routing of the document. By default these are the organizations set in the the current document's Document Content xml by Kuali Student at the point of Save and/or Submit

getOrganizationIdsFromDocumentContent

protected List<String> getOrganizationIdsFromDocumentContent(RouteContext context)
Method to fetch the organization ids from the KEW document content xml

Parameters:
context - - RouteContext class that holds data about the current document's routing and data
Returns:
A list of organization ids that are listed in the xml (may have duplicates if duplicates are allowed by KS code)

transitioningInto

public DynamicResult transitioningInto(RouteContext routeContext,
                                       RouteNodeInstance routeNodeInstance,
                                       RouteHelper routeHelper)
                                throws Exception
Specified by:
transitioningInto in interface DynamicNode
Throws:
Exception

transitioningOutOf

public DynamicResult transitioningOutOf(RouteContext routeContext,
                                        RouteHelper routeHelper)
                                 throws Exception
Specified by:
transitioningOutOf in interface DynamicNode
Throws:
Exception

transitioningOutOf

public DynamicResult transitioningOutOf(RouteContext context,
                                        RouteHelper helper,
                                        ContextInfo contextInfo)
                                 throws Exception
Throws:
Exception

getOrgInfoForPrint

protected String getOrgInfoForPrint(OrgInfo orgInfo)
Convenience method to get a consistent organization data in order to print to the log


getNextOrganizationIdsForRouting

protected List<String> getNextOrganizationIdsForRouting(RouteContext context,
                                                        RouteHelper helper,
                                                        ContextInfo contextInfo)
This method is used by the transitioningOutOf(RouteContext, RouteHelper) method and the organization id values returned will be used to generate node instances that will continue the dynamic organization routing. The default implementation retrieves the organization from the previous route node and uses the OrganizationService#getOrgOrgRelationsByRelatedOrg(String) method to find all organization relations for it. That list is then parsed to find all organization relations that are both active and of the relation type that matches AbstractOrganizationServiceQualifierResolver.KUALI_ORG_TYPE_CURRICULUM_PARENT. A unique list of those organization ids is returned.

Parameters:
context - - RouteContext class that holds data about the current document's routing and data
helper - - RouteHelper convenience class used to make some routing operations a bit easier
Returns:
A list of organization ids that will be used to create next node instances in the routing of the document.

generateNextNodeInstance

protected RouteNodeInstance generateNextNodeInstance(String orgId,
                                                     RouteContext context,
                                                     Branch branch,
                                                     RouteHelper helper)
Generates a new node instance for the given organization id using the default prototype 'role' route node definition created by the setUpDocumentType(DocumentType, RouteNodeInstance) method.


generateNextNodeInstance

protected RouteNodeInstance generateNextNodeInstance(String orgId,
                                                     RouteNode routeNodeDefinition,
                                                     RouteContext context,
                                                     Branch branch,
                                                     RouteHelper helper)
Generates a new node instance for the given organization id using the given route node definition.


setUpDocumentType

protected DocumentType setUpDocumentType(DocumentType documentType,
                                         RouteNodeInstance dynamicNodeInstance)
Method verifies that the Organization Hierarchy Review node exists on the document type. If it does not exist it will add it and save the document type. This node is required because it will be used as a prototype for any generated 'role' nodes (also known as KIM Responsibility Review Nodes).

Parameters:
documentType - - DocumentType object that needs nodes defined but may not have them defined
dynamicNodeInstance - - The node instance that represents the dynamic node as defined in the document type configuration (the node that tells KEW to look at this class for the node processing)

getKimRoleNode

protected RouteNode getKimRoleNode(String routeNodeName,
                                   RouteNodeInstance dynamicNodeInstance)
Method generates the RouteNode definition that will be used as a prototype for any dynamically created route node instances for this dynamic node class.

Parameters:
routeNodeName - - The name to be used for the new route node definition
dynamicNodeInstance - - used to set up the DocumentType on the generated route node definition

getPrototypeProcess

protected ProcessDefinitionBo getPrototypeProcess(RouteNode node,
                                                  DocumentType documentType)


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