com.silverpeas.workflow.engine.instance
Class ProcessInstanceManagerImpl

java.lang.Object
  extended by com.silverpeas.workflow.engine.instance.ProcessInstanceManagerImpl
All Implemented Interfaces:
ProcessInstanceManager, UpdatableProcessInstanceManager

public class ProcessInstanceManagerImpl
extends Object
implements UpdatableProcessInstanceManager

A ProcessInstanceManager implementation


Constructor Summary
ProcessInstanceManagerImpl()
           
 
Method Summary
 Actor createActor(User user, String roleName, State state)
          Builds an actor from a user and a role.
 HistoryStep createHistoryStep()
          Build a new HistoryStep.
 ProcessInstance createProcessInstance(String modelId)
          Creates a new process instance
 ProcessInstance getProcessInstance(String instanceId)
          Get the process instances for a given instance id
 ProcessInstance[] getProcessInstances(String peasId, User user, String role)
          Get the list of process instances for a given peas Id, user and role.
 ProcessInstance[] getProcessInstances(String peasId, User user, String role, String[] userRoles, String[] userGroupIds)
          Get the list of process instances for a given peas Id, user and role, and user's roles.
 ProcessInstance[] getProcessInstancesInState(String peasId, State state)
          Get the list of process instances for a given peas Id, that have the given state activated and
 ProcessInstance[] getTimeOutProcessInstances()
          Get the list of process instances for which timeout date is over
 void lock(ProcessInstance instance, State state, User user)
          Locks this instance for the given instance and state
 void removeProcessInstance(String instanceId)
          Removes a new process instance
 void removeProcessInstanceData(ProcessInstance instance)
           
 void unlock(ProcessInstance instance, State state, User user)
          unlocks this instance for the given instance and state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessInstanceManagerImpl

public ProcessInstanceManagerImpl()
Method Detail

getProcessInstances

public ProcessInstance[] getProcessInstances(String peasId,
                                             User user,
                                             String role)
                                      throws WorkflowException
Description copied from interface: ProcessInstanceManager
Get the list of process instances for a given peas Id, user and role.

Specified by:
getProcessInstances in interface ProcessInstanceManager
Parameters:
peasId - id of processManager instance
user - user for who the process instance list is
role - role name of the user for who the process instance list is (useful when user has different roles)
Returns:
an array of ProcessInstance objects
Throws:
WorkflowException

getProcessInstances

public ProcessInstance[] getProcessInstances(String peasId,
                                             User user,
                                             String role,
                                             String[] userRoles,
                                             String[] userGroupIds)
                                      throws WorkflowException
Description copied from interface: ProcessInstanceManager
Get the list of process instances for a given peas Id, user and role, and user's roles.

Specified by:
getProcessInstances in interface ProcessInstanceManager
Parameters:
peasId - id of processManager instance
user - user for who the process instance list is
role - role name of the user for who the process instance list is (useful when user has
userRoles - all role names that user has for this component instance different roles)
Returns:
an array of ProcessInstance objects
Throws:
WorkflowException

getProcessInstancesInState

public ProcessInstance[] getProcessInstancesInState(String peasId,
                                                    State state)
                                             throws WorkflowException
Get the list of process instances for a given peas Id, that have the given state activated and

Specified by:
getProcessInstancesInState in interface ProcessInstanceManager
Parameters:
peasId - id of processManager instance
state - activated state
Returns:
an array of ProcessInstance objects
Throws:
WorkflowException

getProcessInstance

public ProcessInstance getProcessInstance(String instanceId)
                                   throws WorkflowException
Get the process instances for a given instance id

Specified by:
getProcessInstance in interface ProcessInstanceManager
Parameters:
instanceId - id of searched instance
Returns:
the searched process instance
Throws:
WorkflowException

createProcessInstance

public ProcessInstance createProcessInstance(String modelId)
                                      throws WorkflowException
Creates a new process instance

Specified by:
createProcessInstance in interface UpdatableProcessInstanceManager
Parameters:
modelId - model id
Returns:
the new ProcessInstance object
Throws:
WorkflowException

removeProcessInstance

public void removeProcessInstance(String instanceId)
                           throws WorkflowException
Removes a new process instance

Specified by:
removeProcessInstance in interface UpdatableProcessInstanceManager
Parameters:
instanceId - instance id
Throws:
WorkflowException

removeProcessInstanceData

public void removeProcessInstanceData(ProcessInstance instance)
                               throws WorkflowException
Throws:
WorkflowException

lock

public void lock(ProcessInstance instance,
                 State state,
                 User user)
          throws WorkflowException
Locks this instance for the given instance and state

Specified by:
lock in interface UpdatableProcessInstanceManager
Parameters:
state - state that have to be locked
user - the locking user
instance - instance that have to be locked
Throws:
WorkflowException

unlock

public void unlock(ProcessInstance instance,
                   State state,
                   User user)
            throws WorkflowException
unlocks this instance for the given instance and state

Specified by:
unlock in interface UpdatableProcessInstanceManager
Parameters:
state - state that have to be locked
user - the locking user
instance - instance that have to be locked
Throws:
WorkflowException

createHistoryStep

public HistoryStep createHistoryStep()
Build a new HistoryStep.

Specified by:
createHistoryStep in interface ProcessInstanceManager
Returns:
an object implementing HistoryStep interface.

createActor

public Actor createActor(User user,
                         String roleName,
                         State state)
Builds an actor from a user and a role.

Specified by:
createActor in interface ProcessInstanceManager
Parameters:
user -
roleName -
state -
Returns:

getTimeOutProcessInstances

public ProcessInstance[] getTimeOutProcessInstances()
                                             throws WorkflowException
Get the list of process instances for which timeout date is over

Specified by:
getTimeOutProcessInstances in interface ProcessInstanceManager
Returns:
an array of ProcessInstance objects
Throws:
WorkflowException


Copyright © 2016 Silverpeas. All Rights Reserved.