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

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

public class OrganizationDynamicNode
extends Object
implements org.kuali.rice.kew.engine.node.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
private static Logger LOG
           
static String NAMESPACE_ELEMENT
           
static String NODE_STATE_ORG_ID_KEY
           
protected static String ORG_HIERARCHY_NODE
           
private  OrganizationService organizationService
           
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  org.kuali.rice.kew.engine.node.RouteNodeInstance generateNextNodeInstance(String orgId, org.kuali.rice.kew.engine.RouteContext context, org.kuali.rice.kew.engine.node.Branch branch, org.kuali.rice.kew.engine.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  org.kuali.rice.kew.engine.node.RouteNodeInstance generateNextNodeInstance(String orgId, org.kuali.rice.kew.engine.node.RouteNode routeNodeDefinition, org.kuali.rice.kew.engine.RouteContext context, org.kuali.rice.kew.engine.node.Branch branch, org.kuali.rice.kew.engine.RouteHelper helper)
          Generates a new node instance for the given organization id using the given route node definition.
protected  List<String> getInitialOrganizationIdsForRouting(org.kuali.rice.kew.engine.RouteContext context, org.kuali.rice.kew.engine.node.RouteNodeInstance dynamicNodeInstance, org.kuali.rice.kew.engine.RouteHelper helper)
          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  org.kuali.rice.kew.engine.node.RouteNode getKimRoleNode(String routeNodeName, org.kuali.rice.kew.engine.node.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(org.kuali.rice.kew.engine.RouteContext context, org.kuali.rice.kew.engine.RouteHelper helper)
          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(org.kuali.rice.kew.engine.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  org.kuali.rice.kew.engine.node.Process getPrototypeProcess(org.kuali.rice.kew.engine.node.RouteNode node, org.kuali.rice.kew.doctype.bo.DocumentType documentType)
           
 void setOrganizationService(OrganizationService organizationService)
           
protected  org.kuali.rice.kew.doctype.bo.DocumentType setUpDocumentType(org.kuali.rice.kew.doctype.bo.DocumentType documentType, org.kuali.rice.kew.engine.node.RouteNodeInstance dynamicNodeInstance)
          Method verifies that the Organization Hierarchy Review node exists on the document type.
 org.kuali.rice.kew.engine.node.DynamicResult transitioningInto(org.kuali.rice.kew.engine.RouteContext context, org.kuali.rice.kew.engine.node.RouteNodeInstance dynamicNodeInstance, org.kuali.rice.kew.engine.RouteHelper helper)
           
 org.kuali.rice.kew.engine.node.DynamicResult transitioningOutOf(org.kuali.rice.kew.engine.RouteContext context, org.kuali.rice.kew.engine.RouteHelper helper)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG

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

organizationService

private OrganizationService organizationService
Constructor Detail

OrganizationDynamicNode

public OrganizationDynamicNode()
Method Detail

getOrganizationService

public OrganizationService getOrganizationService()

setOrganizationService

public void setOrganizationService(OrganizationService organizationService)

transitioningInto

public org.kuali.rice.kew.engine.node.DynamicResult transitioningInto(org.kuali.rice.kew.engine.RouteContext context,
                                                                      org.kuali.rice.kew.engine.node.RouteNodeInstance dynamicNodeInstance,
                                                                      org.kuali.rice.kew.engine.RouteHelper helper)
                                                               throws Exception
Specified by:
transitioningInto in interface org.kuali.rice.kew.engine.node.DynamicNode
Throws:
Exception

getInitialOrganizationIdsForRouting

protected List<String> getInitialOrganizationIdsForRouting(org.kuali.rice.kew.engine.RouteContext context,
                                                           org.kuali.rice.kew.engine.node.RouteNodeInstance dynamicNodeInstance,
                                                           org.kuali.rice.kew.engine.RouteHelper helper)
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(org.kuali.rice.kew.engine.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)

transitioningOutOf

public org.kuali.rice.kew.engine.node.DynamicResult transitioningOutOf(org.kuali.rice.kew.engine.RouteContext context,
                                                                       org.kuali.rice.kew.engine.RouteHelper helper)
                                                                throws Exception
Specified by:
transitioningOutOf in interface org.kuali.rice.kew.engine.node.DynamicNode
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(org.kuali.rice.kew.engine.RouteContext context,
                                                        org.kuali.rice.kew.engine.RouteHelper helper)
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 org.kuali.rice.kew.engine.node.RouteNodeInstance generateNextNodeInstance(String orgId,
                                                                                    org.kuali.rice.kew.engine.RouteContext context,
                                                                                    org.kuali.rice.kew.engine.node.Branch branch,
                                                                                    org.kuali.rice.kew.engine.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 org.kuali.rice.kew.engine.node.RouteNodeInstance generateNextNodeInstance(String orgId,
                                                                                    org.kuali.rice.kew.engine.node.RouteNode routeNodeDefinition,
                                                                                    org.kuali.rice.kew.engine.RouteContext context,
                                                                                    org.kuali.rice.kew.engine.node.Branch branch,
                                                                                    org.kuali.rice.kew.engine.RouteHelper helper)
Generates a new node instance for the given organization id using the given route node definition.


setUpDocumentType

protected org.kuali.rice.kew.doctype.bo.DocumentType setUpDocumentType(org.kuali.rice.kew.doctype.bo.DocumentType documentType,
                                                                       org.kuali.rice.kew.engine.node.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 org.kuali.rice.kew.engine.node.RouteNode getKimRoleNode(String routeNodeName,
                                                                  org.kuali.rice.kew.engine.node.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 org.kuali.rice.kew.engine.node.Process getPrototypeProcess(org.kuali.rice.kew.engine.node.RouteNode node,
                                                                     org.kuali.rice.kew.doctype.bo.DocumentType documentType)


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