org.kuali.rice.kew.routeheader
Class DocumentRouteHeaderValue

java.lang.Object
  extended by org.kuali.rice.kns.bo.BusinessObjectBase
      extended by org.kuali.rice.kns.bo.PersistableBusinessObjectBase
          extended by org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue
All Implemented Interfaces:
Serializable, org.apache.ojb.broker.PersistenceBrokerAware, GloballyUnique, Versioned, ModelObjectBasic, BusinessObject, PersistableBusinessObject
Direct Known Subclasses:
DocumentRouteHeaderValueActionListExtension

@Entity
public class DocumentRouteHeaderValue
extends PersistableBusinessObjectBase

A document within KEW. A document effectively represents a process that moves through the workflow engine. It is created from a particular DocumentType and follows the route path defined by that DocumentType.

During a document's lifecycle it progresses through a series of statuses, starting with INITIATED and moving to one of the terminal states (such as FINAL, CANCELED, etc). The list of status on a document are defined in the KEWConstants class and include the constants starting with "ROUTE_HEADER_" and ending with "_CD".

Associated with the document is the document content. The document content is XML which represents the content of that document. This XML content is typically used to make routing decisions for the document.

A document has associated with it a set of ActionRequestValue object and ActionTakenValue objects. Action Requests represent requests for user action (such as Approve, Acknowledge, etc). Action Takens represent action that users have performed on the document, such as approvals or cancelling of the document.

The instantiated route path of a document is defined by it's graph of RouteNodeInstance objects. The path starts at the initial node of the document and progresses from there following the next nodes of each node instance. The current active nodes on the document are defined by the "active" flag on the node instance where are not marked as "complete".

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
DocumentType, ActionRequestValue, ActionItem, ActionTakenValue, RouteNodeInstance, KEWConstants, Serialized Form

Field Summary
private  String appDocId
           
private  String appDocStatus
           
private  Timestamp appDocStatusDate
           
private  List<DocumentStatusTransition> appDocStatusHistory
          The appDocStatusHistory keeps a list of Application Document Status transitions for the document.
private  Timestamp approvedDate
           
private  Timestamp createDate
           
static String CURRENT_ROUTE_NODE_NAME_DELIMITER
           
private  Integer docRouteLevel
           
private  String docRouteStatus
           
private  String docTitle
           
private  DocumentRouteHeaderValueContent documentContent
           
private  String documentId
           
private  Long documentTypeId
           
private  Integer docVersion
           
private static boolean FINAL_STATE
           
private  Timestamp finalizedDate
           
private  List<RouteNodeInstance> initialRouteNodeInstances
           
private  String initiatorWorkflowId
           
protected static HashMap<String,String> legalActions
           
private static org.apache.log4j.Logger LOG
           
private  List<Note> notes
           
private  Collection queueItems
           
private  String routedByUserWorkflowId
           
private  Timestamp routeLevelDate
           
private  Timestamp routeStatusDate
           
private  boolean routingReport
           
private  List<SearchableAttributeValue> searchableAttributeValues
           
private static long serialVersionUID
           
private  List<ActionRequestValue> simulatedActionRequests
           
protected static HashMap<String,String> stateTransitionMap
           
private  Timestamp statusModDate
           
 
Fields inherited from class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
extension, versionNumber
 
Constructor Summary
DocumentRouteHeaderValue()
           
 
Method Summary
 Object copy(boolean preserveKeys)
           
private  BranchState findVariable(String name)
          Looks up a variable (embodied in a "BranchState" key/value pair) in the branch state table.
 List<ActionItem> getActionItems()
           
 List<ActionRequestValue> getActionRequests()
           
 List<ActionTakenValue> getActionsTaken()
           
 String getAppDocId()
           
 String getAppDocStatus()
          This method returns the Application Document Status.
 Timestamp getAppDocStatusDate()
           
 List<DocumentStatusTransition> getAppDocStatusHistory()
           
 Timestamp getApprovedDate()
           
 String getCombinedStatus()
          This method returns a combination of the route status label and the app doc status.
 Timestamp getCreateDate()
           
 List<String> getCurrentNodeNames()
           
 String getCurrentRouteLevelName()
           
 CustomActionListAttribute getCustomActionListAttribute()
           
 CustomEmailAttribute getCustomEmailAttribute()
           
 CustomNoteAttribute getCustomNoteAttribute()
           
 ActionItem getDocActionItem(int index)
           
 ActionRequestValue getDocActionRequest(int index)
           
 ActionTakenValue getDocActionTaken(int index)
           
 String getDocContent()
           
 Integer getDocRouteLevel()
           
 String getDocRouteStatus()
           
 String getDocRouteStatusLabel()
           
 String getDocStatusPolicy()
          This method returns the Document Status Policy for the document type associated with this Route Header.
 String getDocTitle()
           
 DocumentRouteHeaderValueContent getDocumentContent()
           
 String getDocumentId()
           
 DocumentType getDocumentType()
           
 Long getDocumentTypeId()
           
 Integer getDocVersion()
           
 Timestamp getFinalizedDate()
           
