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.bo.KewPersistableBusinessObjectBase
              extended by org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue
All Implemented Interfaces:
java.io.Serializable, org.apache.ojb.broker.PersistenceBrokerAware, org.kuali.rice.kns.bo.BusinessObject, PersistableBusinessObject
Direct Known Subclasses:
DocumentRouteHeaderValueActionListExtension

@Sequence(name="KREW_DOC_HDR_S",
          property="routeHeaderId")
public class DocumentRouteHeaderValue
extends KewPersistableBusinessObjectBase

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
static java.lang.String CURRENT_ROUTE_NODE_NAME_DELIMITER
           
protected static java.util.HashMap<java.lang.String,java.lang.String> legalActions
           
protected static java.util.HashMap<java.lang.String,java.lang.String> stateTransitionMap
           
 
Fields inherited from class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
extension, versionNumber
 
Constructor Summary
DocumentRouteHeaderValue()
           
 
Method Summary
 java.lang.Object copy(boolean preserveKeys)
           
 java.util.List<ActionItem> getActionItems()
           
 java.util.List<ActionRequestValue> getActionRequests()
           
 java.util.List<ActionTakenValue> getActionsTaken()
           
 java.lang.String getAppDocId()
           
 java.lang.String getAppDocStatus()
          This method returns the Application Document Status.
 java.sql.Timestamp getAppDocStatusDate()
           
 java.util.List<DocumentStatusTransition> getAppDocStatusHistory()
           
 java.sql.Timestamp getApprovedDate()
           
 java.lang.String getCombinedStatus()
          This method returns a combination of the route status label and the app doc status.
 java.sql.Timestamp getCreateDate()
           
 java.util.List<java.lang.String> getCurrentNodeNames()
           
 java.lang.String getCurrentRouteLevelName()
           
 CustomActionListAttribute getCustomActionListAttribute()
           
 CustomEmailAttribute getCustomEmailAttribute()
           
 CustomNoteAttribute getCustomNoteAttribute()
           
 ActionItem getDocActionItem(int index)
           
 ActionRequestValue getDocActionRequest(int index)
           
 ActionTakenValue getDocActionTaken(int index)
           
 java.lang.String getDocContent()
           
 java.lang.Integer getDocRouteLevel()
           
 java.lang.String getDocRouteStatus()
           
 java.lang.String getDocRouteStatusLabel()
           
 java.lang.String getDocStatusPolicy()
          This method returns the Document Status Policy for the document type associated with this Route Header.
 java.lang.String getDocTitle()
           
 DocumentRouteHeaderValueContent getDocumentContent()
           
 DocumentType getDocumentType()
           
 java.lang.Long getDocumentTypeId()
           
 java.lang.Integer getDocVersion()
           
 java.sql.Timestamp getFinalizedDate()
           
 java.util.List<RouteNodeInstance> getInitialRouteNodeInstances()
           
 java.lang.String getInitiatorDisplayName()
           
 org.kuali.rice.kim.bo.entity.KimPrincipal getInitiatorPrincipal()
           
 java.lang.String getInitiatorWorkflowId()
           
 java.util.List<Note> getNotes()
           
 java.util.Collection getQueueItems()
           
 Branch getRootBranch()
          Convenience method that returns the branch of the first (and presumably only?) initial node
 java.util.List<BranchState> getRootBranchState()
           
 java.lang.String getRoutedByDisplayName()
           
 org.kuali.rice.kim.bo.entity.KimPrincipal getRoutedByPrincipal()
           
 java.lang.String getRoutedByUserWorkflowId()
           
 java.lang.Long getRouteHeaderId()
           
 java.sql.Timestamp getRouteLevelDate()
           
 java.sql.Timestamp getRouteStatusDate()
           
 java.lang.String getRouteStatusLabel()
           
 java.sql.Timestamp getStatusModDate()
           
 java.lang.String getVariable(java.lang.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(java.lang.String actionCd)
          Return true if the given action code is valid for this document's current state.
 boolean isValidStatusChange(java.lang.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(java.lang.String name)
           
 void setActionItems(java.util.List<ActionItem> actionItems)
           
 void setActionRequests(java.util.List<ActionRequestValue> actionRequests)
           
 void setActionsTaken(java.util.List<ActionTakenValue> actionsTaken)
           
 void setAppDocId(java.lang.String appDocId)
           
 void setAppDocStatus(java.lang.String appDocStatus)
           
 void setAppDocStatusDate(java.sql.Timestamp appDocStatusDate)
           
 void setAppDocStatusHistory(java.util.List<DocumentStatusTransition> appDocStatusHistory)
           
 void setApprovedDate(java.sql.Timestamp approvedDate)
           
 void setCreateDate(java.sql.Timestamp createDate)
           
 void setDocContent(java.lang.String docContent)
           
 void setDocRouteLevel(java.lang.Integer docRouteLevel)
           
 void setDocRouteStatus(java.lang.String docRouteStatus)
           
 void setDocTitle(java.lang.String docTitle)
           
 void setDocumentContent(DocumentRouteHeaderValueContent documentContent)
           
 void setDocumentTypeId(java.lang.Long docTypeId)
           
 void setDocVersion(java.lang.Integer docVersion)
           
 void setFinalizedDate(java.sql.Timestamp finalizedDate)
           
 void setInitialRouteNodeInstances(java.util.List<RouteNodeInstance> initialRouteNodeInstances)
           
 void setInitiatorWorkflowId(java.lang.String initiatorWorkflowId)
           
 void setNotes(java.util.List<Note> notes)
           
 void setQueueItems(java.util.Collection queueItems)
           
 void setRoutedByUserWorkflowId(java.lang.String routedByUserWorkflowId)
           
 void setRouteHeaderData(org.kuali.rice.kew.dto.RouteHeaderDTO routeHeaderVO)
          This method takes data from a VO and sets it on this route header
 void setRouteHeaderId(java.lang.Long routeHeaderId)
           
 void setRouteLevelDate(java.sql.Timestamp routeLevelDate)
           
 void setRouteStatus(java.lang.String newStatus, boolean finalState)
           
 void setRouteStatusDate(java.sql.Timestamp routeStatusDate)
           
 void setRoutingReport(boolean routingReport)
           
 void setStatusModDate(java.sql.Timestamp statusModDate)
           
 void setVariable(java.lang.String name, java.lang.String value)
          Sets a variable
 java.lang.String toString()
           
protected  java.util.LinkedHashMap toStringMapper()
          This overridden method ...
 void updateAppDocStatus(java.lang.String appDocStatus)
          This method sets the appDocStatus.
 
Methods inherited from class org.kuali.rice.kew.bo.KewPersistableBusinessObjectBase
beforeInsert
 
Methods inherited from class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
addNote, afterDelete, afterInsert, afterLookup, afterUpdate, beforeDelete, beforeInsert, beforeUpdate, beforeUpdate, buildListOfDeletionAwareLists, deleteNote, getAttachmentService, getBoNote, getBoNotes, getExtension, getNoteService, getObjectId, getPersistenceService, getPersistenceStructureService, getVersionNumber, isAutoIncrementSet, isBoNotesSupport, isNewCollectionRecord, linkEditableUserFields, refresh, refreshNonUpdateableReferences, refreshReferenceObject, setAutoIncrementSet, setBoNotes, setExtension, setNewCollectionRecord, setObjectId, setVersionNumber, supportsBoNotes
 
Methods inherited from class org.kuali.rice.kns.bo.BusinessObjectBase
prepareForWorkflow, toStringBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.kns.bo.BusinessObject
prepareForWorkflow
 

Field Detail

CURRENT_ROUTE_NODE_NAME_DELIMITER

public static final java.lang.String CURRENT_ROUTE_NODE_NAME_DELIMITER
See Also:
Constant Field Values

legalActions

protected static final java.util.HashMap<java.lang.String,java.lang.String> legalActions

stateTransitionMap

protected static final java.util.HashMap<java.lang.String,java.lang.String> stateTransitionMap
Constructor Detail

DocumentRouteHeaderValue

public DocumentRouteHeaderValue()
Method Detail

getInitiatorPrincipal

public org.kuali.rice.kim.bo.entity.KimPrincipal getInitiatorPrincipal()

getRoutedByPrincipal

public org.kuali.rice.kim.bo.entity.KimPrincipal getRoutedByPrincipal()

getInitiatorDisplayName

public java.lang.String getInitiatorDisplayName()

getRoutedByDisplayName

public java.lang.String getRoutedByDisplayName()

getCurrentRouteLevelName

public java.lang.String getCurrentRouteLevelName()

getCurrentNodeNames

public java.util.List<java.lang.String> getCurrentNodeNames()

getRouteStatusLabel

public java.lang.String getRouteStatusLabel()

getDocRouteStatusLabel

public java.lang.String getDocRouteStatusLabel()

getDocStatusPolicy

public java.lang.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 java.util.Collection getQueueItems()

setQueueItems

public void setQueueItems(java.util.Collection queueItems)

getActionItems

public java.util.List<ActionItem> getActionItems()

setActionItems

public void setActionItems(java.util.List<ActionItem> actionItems)

getActionsTaken

public java.util.List<ActionTakenValue> getActionsTaken()

setActionsTaken

public void setActionsTaken(java.util.List<ActionTakenValue> actionsTaken)

getActionRequests

public java.util.List<ActionRequestValue> getActionRequests()

setActionRequests

public void setActionRequests(java.util.List<ActionRequestValue> actionRequests)

getDocumentType

public DocumentType getDocumentType()

getAppDocId

public java.lang.String getAppDocId()

setAppDocId

public void setAppDocId(java.lang.String appDocId)

getApprovedDate

public java.sql.Timestamp getApprovedDate()

setApprovedDate

public void setApprovedDate(java.sql.Timestamp approvedDate)

getCreateDate

public java.sql.Timestamp getCreateDate()

setCreateDate

public void setCreateDate(java.sql.Timestamp createDate)

getDocContent

public java.lang.String getDocContent()

setDocContent

public void setDocContent(java.lang.String docContent)

getDocRouteLevel

public java.lang.Integer getDocRouteLevel()

setDocRouteLevel

public void setDocRouteLevel(java.lang.Integer docRouteLevel)

getDocRouteStatus

public java.lang.String getDocRouteStatus()

setDocRouteStatus

public void setDocRouteStatus(java.lang.String docRouteStatus)

getDocTitle

public java.lang.String getDocTitle()

setDocTitle

public void setDocTitle(java.lang.String docTitle)

getDocumentTypeId

public java.lang.Long getDocumentTypeId()

setDocumentTypeId

public void setDocumentTypeId(java.lang.Long docTypeId)

getDocVersion

public java.lang.Integer getDocVersion()

setDocVersion

public void setDocVersion(java.lang.Integer docVersion)

getFinalizedDate

public java.sql.Timestamp getFinalizedDate()

setFinalizedDate

public void setFinalizedDate(java.sql.Timestamp finalizedDate)

getInitiatorWorkflowId

public java.lang.String getInitiatorWorkflowId()

setInitiatorWorkflowId

public void setInitiatorWorkflowId(java.lang.String initiatorWorkflowId)

getRoutedByUserWorkflowId

public java.lang.String getRoutedByUserWorkflowId()

setRoutedByUserWorkflowId

public void setRoutedByUserWorkflowId(java.lang.String routedByUserWorkflowId)

getRouteHeaderId

public java.lang.Long getRouteHeaderId()

setRouteHeaderId

public void setRouteHeaderId(java.lang.Long routeHeaderId)

getRouteLevelDate

public java.sql.Timestamp getRouteLevelDate()

setRouteLevelDate

public void setRouteLevelDate(java.sql.Timestamp routeLevelDate)

getRouteStatusDate

public java.sql.Timestamp getRouteStatusDate()

setRouteStatusDate

public void setRouteStatusDate(java.sql.Timestamp routeStatusDate)

getStatusModDate

public java.sql.Timestamp getStatusModDate()

setStatusModDate

public void setStatusModDate(java.sql.Timestamp statusModDate)

getAppDocStatus

public java.lang.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(java.lang.String appDocStatus)

getCombinedStatus

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

Returns:

updateAppDocStatus

public void updateAppDocStatus(java.lang.String appDocStatus)
                        throws org.kuali.rice.kew.exception.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:
org.kuali.rice.kew.exception.WorkflowRuntimeException

getAppDocStatusDate

public java.sql.Timestamp getAppDocStatusDate()

setAppDocStatusDate

public void setAppDocStatusDate(java.sql.Timestamp appDocStatusDate)

copy

public java.lang.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(java.lang.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(java.lang.String newStatus)

setRouteStatus

public void setRouteStatus(java.lang.String newStatus,
                           boolean finalState)
                    throws org.kuali.rice.kew.exception.InvalidActionTakenException
Throws:
org.kuali.rice.kew.exception.InvalidActionTakenException

markDocumentProcessed

public void markDocumentProcessed()
                           throws org.kuali.rice.kew.exception.InvalidActionTakenException
Mark the document as being processed.

Throws:
org.kuali.rice.kew.exception.ResourceUnavailableException
org.kuali.rice.kew.exception.InvalidActionTakenException

markDocumentCanceled

public void markDocumentCanceled()
                          throws org.kuali.rice.kew.exception.InvalidActionTakenException
Mark document cancled.

Throws:
org.kuali.rice.kew.exception.ResourceUnavailableException
org.kuali.rice.kew.exception.InvalidActionTakenException

markDocumentDisapproved

public void markDocumentDisapproved()
                             throws org.kuali.rice.kew.exception.InvalidActionTakenException
Mark document disapproved

Throws:
org.kuali.rice.kew.exception.ResourceUnavailableException
org.kuali.rice.kew.exception.InvalidActionTakenException

markDocumentSaved

public void markDocumentSaved()
                       throws org.kuali.rice.kew.exception.InvalidActionTakenException
Mark document saved

Throws:
org.kuali.rice.kew.exception.ResourceUnavailableException
org.kuali.rice.kew.exception.InvalidActionTakenException

markDocumentApproved

public void markDocumentApproved()
                          throws org.kuali.rice.kew.exception.InvalidActionTakenException
Mark the document as being approved.

Throws:
org.kuali.rice.kew.exception.ResourceUnavailableException
org.kuali.rice.kew.exception.InvalidActionTakenException

markDocumentInException

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

Throws:
org.kuali.rice.kew.exception.ResourceUnavailableException
org.kuali.rice.kew.exception.InvalidActionTakenException

markDocumentEnroute

public void markDocumentEnroute()
                         throws org.kuali.rice.kew.exception.InvalidActionTakenException
Mark the document as being actively routed.

Throws:
org.kuali.rice.kew.exception.ResourceUnavailableException
org.kuali.rice.kew.exception.InvalidActionTakenException

markDocumentFinalized

public void markDocumentFinalized()
                           throws org.kuali.rice.kew.exception.InvalidActionTakenException
Mark document finalized.

Throws:
org.kuali.rice.kew.exception.ResourceUnavailableException
org.kuali.rice.kew.exception.InvalidActionTakenException

setRouteHeaderData

public void setRouteHeaderData(org.kuali.rice.kew.dto.RouteHeaderDTO routeHeaderVO)
                        throws org.kuali.rice.kew.exception.WorkflowException
This method takes data from a VO and sets it on this route header

Parameters:
routeHeaderVO -
Throws:
org.kuali.rice.kew.exception.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

getVariable

public java.lang.String getVariable(java.lang.String name)
Gets a variable

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

removeVariableThatContains

public void removeVariableThatContains(java.lang.String name)

setVariable

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

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

getRootBranchState

public java.util.List<BranchState> getRootBranchState()

getCustomActionListAttribute

public CustomActionListAttribute getCustomActionListAttribute()
                                                       throws org.kuali.rice.kew.exception.WorkflowException
Throws:
org.kuali.rice.kew.exception.WorkflowException

getCustomEmailAttribute

public CustomEmailAttribute getCustomEmailAttribute()
                                             throws org.kuali.rice.kew.exception.WorkflowException
Throws:
org.kuali.rice.kew.exception.WorkflowException

getCustomNoteAttribute

public CustomNoteAttribute getCustomNoteAttribute()
                                           throws org.kuali.rice.kew.exception.WorkflowException
Throws:
org.kuali.rice.kew.exception.WorkflowException

getDocActionRequest

public ActionRequestValue getDocActionRequest(int index)

getDocActionTaken

public ActionTakenValue getDocActionTaken(int index)

getDocActionItem

public ActionItem getDocActionItem(int index)

isRoutingReport

public boolean isRoutingReport()

setRoutingReport

public void setRoutingReport(boolean routingReport)

getInitialRouteNodeInstances

public java.util.List<RouteNodeInstance> getInitialRouteNodeInstances()

setInitialRouteNodeInstances

public void setInitialRouteNodeInstances(java.util.List<RouteNodeInstance> initialRouteNodeInstances)

getNotes

public java.util.List<Note> getNotes()

setNotes

public void setNotes(java.util.List<Note> notes)

getDocumentContent

public DocumentRouteHeaderValueContent getDocumentContent()

setDocumentContent

public void setDocumentContent(DocumentRouteHeaderValueContent documentContent)

getAppDocStatusHistory

public java.util.List<DocumentStatusTransition> getAppDocStatusHistory()

setAppDocStatusHistory

public void setAppDocStatusHistory(java.util.List<DocumentStatusTransition> appDocStatusHistory)

toString

public java.lang.String toString()
Overrides:
toString in class BusinessObjectBase
See Also:
Object.toString()

toStringMapper

protected java.util.LinkedHashMap toStringMapper()
This overridden method ...

Specified by:
toStringMapper in class BusinessObjectBase
Returns:
Map containing the fieldValues of the key fields for this class, indexed by fieldName
See Also:
BusinessObjectBase.toStringMapper()


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