org.infoglue.cms.entities.mydesktop
Class WorkflowVO

java.lang.Object
  extended by org.infoglue.cms.entities.mydesktop.WorkflowVO
All Implemented Interfaces:
java.io.Serializable, BaseEntityVO

public class WorkflowVO
extends java.lang.Object
implements BaseEntityVO

This is the general action description object. Can be used by any workflow engine hopefully.

Author:
Mattias Bogeblad
See Also:
Serialized Form

Field Summary
static int STATUS_NOT_OK
           
static int STATUS_OK
           
 
Constructor Summary
WorkflowVO()
           
WorkflowVO(java.lang.Long workflowId, java.lang.String name)
           
 
Method Summary
 java.util.List getAvailableActions()
          Returns the available actions, i.e., the actions associated with the current steps.
 java.util.List getAvailableActions(StepFilter filter)
          Returns the actions associated with the current steps allowed by the given step filter
 java.util.List getCurrentSteps()
           
 java.util.List getCurrentSteps(StepFilter filter)
          Returns all the current steps allowed by the given filter.
 java.util.List getDeclaredSteps()
           
 java.util.List getGlobalActions()
           
 java.util.List getHistorySteps()
           
 java.lang.Integer getId()
           
 long getIdAsPrimitive()
           
 WorkflowActionVO getInitialAction(java.lang.Integer id)
          Returns the initial action with the given ID.
 java.util.List getInitialActions()
           
 java.lang.String getName()
           
 int getStatus()
           
 java.lang.String getStatusMessage()
           
 java.util.List getSteps()
          Returns the current and history steps
 java.lang.String getTitle()
           
 java.lang.Long getWorkflowId()
           
 void setCurrentSteps(java.util.List steps)
           
 void setDeclaredSteps(java.util.List steps)
           
 void setGlobalActions(java.util.List actions)
           
 void setHistorySteps(java.util.List steps)
           
 void setId(java.lang.Integer id)
           
 void setInitialActions(java.util.List actions)
           
 void setName(java.lang.String name)
           
 void setStatus(int status)
           
 void setStatusMessage(java.lang.String statusMessage)
           
 void setTitle(java.lang.String title)
           
 void setWorkflowId(java.lang.Long workflowId)
           
 java.lang.String toString()
           
 ConstraintExceptionBuffer validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_OK

public static final int STATUS_OK
See Also:
Constant Field Values

STATUS_NOT_OK

public static final int STATUS_NOT_OK
See Also:
Constant Field Values
Constructor Detail

WorkflowVO

public WorkflowVO()

WorkflowVO

public WorkflowVO(java.lang.Long workflowId,
                  java.lang.String name)
Method Detail

getId

public java.lang.Integer getId()
Specified by:
getId in interface BaseEntityVO

setId

public void setId(java.lang.Integer id)

getIdAsPrimitive

public long getIdAsPrimitive()

getWorkflowId

public java.lang.Long getWorkflowId()

setWorkflowId

public void setWorkflowId(java.lang.Long workflowId)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getTitle

public java.lang.String getTitle()

setTitle

public void setTitle(java.lang.String title)

getDeclaredSteps

public java.util.List getDeclaredSteps()

setDeclaredSteps

public void setDeclaredSteps(java.util.List steps)

getCurrentSteps

public java.util.List getCurrentSteps()

getCurrentSteps

public java.util.List getCurrentSteps(StepFilter filter)
Returns all the current steps allowed by the given filter. Useful to restrict the current steps for display, e.g. return only the steps owned by the current user.

Parameters:
filter - a StepFilter
Returns:
the current steps allowed by filter

setCurrentSteps

public void setCurrentSteps(java.util.List steps)

getHistorySteps

public java.util.List getHistorySteps()

setHistorySteps

public void setHistorySteps(java.util.List steps)

getInitialActions

public java.util.List getInitialActions()

setInitialActions

public void setInitialActions(java.util.List actions)

getGlobalActions

public java.util.List getGlobalActions()

setGlobalActions

public void setGlobalActions(java.util.List actions)

getSteps

public java.util.List getSteps()
Returns the current and history steps

Returns:
a list of WorkflowStepVOs representing all current and history steps for this workflow

getAvailableActions

public java.util.List getAvailableActions()
Returns the available actions, i.e., the actions associated with the current steps.

Returns:
a list of WorkflowActionVOs representing the available actions in this workflow.

getAvailableActions

public java.util.List getAvailableActions(StepFilter filter)
Returns the actions associated with the current steps allowed by the given step filter

Parameters:
filter - a step filter that allows the desired steps to pass through
Returns:
a list of WorkflowActionVOs representing the actions associated with the current steps allowed by filter
See Also:
getCurrentSteps(StepFilter)

getInitialAction

public WorkflowActionVO getInitialAction(java.lang.Integer id)
Returns the initial action with the given ID. Since the number of initial actions expected to be small, an iterative match works fine here. We don't need to introduce the overhead of a map until we get more than 5 initial actions, which seems far-fetched for a realistic workflow.

Parameters:
id - the id of the desired initial action
Returns:
the initial action with id
Throws:
java.lang.IllegalArgumentException - if no initial action exists with id
java.lang.NullPointerException - if id is null.

toString

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

validate

public ConstraintExceptionBuffer validate()
Specified by:
validate in interface BaseEntityVO
Returns:
ConstraintExceptionBuffer

getStatusMessage

public java.lang.String getStatusMessage()

setStatusMessage

public void setStatusMessage(java.lang.String statusMessage)

getStatus

public int getStatus()

setStatus

public void setStatus(int status)


Copyright © 2005 InfoGlue.org All Rights Reserved.