private  RouteNodeInstance getInitialRouteNodeInstance(int index)
           
 List<RouteNodeInstance> getInitialRouteNodeInstances()
           
 String getInitiatorDisplayName()
           
 Principal getInitiatorPrincipal()
           
 String getInitiatorWorkflowId()
           
 List<Note> getNotes()
           
 Collection getQueueItems()
           
 Branch getRootBranch()
          Convenience method that returns the branch of the first (and presumably only?) initial node
 List<BranchState> getRootBranchState()
           
 String getRoutedByDisplayName()
           
 Principal getRoutedByPrincipal()
           
 String getRoutedByUserWorkflowId()
           
 Timestamp getRouteLevelDate()
           
 Timestamp getRouteStatusDate()
           
 String getRouteStatusLabel()
           
 List<ActionRequestValue> getSimulatedActionRequests()
           
 Timestamp getStatusModDate()
           
 String getVariable(String name)
          Gets a variable
 boolean isApproved()
           
 boolean isCanceled()
           
 boolean isDisaproved()
           
 boolean isEnroute()
           
 boolean isFinal()
           
 boolean isInException()
           
 boolean isProcessed()
           
 boolean isRoutable()
           
 boolean isRouted()
           
 boolean isRoutingReport()
           
 boolean isStateInitiated()
           
 boolean isStateSaved()
           
 boolean isValidActionToTake(String actionCd)
          Return true if the given action code is valid for this document's current state.
 boolean isValidStatusChange(String newStatus)
           
 void markDocumentApproved()
          Mark the document as being approved.
 void markDocumentCanceled()
          Mark document cancled.
 void markDocumentDisapproved()
          Mark document disapproved
 void markDocumentEnroute()
          Mark the document as being actively routed.
 void markDocumentFinalized()
          Mark document finalized.
 void markDocumentInException()
          Mark the document as being in the exception state.
 void markDocumentProcessed()
          Mark the document as being processed.
 void markDocumentSaved()
          Mark document saved
 void removeVariableThatContains(String name)
           
 void setAppDocId(String appDocId)
           
 void setAppDocStatus(String appDocStatus)
           
 void setAppDocStatusDate(Timestamp appDocStatusDate)
           
 void setAppDocStatusHistory(List<DocumentStatusTransition> appDocStatusHistory)
           
 void setApprovedDate(Timestamp approvedDate)
           
 void setCreateDate(Timestamp createDate)
           
 void setDocContent(String docContent)
           
 void setDocRouteLevel(Integer docRouteLevel)
           
 void setDocRouteStatus(String docRouteStatus)
           
 void setDocTitle(String docTitle)
           
 void setDocumentContent(DocumentRouteHeaderValueContent documentContent)
           
 void setDocumentId(String documentId)
           
 void setDocumentTypeId(Long docTypeId)
           
 void setDocVersion(Integer docVersion)
           
 void setFinalizedDate(Timestamp finalizedDate)
           
 void setInitialRouteNodeInstances(List<RouteNodeInstance> initialRouteNodeInstances)
           
 void setInitiatorWorkflowId(String initiatorWorkflowId)
           
 void setNotes(List<Note> notes)
           
 void setQueueItems(Collection queueItems)
           
 void setRoutedByUserWorkflowId(String routedByUserWorkflowId)
           
 void setRouteHeaderData(RouteHeaderDTO routeHeaderVO)
          This method takes data from a VO and sets it on this route header
 void setRouteLevelDate(Timestamp routeLevelDate)
           
 void setRouteStatus(String newStatus, boolean finalState)
           
 void setRouteStatusDate(Timestamp routeStatusDate)
           
 void setRoutingReport(boolean routingReport)
           
 void setSimulatedActionRequests(List<ActionRequestValue> simulatedActionRequests)
           
 void setStatusModDate(Timestamp statusModDate)
           
 void setVariable(String name, String value)
          Sets a variable
 void updateAppDocStatus(String appDocStatus)
          This method sets the appDocStatus.
 
