com.basecmp.core.persistence.util
Class WorkflowHelper

java.lang.Object
  extended byAbstractHelper
      extended bycom.basecmp.core.persistence.util.WorkflowHelper

public class WorkflowHelper
extends AbstractHelper

See Also:
Serialized Form

Field Summary
static java.lang.Long EOW
          Indicates end of workflow (both directions).
 
Method Summary
static boolean addAssigneeToWorkflowStep(java.lang.Long workflowStepId, java.lang.String principal)
          Assigns the given group (principal) to the given workflowstep.
static java.lang.String calculateNewOnlineState(java.lang.Long newStepId, java.lang.String currentOnlineState)
          Calculates the onlinestate for a given workflowstep in relation to the current workflowstep.
static java.util.List getAssigneesOfWorkflowStep(java.lang.Long workflowStepId)
          Reads all assignments of the given workflowstep dynamically from the database and return a list of all assigned groups (principals).
static java.lang.Long getFirstStepId(java.lang.Long workflowId)
           
static java.lang.Long getFirstStepIdByAsset(PersistentAsset asset)
           
static java.lang.Long getFirstStepIdByStep(java.lang.Long stepId)
           
static java.lang.String getInitialOnlineState(java.lang.Long workflowId)
           
static java.lang.Long getNextExpiredWorkflowStep(java.lang.Long stepId)
          Finds the next workflowstep with the onlinestate 'expired' and returns the step-id, otherwise EOW (-1).
static java.lang.Long getNextLiveWorkflowStep(java.lang.Long stepId)
          Finds the next workflowstep with the onlinestate 'live' and returns the step-id, otherwise EOW (-1).
static java.lang.Long getNextWorkflowStep(java.lang.Long stepId)
          Returns the stepId of the next workflowstep for the given workflowstep.
static java.lang.Long getNextWorkflowStepForAsset(PersistentAsset asset)
          Returns the stepId of the next workflowstep for the given asset.
static java.lang.String getOnlineState(java.lang.Long stepId)
           
static java.lang.Long getOnStoreWorkflowStep(java.lang.Long stepId)
           
static java.lang.Long getOnStoreWorkflowStep(PersistentAsset asset)
           
static java.lang.Long getPreviousWorkflowStep(java.lang.Long stepId)
          Returns the stepId of the previous workflowstep for the given workflowstep.
static java.lang.Long getPreviousWorkflowStepForAsset(PersistentAsset asset)
          Returns the stepId of the previous workflowstep for the given asset.
static int getStepCount(java.lang.Long workflowId)
           
static java.lang.String getUsecaseOnBackward(java.lang.Long stepId)
           
static java.lang.String getUsecaseOnEnter(java.lang.Long stepId)
           
static java.lang.String getUsecaseOnExit(java.lang.Long stepId)
           
static java.lang.String getUsecaseOnForward(java.lang.Long stepId)
           
static java.lang.Long getWorkflowId(java.lang.Long stepId)
           
static boolean isAssignedToWorkflowStep(java.lang.Long workflowStepId, java.util.List principals)
          Reads dynamically the assignment-data from database and returns true if at least one of the given groups (pricipals) is assigned to the given workflowstep.
static boolean isAssignedToWorkflowStep(java.lang.Long workflowStepId, java.lang.String principal)
          Reads dynamically the assignment-data from database and returns true if the given group (principal) is assigned to the given workflowstep.
static boolean isNextStepLive(java.lang.Long stepId)
           
static boolean isPreviousStepLive(java.lang.Long stepId)
           
static boolean isStepExpired(java.lang.Long stepId)
           
static boolean isStepLive(java.lang.Long stepId)
           
protected  void load()
           
 void processEvent(java.util.EventObject event)
           
static boolean removeAssigneeFromWorkflowStep(java.lang.Long workflowStepId, java.lang.String principal)
          Removes any assignment of the given group (principal) from the given workflowstep.
static int stepChangeDirection(java.lang.Long newStepId, java.lang.Long currentStepId)
           
