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
ConstructorsConstructorDescriptionProcessInstanceServiceImpl(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, BPMFailureService bpmFailureService) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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(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 voiddeleteConnectorInstancesIfNecessary(SFlowNodeInstance flowNodeInstance, SProcessDefinition processDefinition) voiddeleteFlowNodeInstance(SFlowNodeInstance flowNodeInstance, SProcessDefinition processDefinition) longdeleteParentProcessInstanceAndElements(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) 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) getLastArchivedProcessInstanceStartDates(long sinceDateInMillis) Get the list of all archived process instance start dates since the given datelonggetNumberOfArchivedProcessInstances(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 supervisorlongGet 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 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 allSProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate.searchFailedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) Search allSProcessInstancewith at least one failed task or theProcessInstanceState.ERRORstate 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 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 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, BPMFailureService bpmFailureService)
-
-
Method Details
-
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, SProcessInstanceNotFoundException Description 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(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(List<Long> sourceProcessInstanceIds) throws SBonitaException Description 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 List<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 List<Long> getChildInstanceIdsOfProcessInstance(long processInstanceId, int fromIndex, int maxResults, String sortingField, OrderByType sortingOrder) throws SProcessInstanceReadException Description 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 SProcessInstanceReadException Description 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
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 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 SBonitaReadException Description 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 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 SBonitaReadException Description 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 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 SBonitaReadException Description 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 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 SBonitaReadException Description 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 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 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 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 SBonitaReadException Description 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 SBonitaReadException Description 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 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 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 List<SAProcessInstance> getArchivedProcessInstancesInAllStates(List<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
-
getLastArchivedProcessInstanceStartDates
public List<Long> getLastArchivedProcessInstanceStartDates(long sinceDateInMillis) throws SProcessInstanceReadException Description copied from interface:ProcessInstanceServiceGet the list of all archived process instance start dates since the given date- Specified by:
getLastArchivedProcessInstanceStartDatesin interfaceProcessInstanceService- Parameters:
sinceDateInMillis- the date since when we want to get the list of start dates (in milliseconds)- Returns:
- the list of all archived process instance start dates, expressed in millis since EPOCH.
- Throws:
SProcessInstanceReadException- if an exception occurs while reading the process instances
-
getStateIdsFromStates
-
getArchivedChildrenSourceObjectIdsFromRootProcessInstance
public List<Long> getArchivedChildrenSourceObjectIdsFromRootProcessInstance(long rootProcessInstanceId, int fromIndex, int maxResults, OrderByType sortingOrder) throws SBonitaReadException Description 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 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
- Specified by:
getNumberOfProcessInstancesin interfaceProcessInstanceService- Throws:
SBonitaReadException
-
getProcessInstanceIdsToRecover
public List<Long> getProcessInstanceIdsToRecover(Duration considerElementsOlderThan, QueryOptions queryOptions) throws SBonitaReadException Description 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, SProcessInstanceModificationException Description copied from interface:ProcessInstanceServiceSet which event interrupted the process instance- Specified by:
setInterruptingEventIdin interfaceProcessInstanceService- Throws:
SProcessInstanceNotFoundExceptionSProcessInstanceReadExceptionSProcessInstanceModificationException
-