org.kuali.rice.kew.routeheader
Class DocumentRouteHeaderValue

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

@Entity
public class DocumentRouteHeaderValue
extends PersistableBusinessObjectBase
implements DocumentContract

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 String CURRENT_ROUTE_NODE_NAME_DELIMITER
           
protected static HashMap<String,String> legalActions
           
protected static HashMap<String,String> stateTransitionMap
           
 
Fields inherited from class org.kuali.rice.krad.bo.PersistableBusinessObjectBase
extension, versionNumber
 
Constructor Summary
DocumentRouteHeaderValue()
           
 
Method Summary
 void applyDocumentUpdate(DocumentUpdate documentUpdate)
           
 Object copy(boolean preserveKeys)
           
static DocumentRouteHeaderValue from(Document document)
           
 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()
           
 String getApplicationDocumentId()
           
 String getApplicationDocumentStatus()
           
 org.joda.time.DateTime getApplicationDocumentStatusDate()
           
 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()
           
 org.joda.time.DateTime getDateApproved()
           
 org.joda.time.DateTime getDateCreated()
           
 org.joda.time.DateTime getDateFinalized()
           
 org.joda.time.DateTime getDateLastModified()
           
 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 getDocumentHandlerUrl()
           
 String getDocumentId()
           
 DocumentType getDocumentType()
           
 String getDocumentTypeId()
           
 String getDocumentTypeName()
           
 Integer getDocVersion()
           
 Timestamp getFinalizedDate()
           
 List<RouteNodeInstance> getInitialRouteNodeInstances()
           
 String getInitiatorDisplayName()
           
 Principal getInitiatorPrincipal()
           
 String getInitiatorPrincipalId()
           
 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 getRoutedByPrincipalId()
           
 String getRoutedByUserWorkflowId()
           
 Timestamp getRouteLevelDate()
           
 Timestamp getRouteStatusDate()
           
 String getRouteStatusLabel()
           
 List<ActionRequestValue> getSimulatedActionRequests()
           
 DocumentStatus getStatus()
           
 Timestamp getStatusModDate()
           
 String getTitle()
           
 String getVariable(String name)
          Gets a variable
 Map<String,String> getVariables()
           
 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 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(String documentTypeId)
           
 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
static Document to(DocumentRouteHeaderValue documentBo)
           
 void updateAppDocStatus(String appDocStatus)
          This method sets the appDocStatus.
 
Methods inherited from class org.kuali.rice.krad.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.krad.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

CURRENT_ROUTE_NODE_NAME_DELIMITER

public static final String CURRENT_ROUTE_NODE_NAME_DELIMITER
See Also:
Constant Field Values

legalActions

protected static final HashMap<String,String> legalActions

stateTransitionMap

protected static final HashMap<String,String> stateTransitionMap
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 String getDocumentTypeId()
Specified by:
getDocumentTypeId in interface DocumentContract

setDocumentTypeId

public void setDocumentTypeId(String documentTypeId)

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()
Specified by:
getDocumentId in interface DocumentContract

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

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

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

applyDocumentUpdate

public void applyDocumentUpdate(DocumentUpdate documentUpdate)

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 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)

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)

getStatus

public DocumentStatus getStatus()
Specified by:
getStatus in interface DocumentContract

getDateCreated

public org.joda.time.DateTime getDateCreated()
Specified by:
getDateCreated in interface DocumentContract

getDateLastModified

public org.joda.time.DateTime getDateLastModified()
Specified by:
getDateLastModified in interface DocumentContract

getDateApproved

public org.joda.time.DateTime getDateApproved()
Specified by:
getDateApproved in interface DocumentContract

getDateFinalized

public org.joda.time.DateTime getDateFinalized()
Specified by:
getDateFinalized in interface DocumentContract

getTitle

public String getTitle()
Specified by:
getTitle in interface DocumentContract

getApplicationDocumentId

public String getApplicationDocumentId()
Specified by:
getApplicationDocumentId in interface DocumentContract

getInitiatorPrincipalId

public String getInitiatorPrincipalId()
Specified by:
getInitiatorPrincipalId in interface DocumentContract

getRoutedByPrincipalId

public String getRoutedByPrincipalId()
Specified by:
getRoutedByPrincipalId in interface DocumentContract

getDocumentTypeName

public String getDocumentTypeName()
Specified by:
getDocumentTypeName in interface DocumentContract

getDocumentHandlerUrl

public String getDocumentHandlerUrl()
Specified by:
getDocumentHandlerUrl in interface DocumentContract

getApplicationDocumentStatus

public String getApplicationDocumentStatus()
Specified by:
getApplicationDocumentStatus in interface DocumentContract

getApplicationDocumentStatusDate

public org.joda.time.DateTime getApplicationDocumentStatusDate()
Specified by:
getApplicationDocumentStatusDate in interface DocumentContract

getVariables

public Map<String,String> getVariables()
Specified by:
getVariables in interface DocumentContract

to

public static Document to(DocumentRouteHeaderValue documentBo)

from

public static DocumentRouteHeaderValue from(Document document)


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