Class ProcessInstanceServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.core.process.instance.impl.ProcessInstanceServiceImpl
-
- All Implemented Interfaces:
ProcessInstanceService
- Direct Known Subclasses:
ProcessInstanceService7_7_4
public class ProcessInstanceServiceImpl extends java.lang.Object implements 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
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckIfCallerIsNotActive(long callerId)voidcreateProcessInstance(SProcessInstance processInstance)Create process instance in DB according to the given process instance objectvoiddeleteArchivedProcessInstance(SAProcessInstance archivedProcessInstance)Delete specified archived process instanceintdeleteArchivedProcessInstances(java.util.List<java.lang.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 voiddeleteConnectorInstancesIfNecessary(SFlowNodeInstance flowNodeInstance, SProcessDefinition processDefinition)voiddeleteFlowNodeInstance(SFlowNodeInstance flowNodeInstance, SProcessDefinition processDefinition)longdeleteParentProcessInstanceAndElements(java.util.List<SProcessInstance> sProcessInstances)Delete the specified process instances with id, and their elements archived and not, if are not a subProcessvoiddeleteParentProcessInstanceAndElements(SProcessInstance sProcessInstance)Delete the specified process instance, and its elements archived and not, if are not a subProcessvoiddeleteProcessInstance(long processInstanceId)Delete the id specified process instancevoiddeleteProcessInstance(SProcessInstance sProcessInstance)Delete the specified process instanceprotected voiddeleteProcessInstanceElements(SProcessInstance processInstance)java.util.List<java.lang.Long>getArchivedChildrenSourceObjectIdsFromRootProcessInstance(long rootProcessInstanceId, int fromIndex, int maxResults, OrderByType sortingOrder)Get the list of sourceObjectIds for archived process instances children of process instance identified by rootProcessIntanceIdSAProcessInstancegetArchivedProcessInstance(long archivedProcessInstanceId)Get the latest archived process instance object for the specific process instancejava.util.List<SAProcessInstance>getArchivedProcessInstancesInAllStates(java.util.List<java.lang.Long> processInstanceIds)Get the archived process instances corresponding to the identifiersjava.util.List<java.lang.Long>getChildInstanceIdsOfProcessInstance(long processInstanceId, int fromIndex, int maxResults, java.lang.String sortingField, OrderByType sortingOrder)Get child instance identifiers for specific process instance, this can be used for paginationSProcessInstancegetChildOfActivity(long activityInstId)Get child process instance for the specific call activity or subprocess activitySAProcessInstancegetLastArchivedProcessInstance(long processInstanceId)longgetNumberOfArchivedProcessInstances(QueryOptions queryOptions)Get total number of archived process instances according to specific criterialonggetNumberOfArchivedProcessInstancesInvolvingUser(long userId, QueryOptions countOptions)Get total number of archived process instance involving the specific userlonggetNumberOfArchivedProcessInstancesSupervisedBy(long userId, QueryOptions countOptions)Get total number of archived process instance for the specific supervisorlonggetNumberOfArchivedProcessInstancesWithoutSubProcess(QueryOptions queryOptions)Get total number of archived process instance according to the search criterialonggetNumberOfChildInstancesOfProcessInstance(long processInstanceId)Get total number of child instance for specific process instancelonggetNumberOfFailedProcessInstances(QueryOptions queryOptions)Get the number of theSProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate.longgetNumberOfFailedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions)Get total number ofSProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate for the specific supervisorlonggetNumberOfOpenProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions)Get total number of open process instance involving the specific userlonggetNumberOfOpenProcessInstancesInvolvingUsersManagedBy(long managerUserId, QueryOptions queryOptions)Get total number of open process instance involving all users of the specific managerlonggetNumberOfOpenProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions)Get total number of open process instances for the specific supervisorlonggetNumberOfProcessInstances(long processDefinitionId)longgetNumberOfProcessInstances(QueryOptions queryOptions)Get total number of process instancesSProcessInstancegetProcessInstance(long processInstanceId)Get process instance by its idjava.util.List<java.lang.Long>getProcessInstanceIdsToRecover(java.time.Duration considerElementsOlderThan, QueryOptions queryOptions)Retrieve ids of process instances nodes that needs to be recovered.java.util.List<java.lang.Long>getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition(long processDefinitionId, int fromIndex, int maxResults, OrderByType sortingOrder)protected java.util.Set<java.lang.Integer>getStateIdsFromStates(org.bonitasoft.engine.bpm.process.ProcessInstanceState... states)java.util.List<SAProcessInstance>searchArchivedProcessInstances(QueryOptions queryOptions)Search all archived process instance according to specific criteriajava.util.List<SAProcessInstance>searchArchivedProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions)Search all archived process instance involving the specific userjava.util.List<SAProcessInstance>searchArchivedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions)Search all archived process instance for the specific supervisorjava.util.List<SAProcessInstance>searchArchivedProcessInstancesWithoutSubProcess(QueryOptions queryOptions)Search all archived process instance according to the search criteriajava.util.List<SProcessInstance>searchFailedProcessInstances(QueryOptions queryOptions)List allSProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate.java.util.List<SProcessInstance>searchFailedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions)Search allSProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate for the specific supervisorjava.util.List<SProcessInstance>searchOpenProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions)Search all open process instance involving the specific userjava.util.List<SProcessInstance>searchOpenProcessInstancesInvolvingUsersManagedBy(long managerUserId, QueryOptions queryOptions)Search all open process instance involving all users of the specific managerjava.util.List<SProcessInstance>searchOpenProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions)Search all open process instances for the specific supervisorjava.util.List<SProcessInstance>searchProcessInstances(QueryOptions queryOptions)Search all process instance according to specific criteriavoidsetInterruptingEventId(long parentProcessInstanceId, long eventInstanceId)Set which event interrupted the process instancevoidsetState(SProcessInstance processInstance, org.bonitasoft.engine.bpm.process.ProcessInstanceState state)Set state for the processInstancevoidsetStateCategory(SProcessInstance processInstance, SStateCategory stateCatetory)Set process state category for the given process instancevoidupdateProcess(SProcessInstance processInstance, EntityUpdateDescriptor descriptor)Update the specific process instance
-
-
-
Constructor Detail
-
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 Detail
-
createProcessInstance
public void createProcessInstance(SProcessInstance processInstance) throws SProcessInstanceCreationException
Description copied from interface:ProcessInstanceServiceCreate process instance in DB according to the given process instance object- Specified by:
createProcessInstancein interfaceProcessInstanceService- Parameters:
processInstance- the processInstance- Throws:
SProcessInstanceCreationException
-
getProcessInstance
public SProcessInstance getProcessInstance(long processInstanceId) throws SProcessInstanceReadException, SProcessInstanceNotFoundException
Description copied from interface:ProcessInstanceServiceGet process instance by its id- Specified by:
getProcessInstancein interfaceProcessInstanceService- Parameters:
processInstanceId- identifier of process instance- Returns:
- the process instance object
- Throws:
SProcessInstanceReadExceptionSProcessInstanceNotFoundException
-
deleteProcessInstance
public void deleteProcessInstance(long processInstanceId) throws SProcessInstanceModificationException, SProcessInstanceReadException, SProcessInstanceNotFoundExceptionDescription copied from interface:ProcessInstanceServiceDelete the id specified process instance- Specified by:
deleteProcessInstancein interfaceProcessInstanceService- Parameters:
processInstanceId- identifier of process instance- Throws:
SProcessInstanceModificationExceptionSProcessInstanceReadExceptionSProcessInstanceNotFoundException
-
deleteParentProcessInstanceAndElements
public long deleteParentProcessInstanceAndElements(java.util.List<SProcessInstance> sProcessInstances) throws SBonitaException
Description copied from interface:ProcessInstanceServiceDelete the specified process instances with id, and their elements archived and not, if are not a subProcess- Specified by:
deleteParentProcessInstanceAndElementsin 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:ProcessInstanceServiceDelete the specified process instance, and its elements archived and not, if are not a subProcess- Specified by:
deleteParentProcessInstanceAndElementsin interfaceProcessInstanceService- Parameters:
sProcessInstance- TheSProcessInstanceto delete- Throws:
SBonitaException
-
deleteArchivedProcessInstances
public int deleteArchivedProcessInstances(java.util.List<java.lang.Long> sourceProcessInstanceIds) throws SBonitaExceptionDescription copied from interface:ProcessInstanceServicedelete 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:
deleteArchivedProcessInstancesin 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:ProcessInstanceServiceDelete specified archived process instance- Specified by:
deleteArchivedProcessInstancein interfaceProcessInstanceService- Parameters:
archivedProcessInstance- the archived process instance- Throws:
SProcessInstanceModificationException
-
getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition
public java.util.List<java.lang.Long> getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition(long processDefinitionId, int fromIndex, int maxResults, OrderByType sortingOrder) throws SProcessInstanceReadException- Specified by:
getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinitionin interfaceProcessInstanceService- Returns:
- Throws:
SProcessInstanceReadException
-
deleteProcessInstance
public void deleteProcessInstance(SProcessInstance sProcessInstance) throws SProcessInstanceModificationException
Description copied from interface:ProcessInstanceServiceDelete the specified process instance- Specified by:
deleteProcessInstancein 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:
deleteFlowNodeInstancein interfaceProcessInstanceService- Throws:
SProcessInstanceModificationException
-
setState
public void setState(SProcessInstance processInstance, org.bonitasoft.engine.bpm.process.ProcessInstanceState state) throws SProcessInstanceModificationException
Description copied from interface:ProcessInstanceServiceSet state for the processInstance- Specified by:
setStatein 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:ProcessInstanceServiceSet process state category for the given process instance- Specified by:
setStateCategoryin interfaceProcessInstanceService- Parameters:
processInstance- process instance to updatestateCatetory- new category state for the process instance- Throws:
SProcessInstanceModificationException
-
getChildInstanceIdsOfProcessInstance
public java.util.List<java.lang.Long> getChildInstanceIdsOfProcessInstance(long processInstanceId, int fromIndex, int maxResults, java.lang.String sortingField, OrderByType sortingOrder) throws SProcessInstanceReadExceptionDescription copied from interface:ProcessInstanceServiceGet child instance identifiers for specific process instance, this can be used for pagination- Specified by:
getChildInstanceIdsOfProcessInstancein 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:ProcessInstanceServiceGet child process instance for the specific call activity or subprocess activity- Specified by:
getChildOfActivityin interfaceProcessInstanceService- Parameters:
activityInstId- identifier of call activity or subprocess activity- Returns:
- an SProcessInstance object
- Throws:
SProcessInstanceNotFoundExceptionSBonitaReadException
-
getNumberOfChildInstancesOfProcessInstance
public long getNumberOfChildInstancesOfProcessInstance(long processInstanceId) throws SProcessInstanceReadExceptionDescription copied from interface:ProcessInstanceServiceGet total number of child instance for specific process instance- Specified by:
getNumberOfChildInstancesOfProcessInstancein interfaceProcessInstanceService- Parameters:
processInstanceId- identifier of process instance- Returns:
- number of child instance for the process instance
- Throws:
SProcessInstanceReadException
-
getNumberOfProcessInstances
public long getNumberOfProcessInstances(QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceGet total number of process instances- Specified by:
getNumberOfProcessInstancesin interfaceProcessInstanceService- Parameters:
queryOptions- a map of specific parameters of a query- Returns:
- total number of process instances
- Throws:
SBonitaReadException
-
searchProcessInstances
public java.util.List<SProcessInstance> searchProcessInstances(QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceSearch all process instance according to specific criteria- Specified by:
searchProcessInstancesin 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 SBonitaReadExceptionDescription copied from interface:ProcessInstanceServiceGet total number of open process instances for the specific supervisor- Specified by:
getNumberOfOpenProcessInstancesSupervisedByin 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 java.util.List<SProcessInstance> searchOpenProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceSearch all open process instances for the specific supervisor- Specified by:
searchOpenProcessInstancesSupervisedByin 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 SBonitaReadExceptionDescription copied from interface:ProcessInstanceServiceGet total number ofSProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate for the specific supervisor- Specified by:
getNumberOfFailedProcessInstancesSupervisedByin interfaceProcessInstanceService- Parameters:
userId- identifier of supervisor userqueryOptions- a map of specific parameters of a query- Returns:
- The number of the
SProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate for the specific supervisor - Throws:
SBonitaReadException
-
searchFailedProcessInstancesSupervisedBy
public java.util.List<SProcessInstance> searchFailedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceSearch allSProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate for the specific supervisor- Specified by:
searchFailedProcessInstancesSupervisedByin interfaceProcessInstanceService- Parameters:
userId- identifier of supervisor userqueryOptions- a map of specific parameters of a query- Returns:
- The list of
SProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate for the specific supervisor - Throws:
SBonitaReadException
-
getNumberOfOpenProcessInstancesInvolvingUser
public long getNumberOfOpenProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions) throws SBonitaReadExceptionDescription copied from interface:ProcessInstanceServiceGet total number of open process instance involving the specific user- Specified by:
getNumberOfOpenProcessInstancesInvolvingUserin 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 java.util.List<SProcessInstance> searchOpenProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceSearch all open process instance involving the specific user- Specified by:
searchOpenProcessInstancesInvolvingUserin 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 SBonitaReadExceptionDescription copied from interface:ProcessInstanceServiceGet total number of open process instance involving all users of the specific manager- Specified by:
getNumberOfOpenProcessInstancesInvolvingUsersManagedByin interfaceProcessInstanceService- Returns:
- Throws:
SBonitaReadException
-
searchOpenProcessInstancesInvolvingUsersManagedBy
public java.util.List<SProcessInstance> searchOpenProcessInstancesInvolvingUsersManagedBy(long managerUserId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceSearch all open process instance involving all users of the specific manager- Specified by:
searchOpenProcessInstancesInvolvingUsersManagedByin interfaceProcessInstanceService- Returns:
- Throws:
SBonitaReadException
-
getNumberOfArchivedProcessInstancesWithoutSubProcess
public long getNumberOfArchivedProcessInstancesWithoutSubProcess(QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceGet total number of archived process instance according to the search criteria- Specified by:
getNumberOfArchivedProcessInstancesWithoutSubProcessin 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 java.util.List<SAProcessInstance> searchArchivedProcessInstancesWithoutSubProcess(QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceSearch all archived process instance according to the search criteria- Specified by:
searchArchivedProcessInstancesWithoutSubProcessin 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 java.util.List<SAProcessInstance> searchArchivedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceSearch all archived process instance for the specific supervisor- Specified by:
searchArchivedProcessInstancesSupervisedByin 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 SBonitaReadExceptionDescription copied from interface:ProcessInstanceServiceGet total number of archived process instance for the specific supervisor- Specified by:
getNumberOfArchivedProcessInstancesSupervisedByin 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 SBonitaReadExceptionDescription copied from interface:ProcessInstanceServiceGet total number of archived process instance involving the specific user- Specified by:
getNumberOfArchivedProcessInstancesInvolvingUserin 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:ProcessInstanceServiceGet total number of archived process instances according to specific criteria- Specified by:
getNumberOfArchivedProcessInstancesin 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 java.util.List<SAProcessInstance> searchArchivedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceSearch all archived process instance according to specific criteria- Specified by:
searchArchivedProcessInstancesin 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 java.util.List<SAProcessInstance> searchArchivedProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceSearch all archived process instance involving the specific user- Specified by:
searchArchivedProcessInstancesInvolvingUserin 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:ProcessInstanceServiceUpdate the specific process instance- Specified by:
updateProcessin interfaceProcessInstanceService- Parameters:
processInstance- the processInstance will be updateddescriptor- update description- Throws:
SProcessInstanceModificationException
-
getArchivedProcessInstance
public SAProcessInstance getArchivedProcessInstance(long archivedProcessInstanceId) throws SProcessInstanceReadException
Description copied from interface:ProcessInstanceServiceGet the latest archived process instance object for the specific process instance- Specified by:
getArchivedProcessInstancein interfaceProcessInstanceService- Parameters:
archivedProcessInstanceId- identifier of the archived process instance (not the process instance)- Returns:
- an SAProcessInstance object
- Throws:
SProcessInstanceReadException
-
getArchivedProcessInstancesInAllStates
public java.util.List<SAProcessInstance> getArchivedProcessInstancesInAllStates(java.util.List<java.lang.Long> processInstanceIds) throws SProcessInstanceReadException
Description copied from interface:ProcessInstanceServiceGet the archived process instances corresponding to the identifiers- Specified by:
getArchivedProcessInstancesInAllStatesin interfaceProcessInstanceService- Returns:
- The list of
SAProcessInstance - Throws:
SProcessInstanceReadException
-
getStateIdsFromStates
protected java.util.Set<java.lang.Integer> getStateIdsFromStates(org.bonitasoft.engine.bpm.process.ProcessInstanceState... states)
-
getArchivedChildrenSourceObjectIdsFromRootProcessInstance
public java.util.List<java.lang.Long> getArchivedChildrenSourceObjectIdsFromRootProcessInstance(long rootProcessInstanceId, int fromIndex, int maxResults, OrderByType sortingOrder) throws SBonitaReadExceptionDescription copied from interface:ProcessInstanceServiceGet the list of sourceObjectIds for archived process instances children of process instance identified by rootProcessIntanceId- Specified by:
getArchivedChildrenSourceObjectIdsFromRootProcessInstancein 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:
getLastArchivedProcessInstancein 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:ProcessInstanceServiceGet the number of theSProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate.- Specified by:
getNumberOfFailedProcessInstancesin interfaceProcessInstanceService- Parameters:
queryOptions- the search criteria containing a map of specific parameters of a query- Returns:
- The number of the
SProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate. - Throws:
SBonitaReadException
-
searchFailedProcessInstances
public java.util.List<SProcessInstance> searchFailedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ProcessInstanceServiceList allSProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate.- Specified by:
searchFailedProcessInstancesin interfaceProcessInstanceService- Parameters:
queryOptions- the search criteria containing a map of specific parameters of a query- Returns:
- The list of
SProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate. - Throws:
SBonitaReadException
-
getNumberOfProcessInstances
public long getNumberOfProcessInstances(long processDefinitionId) throws SBonitaReadException- Specified by:
getNumberOfProcessInstancesin interfaceProcessInstanceService- Throws:
SBonitaReadException
-
getProcessInstanceIdsToRecover
public java.util.List<java.lang.Long> getProcessInstanceIdsToRecover(java.time.Duration considerElementsOlderThan, QueryOptions queryOptions) throws SBonitaReadExceptionDescription copied from interface:ProcessInstanceServiceRetrieve ids of process instances nodes that needs to be recovered. This is used by recover mechanism ProcessInstanceRecoveryService- Specified by:
getProcessInstanceIdsToRecoverin 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, SProcessInstanceModificationExceptionDescription copied from interface:ProcessInstanceServiceSet which event interrupted the process instance- Specified by:
setInterruptingEventIdin interfaceProcessInstanceService- Throws:
SProcessInstanceNotFoundExceptionSProcessInstanceReadExceptionSProcessInstanceModificationException
-
-