Methods inherited from class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
afterDelete, afterInsert, afterLookup, afterUpdate, beforeDelete, beforeInsert, beforeUpdate, buildListOfDeletionAwareLists, getExtension, getObjectId, getPersistenceService, getPersistenceStructureService, getVersionNumber, isNewCollectionRecord, linkEditableUserFields, postLoad, postPersist, postRemove, postUpdate, prePersist, preRemove, preUpdate, refresh, refreshNonUpdateableReferences, refreshReferenceObject, setExtension, setNewCollectionRecord, setObjectId, setVersionNumber
 
Methods inherited from class org.kuali.rice.kns.bo.BusinessObjectBase
prepareForWorkflow, toString, toStringBuilder, toStringMapper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.core.api.mo.ModelObjectBasic
toString
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

LOG

private static final org.apache.log4j.Logger LOG

CURRENT_ROUTE_NODE_NAME_DELIMITER

public static final String CURRENT_ROUTE_NODE_NAME_DELIMITER
See Also:
Constant Field Values

documentTypeId

private Long documentTypeId

docRouteStatus

private String docRouteStatus

docRouteLevel

private Integer docRouteLevel

statusModDate

private Timestamp statusModDate

createDate

private Timestamp createDate

approvedDate

private Timestamp approvedDate

finalizedDate

private Timestamp finalizedDate

documentContent

private DocumentRouteHeaderValueContent documentContent

docTitle

private String docTitle

appDocId

private String appDocId

docVersion

private Integer docVersion

initiatorWorkflowId

private String initiatorWorkflowId

routedByUserWorkflowId

private String routedByUserWorkflowId

routeStatusDate

private Timestamp routeStatusDate

routeLevelDate

private Timestamp routeLevelDate

appDocStatus

private String appDocStatus

appDocStatusDate

private Timestamp appDocStatusDate

documentId

private String documentId

appDocStatusHistory

private List<DocumentStatusTransition> appDocStatusHistory
The appDocStatusHistory keeps a list of Application Document Status transitions for the document. It tracks the previous status, the new status, and a timestamp of the transition for each status transition.


notes

private List<Note> notes

searchableAttributeValues

private List<SearchableAttributeValue> searchableAttributeValues

queueItems

private Collection queueItems

routingReport

private boolean routingReport

simulatedActionRequests

private List<ActionRequestValue> simulatedActionRequests

FINAL_STATE

private static final boolean FINAL_STATE
See Also:
Constant Field Values

legalActions

protected static final HashMap<String,String> legalActions

stateTransitionMap

protected static final HashMap<String,String> stateTransitionMap

initialRouteNodeInstances

private List<RouteNodeInstance> initialRouteNodeInstances
Constructor Detail

DocumentRouteHeaderValue

public DocumentRouteHeaderValue()
Method Detail

getInitiatorPrincipal

public Principal getInitiatorPrincipal()

getRoutedByPrincipal

public Principal getRoutedByPrincipal()

getInitiatorDisplayName

public String getInitiatorDisplayName()

getRoutedByDisplayName

public String getRoutedByDisplayName()

getCurrentRouteLevelName

public String getCurrentRouteLevelName()

getCurrentNodeNames

public List<String> getCurrentNodeNames()

getRouteStatusLabel

public String getRouteStatusLabel()

getDocRouteStatusLabel

public String getDocRouteStatusLabel()

getDocStatusPolicy

public String getDocStatusPolicy()
This method returns the Document Status Policy for the document type associated with this Route Header. The Document Status Policy denotes whether the KEW Route Status, or the Application Document Status, or both are to be displayed.

Returns:

getQueueItems

public Collection getQueueItems()

setQueueItems

public void setQueueItems(Collection queueItems)

getActionItems

public List<ActionItem> getActionItems()

getActionsTaken

public List<ActionTakenValue> getActionsTaken()

getActionRequests

public List<ActionRequestValue> getActionRequests()

getSimulatedActionRequests