static int stepChangeDirection(java.lang.Long newStepId, PersistentAsset asset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOW

public static final java.lang.Long EOW
Indicates end of workflow (both directions).

Method Detail

addAssigneeToWorkflowStep

public static boolean addAssigneeToWorkflowStep(java.lang.Long workflowStepId,
                                                java.lang.String principal)
Assigns the given group (principal) to the given workflowstep.


calculateNewOnlineState

public static java.lang.String calculateNewOnlineState(java.lang.Long newStepId,
                                                       java.lang.String currentOnlineState)
Calculates the onlinestate for a given workflowstep in relation to the current workflowstep.

getAssigneesOfWorkflowStep

public static java.util.List getAssigneesOfWorkflowStep(java.lang.Long workflowStepId)
Reads all assignments of the given workflowstep dynamically from the database and return a list of all assigned groups (principals).


getFirstStepId

public static java.lang.Long getFirstStepId(java.lang.Long workflowId)

getFirstStepIdByAsset

public static java.lang.Long getFirstStepIdByAsset(PersistentAsset asset)

getFirstStepIdByStep

public static java.lang.Long getFirstStepIdByStep(java.lang.Long stepId)

getInitialOnlineState

public static java.lang.String getInitialOnlineState(java.lang.Long workflowId)

getNextExpiredWorkflowStep

public static java.lang.Long getNextExpiredWorkflowStep(java.lang.Long stepId)
Finds the next workflowstep with the onlinestate 'expired' and returns the step-id, otherwise EOW (-1).


getNextLiveWorkflowStep

public static java.lang.Long getNextLiveWorkflowStep(java.lang.Long stepId)
Finds the next workflowstep with the onlinestate 'live' and returns the step-id, otherwise EOW (-1).


getNextWorkflowStep

public static java.lang.Long getNextWorkflowStep(java.lang.Long stepId)
Returns the stepId of the next workflowstep for the given workflowstep. Returns null for undefined stepids.


getNextWorkflowStepForAsset

public static java.lang.Long getNextWorkflowStepForAsset(PersistentAsset asset)
Returns the stepId of the next workflowstep for the given asset. Returns null for undefined stepids.


getOnlineState

public static java.lang.String getOnlineState(java.lang.Long stepId)

getOnStoreWorkflowStep

public static java.lang.Long getOnStoreWorkflowStep(java.lang.Long stepId)

getOnStoreWorkflowStep

public static java.lang.Long getOnStoreWorkflowStep(PersistentAsset asset)

getPreviousWorkflowStep

public static java.lang.Long getPreviousWorkflowStep(java.lang.Long stepId)
Returns the stepId of the previous workflowstep for the given workflowstep. Returns null for undefined step-ids.


getPreviousWorkflowStepForAsset

public static java.lang.Long getPreviousWorkflowStepForAsset(PersistentAsset asset)
Returns the stepId of the previous workflowstep for the given asset. Returns null for undefined step-ids.


getStepCount

public static int getStepCount(java.lang.Long workflowId)

getUsecaseOnBackward

public static java.lang.String getUsecaseOnBackward(java.lang.Long stepId)

getUsecaseOnEnter

public static java.lang.String getUsecaseOnEnter(java.lang.Long stepId)

getUsecaseOnExit

public static java.lang.String getUsecaseOnExit(java.lang.Long stepId)

getUsecaseOnForward

public static java.lang.String getUsecaseOnForward(java.lang.Long stepId)

getWorkflowId

public static java.lang.Long getWorkflowId(java.lang.Long stepId)

isAssignedToWorkflowStep

public static boolean isAssignedToWorkflowStep(java.lang.Long workflowStepId,
                                               java.util.List principals)
Reads dynamically the assignment-data from database and returns true if at least one of the given groups (pricipals) is assigned to the given workflowstep.


isAssignedToWorkflowStep

public static boolean isAssignedToWorkflowStep(java.lang.Long workflowStepId,
                                               java.lang.String principal)
Reads dynamically the assignment-data from database and returns true if the given group (principal) is assigned to the given workflowstep.


isNextStepLive

public static boolean isNextStepLive(java.lang.Long stepId)

isPreviousStepLive

public static boolean isPreviousStepLive(java.lang.Long stepId)

isStepExpired

public static boolean isStepExpired(java.lang.Long stepId)

isStepLive

public static boolean isStepLive(java.lang.Long stepId)

load

protected void load()

processEvent

public void processEvent(java.util.EventObject event)

removeAssigneeFromWorkflowStep

public static boolean removeAssigneeFromWorkflowStep(java.lang.Long workflowStepId,
                                                     java.lang.String principal)
Removes any assignment of the given group (principal) from the given workflowstep.


stepChangeDirection

public static int stepChangeDirection(java.lang.Long newStepId,
                                      java.lang.Long currentStepId)

stepChangeDirection

public static int stepChangeDirection(java.lang.Long newStepId,
                                      PersistentAsset asset)


Copyright © 2004 by basecmp® - Professional Web Solutions