Class ProcessInstanceManagerImpl
- java.lang.Object
-
- org.silverpeas.core.workflow.engine.instance.ProcessInstanceManagerImpl
-
- All Implemented Interfaces:
ProcessInstanceManager
,UpdatableProcessInstanceManager
@Service @Singleton public class ProcessInstanceManagerImpl extends Object implements UpdatableProcessInstanceManager
A ProcessInstanceManager implementation
-
-
Constructor Summary
Constructors Constructor Description ProcessInstanceManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 instanceProcessInstance
getProcessInstance(String instanceId)
Get the process instances for a given instance idList<ProcessInstance>
getProcessInstances(String peasId, User user, String role)
Get the list of process instances for a given peas Id, user and role.List<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.SilverpeasList<ProcessInstance>
getTimeOutProcessInstances()
Get the list of process instances for which timeout date is overvoid
lock(ProcessInstance instance, State state, User user)
Locks this instance for the given instance and statevoid
removeProcessInstance(String instanceId)
Removes a new process instancevoid
removeProcessInstanceData(ProcessInstance instance)
void
unlock(ProcessInstance instance, State state, User user)
unlocks this instance for the given instance and state
-
-
-
Method Detail
-
getProcessInstances
public List<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 interfaceProcessInstanceManager
- Parameters:
peasId
- id of processManager instanceuser
- user for who the process instance list isrole
- 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 List<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 interfaceProcessInstanceManager
- Parameters:
peasId
- id of processManager instanceuser
- user for who the process instance list isrole
- role name of the user for who the process instance list is (useful when user hasuserRoles
- all role names that user has for this component instance different roles)- 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 interfaceProcessInstanceManager
- 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 interfaceUpdatableProcessInstanceManager
- 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 interfaceUpdatableProcessInstanceManager
- 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 interfaceUpdatableProcessInstanceManager
- Parameters:
state
- state that have to be lockeduser
- the locking userinstance
- 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 interfaceUpdatableProcessInstanceManager
- Parameters:
state
- state that have to be lockeduser
- the locking userinstance
- instance that have to be locked- Throws:
WorkflowException
-
createHistoryStep
public HistoryStep createHistoryStep()
Build a new HistoryStep.- Specified by:
createHistoryStep
in interfaceProcessInstanceManager
- 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 interfaceProcessInstanceManager
-
getTimeOutProcessInstances
public SilverpeasList<ProcessInstance> getTimeOutProcessInstances() throws WorkflowException
Get the list of process instances for which timeout date is over- Specified by:
getTimeOutProcessInstances
in interfaceProcessInstanceManager
- Returns:
- an array of ProcessInstance objects
- Throws:
WorkflowException
-
-