public List<ActionRequestValue> getSimulatedActionRequests()

setSimulatedActionRequests

public void setSimulatedActionRequests(List<ActionRequestValue> simulatedActionRequests)

getDocumentType

public DocumentType getDocumentType()

getAppDocId

public String getAppDocId()

setAppDocId

public void setAppDocId(String appDocId)

getApprovedDate

public Timestamp getApprovedDate()

setApprovedDate

public void setApprovedDate(Timestamp approvedDate)

getCreateDate

public Timestamp getCreateDate()

setCreateDate

public void setCreateDate(Timestamp createDate)

getDocContent

public String getDocContent()

setDocContent

public void setDocContent(String docContent)

getDocRouteLevel

public Integer getDocRouteLevel()

setDocRouteLevel

public void setDocRouteLevel(Integer docRouteLevel)

getDocRouteStatus

public String getDocRouteStatus()

setDocRouteStatus

public void setDocRouteStatus(String docRouteStatus)

getDocTitle

public String getDocTitle()

setDocTitle

public void setDocTitle(String docTitle)

getDocumentTypeId

public Long getDocumentTypeId()

setDocumentTypeId

public void setDocumentTypeId(Long docTypeId)

getDocVersion

public Integer getDocVersion()

setDocVersion

public void setDocVersion(Integer docVersion)

getFinalizedDate

public Timestamp getFinalizedDate()

setFinalizedDate

public void setFinalizedDate(Timestamp finalizedDate)

getInitiatorWorkflowId

public String getInitiatorWorkflowId()

setInitiatorWorkflowId

public void setInitiatorWorkflowId(String initiatorWorkflowId)

getRoutedByUserWorkflowId

public String getRoutedByUserWorkflowId()

setRoutedByUserWorkflowId

public void setRoutedByUserWorkflowId(String routedByUserWorkflowId)

getDocumentId

public String getDocumentId()

setDocumentId

public void setDocumentId(String documentId)

getRouteLevelDate

public Timestamp getRouteLevelDate()

setRouteLevelDate

public void setRouteLevelDate(Timestamp routeLevelDate)

getRouteStatusDate

public Timestamp getRouteStatusDate()

setRouteStatusDate

public void setRouteStatusDate(Timestamp routeStatusDate)

getStatusModDate

public Timestamp getStatusModDate()

setStatusModDate

public void setStatusModDate(Timestamp statusModDate)

getAppDocStatus

public String getAppDocStatus()
This method returns the Application Document Status. This status is an alternative to the Route Status that may be used for a document. It is configurable per document type.

Returns:
See Also:
ApplicationDocumentStatus, DocumentTypePolicy

setAppDocStatus

public void setAppDocStatus(String appDocStatus)

getCombinedStatus

public String getCombinedStatus()
This method returns a combination of the route status label and the app doc status.

Returns:

updateAppDocStatus

public void updateAppDocStatus(String appDocStatus)
                        throws WorkflowRuntimeException
This method sets the appDocStatus. It firsts validates the new value against the defined acceptable values, if defined. It also updates the AppDocStatus date, and saves the status transition information

Parameters:
appDocStatus -
Throws:
WorkflowRuntimeException

getAppDocStatusDate

public Timestamp getAppDocStatusDate()

setAppDocStatusDate

public void setAppDocStatusDate(Timestamp appDocStatusDate)

copy

public Object copy(boolean preserveKeys)

isStateInitiated

public boolean isStateInitiated()
Returns:
True if the document is in the state of Initiated

isStateSaved

public boolean isStateSaved()
Returns:
True if the document is in the state of Saved

isRouted

public boolean isRouted()
Returns:
true if the document has ever been inte enroute state

isInException

public boolean isInException()

isDisaproved

public boolean isDisaproved()

isCanceled

public boolean isCanceled()

isFinal

public boolean isFinal()

isEnroute

public boolean isEnroute()

isProcessed

public boolean isProcessed()
Returns:
true if the document is in the processed state

isApproved

public boolean isApproved()
Returns:
true if the document is in the approved state

isRoutable

public boolean isRoutable()

isValidActionToTake

public boolean isValidActionToTake(String actionCd)
Return true if the given action code is valid for this document's current state.

Parameters:
actionCd - The action code to be tested.
Returns:
True if the action code is valid for the document's status.

isValidStatusChange

