Class DocumentRouteHeaderValue

java.lang.Object
org.kuali.rice.krad.bo.DataObjectBase
org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue
All Implemented Interfaces:
Serializable, Cloneable, org.eclipse.persistence.descriptors.changetracking.ChangeTracker, org.eclipse.persistence.internal.descriptors.PersistenceEntity, org.eclipse.persistence.internal.descriptors.PersistenceObject, org.eclipse.persistence.internal.weaving.PersistenceWeaved, org.eclipse.persistence.internal.weaving.PersistenceWeavedChangeTracking, org.eclipse.persistence.internal.weaving.PersistenceWeavedFetchGroups, org.eclipse.persistence.internal.weaving.PersistenceWeavedRest, org.eclipse.persistence.queries.FetchGroupTracker, org.kuali.rice.core.api.mo.common.GloballyUnique, org.kuali.rice.core.api.mo.common.Versioned, org.kuali.rice.core.api.mo.ModelObjectBasic, org.kuali.rice.kew.api.document.DocumentContract, DocumentSearchCriteriaEbo, org.kuali.rice.krad.bo.BusinessObject, org.kuali.rice.krad.bo.ExternalizableBusinessObject

@Entity public class DocumentRouteHeaderValue extends org.kuali.rice.krad.bo.DataObjectBase implements org.kuali.rice.kew.api.document.DocumentContract, DocumentSearchCriteriaEbo
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 KewApiConstants 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:
  • Field Details

  • Constructor Details

    • DocumentRouteHeaderValue

      public DocumentRouteHeaderValue()
  • Method Details

    • getInitiatorPrincipal

      public org.kuali.rice.kim.api.identity.principal.Principal getInitiatorPrincipal()
    • getRoutedByPrincipal

      public org.kuali.rice.kim.api.identity.principal.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:
    • 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 org.kuali.rice.kew.api.document.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 org.kuali.rice.kew.api.document.DocumentContract
      Specified by:
      getDocumentId in interface DocumentSearchCriteriaEbo
    • setDocumentId

      public void setDocumentId(String documentId)
    • getRouteStatusDate

      public Timestamp getRouteStatusDate()
    • setRouteStatusDate

      public void setRouteStatusDate(Timestamp routeStatusDate)
    • getDateModified

      public Timestamp getDateModified()
    • setDateModified

      public void setDateModified(Timestamp dateModified)
    • 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:
    • 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 org.kuali.rice.kew.api.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.api.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. This method only verifies statically defined action/state transitions, it does not perform full action validation logic.
      Parameters:
      actionCd - The action code to be tested.
      Returns:
      True if the action code is valid for the document's status.
      See Also:
    • isValidStatusChange

      public boolean isValidStatusChange(String newStatus)
    • setRouteStatus

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

      public void markDocumentProcessed() throws org.kuali.rice.kew.api.exception.InvalidActionTakenException
      Mark the document as being processed.
      Throws:
      org.kuali.rice.kew.api.exception.ResourceUnavailableException
      org.kuali.rice.kew.api.exception.InvalidActionTakenException
    • markDocumentCanceled

      public void markDocumentCanceled() throws org.kuali.rice.kew.api.exception.InvalidActionTakenException
      Mark document cancled.
      Throws:
      org.kuali.rice.kew.api.exception.ResourceUnavailableException
      org.kuali.rice.kew.api.exception.InvalidActionTakenException
    • markDocumentRecalled

      public void markDocumentRecalled() throws org.kuali.rice.kew.api.exception.InvalidActionTakenException
      Mark document recalled.
      Throws:
      org.kuali.rice.kew.api.exception.ResourceUnavailableException
      org.kuali.rice.kew.api.exception.InvalidActionTakenException
    • markDocumentDisapproved

      public void markDocumentDisapproved() throws org.kuali.rice.kew.api.exception.InvalidActionTakenException
      Mark document disapproved
      Throws:
      org.kuali.rice.kew.api.exception.ResourceUnavailableException
      org.kuali.rice.kew.api.exception.InvalidActionTakenException
    • markDocumentSaved

      public void markDocumentSaved() throws org.kuali.rice.kew.api.exception.InvalidActionTakenException
      Mark document saved
      Throws:
      org.kuali.rice.kew.api.exception.ResourceUnavailableException
      org.kuali.rice.kew.api.exception.InvalidActionTakenException
    • markDocumentInException

      public void markDocumentInException() throws org.kuali.rice.kew.api.exception.InvalidActionTakenException
      Mark the document as being in the exception state.
      Throws:
      org.kuali.rice.kew.api.exception.ResourceUnavailableException
      org.kuali.rice.kew.api.exception.InvalidActionTakenException
    • markDocumentEnroute

      public void markDocumentEnroute() throws org.kuali.rice.kew.api.exception.InvalidActionTakenException
      Mark the document as being actively routed.
      Throws:
      org.kuali.rice.kew.api.exception.ResourceUnavailableException
      org.kuali.rice.kew.api.exception.InvalidActionTakenException
    • markDocumentFinalized

      public void markDocumentFinalized() throws org.kuali.rice.kew.api.exception.InvalidActionTakenException
      Mark document finalized.
      Throws:
      org.kuali.rice.kew.api.exception.ResourceUnavailableException
      org.kuali.rice.kew.api.exception.InvalidActionTakenException
    • setRouteHeaderData

      public void setRouteHeaderData(org.kuali.rice.kew.api.document.Document routeHeaderVO) throws org.kuali.rice.kew.api.exception.WorkflowException
      This method takes data from a VO and sets it on this route header
      Parameters:
      routeHeaderVO -
      Throws:
      org.kuali.rice.kew.api.exception.WorkflowException
    • applyDocumentUpdate

      public void applyDocumentUpdate(org.kuali.rice.kew.api.document.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 org.kuali.rice.kew.api.exception.WorkflowException
      Throws:
      org.kuali.rice.kew.api.exception.WorkflowException
    • getCustomEmailAttribute

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

      public CustomNoteAttribute getCustomNoteAttribute() throws org.kuali.rice.kew.api.exception.WorkflowException
      Throws:
      org.kuali.rice.kew.api.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 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 org.kuali.rice.kew.api.document.DocumentStatus getStatus()
      Specified by:
      getStatus in interface org.kuali.rice.kew.api.document.DocumentContract
      Specified by:
      getStatus in interface DocumentSearchCriteriaEbo
    • getDateCreated

      public org.joda.time.DateTime getDateCreated()
      Specified by:
      getDateCreated in interface org.kuali.rice.kew.api.document.DocumentContract
      Specified by:
      getDateCreated in interface DocumentSearchCriteriaEbo
    • getDateLastModified

      public org.joda.time.DateTime getDateLastModified()
      Specified by:
      getDateLastModified in interface org.kuali.rice.kew.api.document.DocumentContract
    • getDateApproved

      public org.joda.time.DateTime getDateApproved()
      Specified by:
      getDateApproved in interface org.kuali.rice.kew.api.document.DocumentContract
    • getDateFinalized

      public org.joda.time.DateTime getDateFinalized()
      Specified by:
      getDateFinalized in interface org.kuali.rice.kew.api.document.DocumentContract
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface org.kuali.rice.kew.api.document.DocumentContract
      Specified by:
      getTitle in interface DocumentSearchCriteriaEbo
    • getApplicationDocumentId

      public String getApplicationDocumentId()
      Specified by:
      getApplicationDocumentId in interface org.kuali.rice.kew.api.document.DocumentContract
      Specified by:
      getApplicationDocumentId in interface DocumentSearchCriteriaEbo
    • getInitiatorPrincipalId

      public String getInitiatorPrincipalId()
      Specified by:
      getInitiatorPrincipalId in interface org.kuali.rice.kew.api.document.DocumentContract
      Specified by:
      getInitiatorPrincipalId in interface DocumentSearchCriteriaEbo
    • getRoutedByPrincipalId

      public String getRoutedByPrincipalId()
      Specified by:
      getRoutedByPrincipalId in interface org.kuali.rice.kew.api.document.DocumentContract
    • getDocumentTypeName

      public String getDocumentTypeName()
      Specified by:
      getDocumentTypeName in interface org.kuali.rice.kew.api.document.DocumentContract
      Specified by:
      getDocumentTypeName in interface DocumentSearchCriteriaEbo
    • getDocumentHandlerUrl

      public String getDocumentHandlerUrl()
      Specified by:
      getDocumentHandlerUrl in interface org.kuali.rice.kew.api.document.DocumentContract
    • getApplicationDocumentStatus

      public String getApplicationDocumentStatus()
      Specified by:
      getApplicationDocumentStatus in interface org.kuali.rice.kew.api.document.DocumentContract
      Specified by:
      getApplicationDocumentStatus in interface DocumentSearchCriteriaEbo
    • getApplicationDocumentStatusDate

      public org.joda.time.DateTime getApplicationDocumentStatusDate()
      Specified by:
      getApplicationDocumentStatusDate in interface org.kuali.rice.kew.api.document.DocumentContract
    • getVariables

      public Map<String,String> getVariables()
      Specified by:
      getVariables in interface org.kuali.rice.kew.api.document.DocumentContract
    • to

      public static org.kuali.rice.kew.api.document.Document to(DocumentRouteHeaderValue documentBo)
    • from

      public static DocumentRouteHeaderValue from(org.kuali.rice.kew.api.document.Document document)
    • refresh

      public void refresh()
      Specified by:
      refresh in interface org.kuali.rice.krad.bo.BusinessObject
    • deepCopy

      public DocumentRouteHeaderValue deepCopy(Map<Object,Object> visited)