Class ProcessInstanceServiceImpl
java.lang.Object
org.bonitasoft.engine.core.process.instance.impl.ProcessInstanceServiceImpl
- All Implemented Interfaces:
ProcessInstanceService
- Author:
- Elias Ricken de Medeiros, Matthieu Chaffotte, Yanyan Liu, Frederic Bouquet, Celine Souchet
-
Field Summary
Fields inherited from interface org.bonitasoft.engine.core.process.instance.api.ProcessInstanceService
EVENT_TRIGGER_INSTANCE, PROCESS_INSTANCE_CATEGORY_STATE, PROCESSINSTANCE, PROCESSINSTANCE_STATE, PROCESSINSTANCE_STATE_UPDATED, PROCESSINSTANCE_TOKEN_COUNT
-
Constructor Summary
ConstructorDescriptionProcessInstanceServiceImpl
(Recorder recorder, ReadPersistenceService persistenceRead, ActivityInstanceService activityService, EventInstanceService bpmEventInstanceService, DataInstanceService dataInstanceService, ArchiveService archiveService, ProcessDefinitionService processDefinitionService, ConnectorInstanceService connectorInstanceService, ClassLoaderService classLoaderService, DocumentService documentService, SCommentService commentService, RefBusinessDataService refBusinessDataService, ContractDataService contractDataService) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkIfCallerIsNotActive
(long callerId) void
createProcessInstance
(SProcessInstance processInstance) Create process instance in DB according to the given process instance objectvoid
deleteArchivedProcessInstance
(SAProcessInstance archivedProcessInstance) Delete specified archived process instanceint
deleteArchivedProcessInstances
(List<Long> sourceProcessInstanceIds) delete archived process instances using a list of root source process instance ids If the given id is not a root process instance (but a called process) it will not be deleted along with its elements.protected void
deleteConnectorInstancesIfNecessary
(SFlowNodeInstance flowNodeInstance, SProcessDefinition processDefinition) void
deleteFlowNodeInstance
(SFlowNodeInstance flowNodeInstance, SProcessDefinition processDefinition) long
deleteParentProcessInstanceAndElements
(List<SProcessInstance> sProcessInstances) Delete the specified process instances with id, and their elements archived and not, if are not a subProcessvoid
deleteParentProcessInstanceAndElements
(SProcessInstance sProcessInstance) Delete the specified process instance, and its elements archived and not, if are not a subProcessvoid
deleteProcessInstance
(long processInstanceId) Delete the id specified process instancevoid
deleteProcessInstance
(SProcessInstance sProcessInstance) Delete the specified process instanceprotected void
deleteProcessInstanceElements
(SProcessInstance processInstance) getArchivedChildrenSourceObjectIdsFromRootProcessInstance
(long rootProcessInstanceId, int fromIndex, int maxResults, OrderByType sortingOrder) Get the list of sourceObjectIds for archived process instances children of process instance identified by rootProcessIntanceIdgetArchivedProcessInstance
(long archivedProcessInstanceId) Get the latest archived process instance object for the specific process instancegetArchivedProcessInstancesInAllStates
(List<Long> processInstanceIds) Get the archived process instances corresponding to the identifiersgetChildInstanceIdsOfProcessInstance
(long processInstanceId, int fromIndex, int maxResults, String sortingField, OrderByType sortingOrder) Get child instance identifiers for specific process instance, this can be used for paginationgetChildOfActivity
(long activityInstId) Get child process instance for the specific call activity or subprocess activitygetLastArchivedProcessInstance
(long processInstanceId) long
getNumberOfArchivedProcessInstances
(QueryOptions queryOptions) Get total number of archived process instances according to specific criterialong
getNumberOfArchivedProcessInstancesInvolvingUser
(long userId, QueryOptions countOptions) Get total number of archived process instance involving the specific userlong
getNumberOfArchivedProcessInstancesSupervisedBy
(long userId, QueryOptions countOptions) Get total number of archived process instance for the specific supervisorlong
Get total number of archived process instance according to the search criterialong
getNumberOfChildInstancesOfProcessInstance
(long processInstanceId) Get total number of child instance for specific process instancelong
getNumberOfFailedProcessInstances
(QueryOptions queryOptions) Get the number of theSProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state.long
getNumberOfFailedProcessInstancesSupervisedBy
(long userId, QueryOptions queryOptions) Get total number ofSProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state for the specific supervisorlong
getNumberOfOpenProcessInstancesInvolvingUser
(long userId, QueryOptions queryOptions) Get total number of open process instance involving the specific userlong
getNumberOfOpenProcessInstancesInvolvingUsersManagedBy
(long managerUserId, QueryOptions queryOptions) Get total number of open process instance involving all users of the specific managerlong
getNumberOfOpenProcessInstancesSupervisedBy
(long userId, QueryOptions queryOptions) Get total number of open process instances for the specific supervisorlong
getNumberOfProcessInstances
(long processDefinitionId) long
getNumberOfProcessInstances
(QueryOptions queryOptions) Get total number of process instancesgetProcessInstance
(long processInstanceId) Get process instance by its idgetProcessInstanceIdsToRecover
(Duration considerElementsOlderThan, QueryOptions queryOptions) Retrieve ids of process instances nodes that needs to be recovered.getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition
(long processDefinitionId, int fromIndex, int maxResults, OrderByType sortingOrder) getStateIdsFromStates
(org.bonitasoft.engine.bpm.process.ProcessInstanceState... states) searchArchivedProcessInstances
(QueryOptions queryOptions) Search all archived process instance according to specific criteriasearchArchivedProcessInstancesInvolvingUser
(long userId, QueryOptions queryOptions) Search all archived process instance involving the specific usersearchArchivedProcessInstancesSupervisedBy
(long userId, QueryOptions queryOptions) Search all archived process instance for the specific supervisorsearchArchivedProcessInstancesWithoutSubProcess
(QueryOptions queryOptions) Search all archived process instance according to the search criteriasearchFailedProcessInstances
(QueryOptions queryOptions) List allSProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state.searchFailedProcessInstancesSupervisedBy
(long userId, QueryOptions queryOptions) Search allSProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state for the specific supervisorsearchOpenProcessInstancesInvolvingUser
(long userId, QueryOptions queryOptions) Search all open process instance involving the specific usersearchOpenProcessInstancesInvolvingUsersManagedBy
(long managerUserId, QueryOptions queryOptions) Search all open process instance involving all users of the specific managersearchOpenProcessInstancesSupervisedBy
(long userId, QueryOptions queryOptions) Search all open process instances for the specific supervisorsearchProcessInstances
(QueryOptions queryOptions) Search all process instance according to specific criteriavoid
setInterruptingEventId
(long parentProcessInstanceId, long eventInstanceId) Set which event interrupted the process instancevoid
setState
(SProcessInstance processInstance, org.bonitasoft.engine.bpm.process.ProcessInstanceState state) Set state for the processInstancevoid
setStateCategory
(SProcessInstance processInstance, SStateCategory stateCatetory) Set process state category for the given process instancevoid
updateProcess
(SProcessInstance processInstance, EntityUpdateDescriptor descriptor) Update the specific process instance
-
Constructor Details
-
ProcessInstanceServiceImpl
public ProcessInstanceServiceImpl(Recorder recorder, ReadPersistenceService persistenceRead, ActivityInstanceService activityService, EventInstanceService bpmEventInstanceService, DataInstanceService dataInstanceService, ArchiveService archiveService, ProcessDefinitionService processDefinitionService, ConnectorInstanceService connectorInstanceService, ClassLoaderService classLoaderService, DocumentService documentService, SCommentService commentService, RefBusinessDataService refBusinessDataService, ContractDataService contractDataService)
-
-
Method Details
-
createProcessInstance
public void createProcessInstance(SProcessInstance processInstance) throws SProcessInstanceCreationException Description copied from interface:ProcessInstanceService
Create process instance in DB according to the given process instance object- Specified by:
createProcessInstance
in interfaceProcessInstanceService
- Parameters:
processInstance
- the processInstance- Throws:
SProcessInstanceCreationException
-
getProcessInstance
public SProcessInstance getProcessInstance(long processInstanceId) throws SProcessInstanceReadException, SProcessInstanceNotFoundException Description copied from interface:ProcessInstanceService
Get process instance by its id- Specified by:
getProcessInstance
in interfaceProcessInstanceService
- Parameters:
processInstanceId
- identifier of process instance- Returns:
- the process instance object
- Throws:
SProcessInstanceReadException
SProcessInstanceNotFoundException
-
deleteProcessInstance
public void deleteProcessInstance(long processInstanceId) throws SProcessInstanceModificationException, SProcessInstanceReadException, SProcessInstanceNotFoundException Description copied from interface:ProcessInstanceService
Delete the id specified process instance- Specified by:
deleteProcessInstance
in interfaceProcessInstanceService
- Parameters:
processInstanceId
- identifier of process instance- Throws:
SProcessInstanceModificationException
SProcessInstanceReadException
SProcessInstanceNotFoundException
-
deleteParentProcessInstanceAndElements
public long deleteParentProcessInstanceAndElements(List<SProcessInstance> sProcessInstances) throws SBonitaException Description copied from interface:ProcessInstanceService
Delete the specified process instances with id, and their elements archived and not, if are not a subProcess- Specified by:
deleteParentProcessInstanceAndElements
in interfaceProcessInstanceService
- Parameters:
sProcessInstances
- list of process instances to deleted- Returns:
- Number of deleted process instances
- Throws:
SBonitaException
-
deleteParentProcessInstanceAndElements
public void deleteParentProcessInstanceAndElements(SProcessInstance sProcessInstance) throws SBonitaException Description copied from interface:ProcessInstanceService
Delete the specified process instance, and its elements archived and not, if are not a subProcess- Specified by:
deleteParentProcessInstanceAndElements
in interfaceProcessInstanceService
- Parameters:
sProcessInstance
- TheSProcessInstance
to delete- Throws:
SBonitaException
-
deleteArchivedProcessInstances
public int deleteArchivedProcessInstances(List<Long> sourceProcessInstanceIds) throws SBonitaException Description copied from interface:ProcessInstanceService
delete archived process instances using a list of root source process instance ids If the given id is not a root process instance (but a called process) it will not be deleted along with its elements.- Specified by:
deleteArchivedProcessInstances
in interfaceProcessInstanceService
- Parameters:
sourceProcessInstanceIds
- list of root source process instance ids- Returns:
- the number of archived elements deleted (might be greater than the number of ids given)
- Throws:
SBonitaException
-
deleteArchivedProcessInstance
public void deleteArchivedProcessInstance(SAProcessInstance archivedProcessInstance) throws SProcessInstanceModificationException Description copied from interface:ProcessInstanceService
Delete specified archived process instance- Specified by:
deleteArchivedProcessInstance
in interfaceProcessInstanceService
- Parameters:
archivedProcessInstance
- the archived process instance- Throws:
SProcessInstanceModificationException
-
getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition
public List<Long> getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition(long processDefinitionId, int fromIndex, int maxResults, OrderByType sortingOrder) throws SProcessInstanceReadException - Specified by:
getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition
in interfaceProcessInstanceService
- Returns:
- Throws:
SProcessInstanceReadException
-
deleteProcessInstance
public void deleteProcessInstance(SProcessInstance sProcessInstance) throws SProcessInstanceModificationException Description copied from interface:ProcessInstanceService
Delete the specified process instance- Specified by:
deleteProcessInstance
in interfaceProcessInstanceService
- Parameters:
sProcessInstance
- the process instance- Throws:
SProcessInstanceModificationException
-
checkIfCallerIsNotActive
protected void checkIfCallerIsNotActive(long callerId) throws SFlowNodeReadException, SProcessInstanceHierarchicalDeletionException -
deleteProcessInstanceElements
protected void deleteProcessInstanceElements(SProcessInstance processInstance) throws SBonitaException - Throws:
SBonitaException
-
deleteConnectorInstancesIfNecessary
protected void deleteConnectorInstancesIfNecessary(SFlowNodeInstance flowNodeInstance, SProcessDefinition processDefinition) throws SConnectorInstanceReadException, SConnectorInstanceDeletionException -
deleteFlowNodeInstance
public void deleteFlowNodeInstance(SFlowNodeInstance flowNodeInstance, SProcessDefinition processDefinition) throws SProcessInstanceModificationException - Specified by:
deleteFlowNodeInstance
in interfaceProcessInstanceService
- Throws:
SProcessInstanceModificationException
-
setState
public void setState(SProcessInstance processInstance, org.bonitasoft.engine.bpm.process.ProcessInstanceState state) throws SProcessInstanceModificationException Description copied from interface:ProcessInstanceService
Set state for the processInstance- Specified by:
setState
in interfaceProcessInstanceService
- Parameters:
processInstance
- the process instance will be updatedstate
- the state will be set to the process instance- Throws:
SProcessInstanceModificationException
-
setStateCategory
public void setStateCategory(SProcessInstance processInstance, SStateCategory stateCatetory) throws SProcessInstanceModificationException Description copied from interface:ProcessInstanceService
Set process state category for the given process instance- Specified by:
setStateCategory
in interfaceProcessInstanceService
- Parameters:
processInstance
- process instance to updatestateCatetory
- new category state for the process instance- Throws:
SProcessInstanceModificationException
-
getChildInstanceIdsOfProcessInstance
public List<Long> getChildInstanceIdsOfProcessInstance(long processInstanceId, int fromIndex, int maxResults, String sortingField, OrderByType sortingOrder) throws SProcessInstanceReadException Description copied from interface:ProcessInstanceService
Get child instance identifiers for specific process instance, this can be used for pagination- Specified by:
getChildInstanceIdsOfProcessInstance
in interfaceProcessInstanceService
- Parameters:
processInstanceId
- identifier of process instancefromIndex
- Index of the record to be retrieved from. First record has index 0maxResults
- Number of result we want to get. Maximum number of result returnedsortingField
- the field used to do ordersortingOrder
- ASC or DESC- Returns:
- a list of identifiers
- Throws:
SProcessInstanceReadException
-
getChildOfActivity
public SProcessInstance getChildOfActivity(long activityInstId) throws SProcessInstanceNotFoundException, SBonitaReadException Description copied from interface:ProcessInstanceService
Get child process instance for the specific call activity or subprocess activity- Specified by:
getChildOfActivity
in interfaceProcessInstanceService
- Parameters:
activityInstId
- identifier of call activity or subprocess activity- Returns:
- an SProcessInstance object
- Throws:
SProcessInstanceNotFoundException
SBonitaReadException
-
getNumberOfChildInstancesOfProcessInstance
public long getNumberOfChildInstancesOfProcessInstance(long processInstanceId) throws SProcessInstanceReadException Description copied from interface:ProcessInstanceService
Get total number of child instance for specific process instance- Specified by:
getNumberOfChildInstancesOfProcessInstance
in interfaceProcessInstanceService
- Parameters:
processInstanceId
- identifier of process instance- Returns:
- number of child instance for the process instance
- Throws:
SProcessInstanceReadException
-
getNumberOfProcessInstances
Description copied from interface:ProcessInstanceService
Get total number of process instances- Specified by:
getNumberOfProcessInstances
in interfaceProcessInstanceService
- Parameters:
queryOptions
- a map of specific parameters of a query- Returns:
- total number of process instances
- Throws:
SBonitaReadException
-
searchProcessInstances
public List<SProcessInstance> searchProcessInstances(QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Search all process instance according to specific criteria- Specified by:
searchProcessInstances
in interfaceProcessInstanceService
- Parameters:
queryOptions
- a map of specific parameters of a query- Returns:
- a list of SProcessInstance objects
- Throws:
SBonitaReadException
-
getNumberOfOpenProcessInstancesSupervisedBy
public long getNumberOfOpenProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Get total number of open process instances for the specific supervisor- Specified by:
getNumberOfOpenProcessInstancesSupervisedBy
in interfaceProcessInstanceService
- Parameters:
userId
- identifier of supervisor userqueryOptions
- a map of specific parameters of a query- Returns:
- number of open process instance for the specific supervisor
- Throws:
SBonitaReadException
-
searchOpenProcessInstancesSupervisedBy
public List<SProcessInstance> searchOpenProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Search all open process instances for the specific supervisor- Specified by:
searchOpenProcessInstancesSupervisedBy
in interfaceProcessInstanceService
- Parameters:
userId
- identifier of supervisor userqueryOptions
- a map of specific parameters of a query- Returns:
- a list of SProcessInstance objects
- Throws:
SBonitaReadException
-
getNumberOfFailedProcessInstancesSupervisedBy
public long getNumberOfFailedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Get total number ofSProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state for the specific supervisor- Specified by:
getNumberOfFailedProcessInstancesSupervisedBy
in interfaceProcessInstanceService
- Parameters:
userId
- identifier of supervisor userqueryOptions
- a map of specific parameters of a query- Returns:
- The number of the
SProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state for the specific supervisor - Throws:
SBonitaReadException
-
searchFailedProcessInstancesSupervisedBy
public List<SProcessInstance> searchFailedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Search allSProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state for the specific supervisor- Specified by:
searchFailedProcessInstancesSupervisedBy
in interfaceProcessInstanceService
- Parameters:
userId
- identifier of supervisor userqueryOptions
- a map of specific parameters of a query- Returns:
- The list of
SProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state for the specific supervisor - Throws:
SBonitaReadException
-
getNumberOfOpenProcessInstancesInvolvingUser
public long getNumberOfOpenProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Get total number of open process instance involving the specific user- Specified by:
getNumberOfOpenProcessInstancesInvolvingUser
in interfaceProcessInstanceService
- Parameters:
userId
- identifier of user who can perform or be assigned to tasks in process instance.queryOptions
- a map of specific parameters of a query- Returns:
- number of open process instance for the specific user
- Throws:
SBonitaReadException
-
searchOpenProcessInstancesInvolvingUser
public List<SProcessInstance> searchOpenProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Search all open process instance involving the specific user- Specified by:
searchOpenProcessInstancesInvolvingUser
in interfaceProcessInstanceService
- Parameters:
userId
- identifier of user who can perform or be assigned to tasks in process instance.- Returns:
- a list of SProcessInstance objects
- Throws:
SBonitaReadException
-
getNumberOfOpenProcessInstancesInvolvingUsersManagedBy
public long getNumberOfOpenProcessInstancesInvolvingUsersManagedBy(long managerUserId, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Get total number of open process instance involving all users of the specific manager- Specified by:
getNumberOfOpenProcessInstancesInvolvingUsersManagedBy
in interfaceProcessInstanceService
- Returns:
- Throws:
SBonitaReadException
-
searchOpenProcessInstancesInvolvingUsersManagedBy
public List<SProcessInstance> searchOpenProcessInstancesInvolvingUsersManagedBy(long managerUserId, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Search all open process instance involving all users of the specific manager- Specified by:
searchOpenProcessInstancesInvolvingUsersManagedBy
in interfaceProcessInstanceService
- Returns:
- Throws:
SBonitaReadException
-
getNumberOfArchivedProcessInstancesWithoutSubProcess
public long getNumberOfArchivedProcessInstancesWithoutSubProcess(QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Get total number of archived process instance according to the search criteria- Specified by:
getNumberOfArchivedProcessInstancesWithoutSubProcess
in interfaceProcessInstanceService
- Parameters:
queryOptions
- the search criteria containing a map of specific parameters of a query- Returns:
- number of archived process instance satisfied to the search criteria
- Throws:
SBonitaReadException
-
searchArchivedProcessInstancesWithoutSubProcess
public List<SAProcessInstance> searchArchivedProcessInstancesWithoutSubProcess(QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Search all archived process instance according to the search criteria- Specified by:
searchArchivedProcessInstancesWithoutSubProcess
in interfaceProcessInstanceService
- Parameters:
queryOptions
- the search criteria containing a map of specific parameters of a query- Returns:
- a list of SAProcessInstance objects
- Throws:
SBonitaReadException
-
searchArchivedProcessInstancesSupervisedBy
public List<SAProcessInstance> searchArchivedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Search all archived process instance for the specific supervisor- Specified by:
searchArchivedProcessInstancesSupervisedBy
in interfaceProcessInstanceService
- Parameters:
userId
- identifier of user who is the supervisor of archived process instance.queryOptions
- the search criteria containing a map of specific parameters of a query- Returns:
- a list of SAProcessInstance objects
- Throws:
SBonitaReadException
-
getNumberOfArchivedProcessInstancesSupervisedBy
public long getNumberOfArchivedProcessInstancesSupervisedBy(long userId, QueryOptions countOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Get total number of archived process instance for the specific supervisor- Specified by:
getNumberOfArchivedProcessInstancesSupervisedBy
in interfaceProcessInstanceService
- Parameters:
userId
- identifier of user who is the supervisor of archived process instance.countOptions
- the search criteria containing a map of specific parameters of a query- Returns:
- number of archived process instance for the specific supervisor
- Throws:
SBonitaReadException
-
getNumberOfArchivedProcessInstancesInvolvingUser
public long getNumberOfArchivedProcessInstancesInvolvingUser(long userId, QueryOptions countOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Get total number of archived process instance involving the specific user- Specified by:
getNumberOfArchivedProcessInstancesInvolvingUser
in interfaceProcessInstanceService
- Parameters:
userId
- the identifier of user who is assignee of tasks of process instancecountOptions
- the search criteria containing a map of specific parameters of a query- Returns:
- number of archived process instance involving the specific user
- Throws:
SBonitaReadException
-
getNumberOfArchivedProcessInstances
public long getNumberOfArchivedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Get total number of archived process instances according to specific criteria- Specified by:
getNumberOfArchivedProcessInstances
in interfaceProcessInstanceService
- Parameters:
queryOptions
- the search criteria containing a map of specific parameters of a query- Returns:
- number of archived process instances
- Throws:
SBonitaReadException
-
searchArchivedProcessInstances
public List<SAProcessInstance> searchArchivedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Search all archived process instance according to specific criteria- Specified by:
searchArchivedProcessInstances
in interfaceProcessInstanceService
- Parameters:
queryOptions
- the search criteria containing a map of specific parameters of a query- Returns:
- A list of all archived process instance according to specific criteria
- Throws:
SBonitaReadException
-
searchArchivedProcessInstancesInvolvingUser
public List<SAProcessInstance> searchArchivedProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Search all archived process instance involving the specific user- Specified by:
searchArchivedProcessInstancesInvolvingUser
in interfaceProcessInstanceService
- Parameters:
userId
- the identifier of user who is assignee of tasks of process instancequeryOptions
- the search criteria containing a map of specific parameters of a query- Returns:
- a list of SAProcessInstance objects
- Throws:
SBonitaReadException
-
updateProcess
public void updateProcess(SProcessInstance processInstance, EntityUpdateDescriptor descriptor) throws SProcessInstanceModificationException Description copied from interface:ProcessInstanceService
Update the specific process instance- Specified by:
updateProcess
in interfaceProcessInstanceService
- Parameters:
processInstance
- the processInstance will be updateddescriptor
- update description- Throws:
SProcessInstanceModificationException
-
getArchivedProcessInstance
public SAProcessInstance getArchivedProcessInstance(long archivedProcessInstanceId) throws SProcessInstanceReadException Description copied from interface:ProcessInstanceService
Get the latest archived process instance object for the specific process instance- Specified by:
getArchivedProcessInstance
in interfaceProcessInstanceService
- Parameters:
archivedProcessInstanceId
- identifier of the archived process instance (not the process instance)- Returns:
- an SAProcessInstance object
- Throws:
SProcessInstanceReadException
-
getArchivedProcessInstancesInAllStates
public List<SAProcessInstance> getArchivedProcessInstancesInAllStates(List<Long> processInstanceIds) throws SProcessInstanceReadException Description copied from interface:ProcessInstanceService
Get the archived process instances corresponding to the identifiers- Specified by:
getArchivedProcessInstancesInAllStates
in interfaceProcessInstanceService
- Returns:
- The list of
SAProcessInstance
- Throws:
SProcessInstanceReadException
-
getStateIdsFromStates
-
getArchivedChildrenSourceObjectIdsFromRootProcessInstance
public List<Long> getArchivedChildrenSourceObjectIdsFromRootProcessInstance(long rootProcessInstanceId, int fromIndex, int maxResults, OrderByType sortingOrder) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Get the list of sourceObjectIds for archived process instances children of process instance identified by rootProcessIntanceId- Specified by:
getArchivedChildrenSourceObjectIdsFromRootProcessInstance
in interfaceProcessInstanceService
- Parameters:
rootProcessInstanceId
- the root process instance idfromIndex
- index of first result to be retriedmaxResults
- max number of results to be retrievedsortingOrder
- the searching order (ASC or DESC)- Returns:
- the list of sourceObjectIds for archived process instances children of process instance identified by rootProcessIntanceId
- Throws:
SBonitaReadException
-
getLastArchivedProcessInstance
public SAProcessInstance getLastArchivedProcessInstance(long processInstanceId) throws SBonitaReadException - Specified by:
getLastArchivedProcessInstance
in interfaceProcessInstanceService
- Parameters:
processInstanceId
- The source identifier of the process instance- Returns:
- The last archived process instance
- Throws:
SBonitaReadException
-
getNumberOfFailedProcessInstances
public long getNumberOfFailedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Get the number of theSProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state.- Specified by:
getNumberOfFailedProcessInstances
in interfaceProcessInstanceService
- Parameters:
queryOptions
- the search criteria containing a map of specific parameters of a query- Returns:
- The number of the
SProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state. - Throws:
SBonitaReadException
-
searchFailedProcessInstances
public List<SProcessInstance> searchFailedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
List allSProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state.- Specified by:
searchFailedProcessInstances
in interfaceProcessInstanceService
- Parameters:
queryOptions
- the search criteria containing a map of specific parameters of a query- Returns:
- The list of
SProcessInstance
with at least one failed task or theProcessInstanceState.ERROR
state. - Throws:
SBonitaReadException
-
getNumberOfProcessInstances
- Specified by:
getNumberOfProcessInstances
in interfaceProcessInstanceService
- Throws:
SBonitaReadException
-
getProcessInstanceIdsToRecover
public List<Long> getProcessInstanceIdsToRecover(Duration considerElementsOlderThan, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProcessInstanceService
Retrieve ids of process instances nodes that needs to be recovered. This is used by recover mechanism ProcessInstanceRecoveryService- Specified by:
getProcessInstanceIdsToRecover
in interfaceProcessInstanceService
- Parameters:
considerElementsOlderThan
- consider elements older than that durationqueryOptions
- used for pagination- Throws:
SBonitaReadException
-
setInterruptingEventId
public void setInterruptingEventId(long parentProcessInstanceId, long eventInstanceId) throws SProcessInstanceNotFoundException, SProcessInstanceReadException, SProcessInstanceModificationException Description copied from interface:ProcessInstanceService
Set which event interrupted the process instance- Specified by:
setInterruptingEventId
in interfaceProcessInstanceService
- Throws:
SProcessInstanceNotFoundException
SProcessInstanceReadException
SProcessInstanceModificationException
-