public boolean isValidStatusChange(String newStatus)

setRouteStatus

public void setRouteStatus(String newStatus,
                           boolean finalState)
                    throws InvalidActionTakenException
Throws:
InvalidActionTakenException

markDocumentProcessed

public void markDocumentProcessed()
                           throws InvalidActionTakenException
Mark the document as being processed.

Throws:
ResourceUnavailableException
InvalidActionTakenException

markDocumentCanceled

public void markDocumentCanceled()
                          throws InvalidActionTakenException
Mark document cancled.

Throws:
ResourceUnavailableException
InvalidActionTakenException

markDocumentDisapproved

public void markDocumentDisapproved()
                             throws InvalidActionTakenException
Mark document disapproved

Throws:
ResourceUnavailableException
InvalidActionTakenException

markDocumentSaved

public void markDocumentSaved()
                       throws InvalidActionTakenException
Mark document saved

Throws:
ResourceUnavailableException
InvalidActionTakenException

markDocumentApproved

public void markDocumentApproved()
                          throws InvalidActionTakenException
Mark the document as being approved.

Throws:
ResourceUnavailableException
InvalidActionTakenException

markDocumentInException

public void markDocumentInException()
                             throws InvalidActionTakenException
Mark the document as being in the exception state.

Throws:
ResourceUnavailableException
InvalidActionTakenException

markDocumentEnroute

public void markDocumentEnroute()
                         throws InvalidActionTakenException
Mark the document as being actively routed.

Throws:
ResourceUnavailableException
InvalidActionTakenException

markDocumentFinalized

public void markDocumentFinalized()
                           throws InvalidActionTakenException
Mark document finalized.

Throws:
ResourceUnavailableException
InvalidActionTakenException

setRouteHeaderData

public void setRouteHeaderData(RouteHeaderDTO routeHeaderVO)
                        throws WorkflowException
This method takes data from a VO and sets it on this route header

Parameters:
routeHeaderVO -
Throws:
WorkflowException

getRootBranch

public Branch getRootBranch()
Convenience method that returns the branch of the first (and presumably only?) initial node

Returns:
the branch of the first (and presumably only?) initial node

findVariable

private BranchState findVariable(String name)
Looks up a variable (embodied in a "BranchState" key/value pair) in the branch state table.


getVariable

public String getVariable(String name)
Gets a variable

Parameters:
name - variable name
Returns:
variable value, or null if variable is not defined

removeVariableThatContains

public void removeVariableThatContains(String name)

setVariable

public void setVariable(String name,
                        String value)
Sets a variable

Parameters:
name - variable name
value - variable value, or null if variable should be removed

getRootBranchState

public List<BranchState> getRootBranchState()

getCustomActionListAttribute

public CustomActionListAttribute getCustomActionListAttribute()
                                                       throws WorkflowException
Throws:
WorkflowException

getCustomEmailAttribute

public CustomEmailAttribute getCustomEmailAttribute()
                                             throws WorkflowException
Throws:
WorkflowException

getCustomNoteAttribute

public CustomNoteAttribute getCustomNoteAttribute()
                                           throws WorkflowException
Throws:
WorkflowException

getDocActionRequest

public ActionRequestValue getDocActionRequest(int index)

getDocActionTaken

public ActionTakenValue getDocActionTaken(int index)

getDocActionItem

public ActionItem getDocActionItem(int index)

getInitialRouteNodeInstance

private RouteNodeInstance getInitialRouteNodeInstance(int index)

isRoutingReport

public boolean isRoutingReport()

setRoutingReport

public void setRoutingReport(boolean routingReport)

getInitialRouteNodeInstances

public List<RouteNodeInstance> getInitialRouteNodeInstances()

setInitialRouteNodeInstances

public void setInitialRouteNodeInstances(List<RouteNodeInstance> initialRouteNodeInstances)

getNotes

public List<Note> getNotes()

setNotes

public void setNotes(List<Note> notes)

getDocumentContent

public DocumentRouteHeaderValueContent getDocumentContent()

setDocumentContent

public void setDocumentContent(DocumentRouteHeaderValueContent documentContent)

getAppDocStatusHistory

public List<DocumentStatusTransition> getAppDocStatusHistory()

setAppDocStatusHistory

public void setAppDocStatusHistory(List<DocumentStatusTransition> appDocStatusHistory)


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