public interface ProcessInstanceService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EVENT_TRIGGER_INSTANCE |
static java.lang.String |
PROCESS_INSTANCE_CATEGORY_STATE |
static java.lang.String |
PROCESSINSTANCE |
static java.lang.String |
PROCESSINSTANCE_STATE |
static java.lang.String |
PROCESSINSTANCE_STATE_UPDATED |
static java.lang.String |
PROCESSINSTANCE_TOKEN_COUNT |
| Modifier and Type | Method and Description |
|---|---|
void |
createProcessInstance(SProcessInstance processInstance)
Create process instance in DB according to the given process instance object
|
void |
deleteArchivedProcessInstance(SAProcessInstance archivedProcessInstance)
Delete specified archived process instance
|
int |
deleteArchivedProcessInstances(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.
|
void |
deleteFlowNodeInstance(SFlowNodeInstance flowNodeInstance,
SProcessDefinition processDefinition) |
long |
deleteParentProcessInstanceAndElements(java.util.List<SProcessInstance> sProcessInstances)
Delete the specified process instances with id, and their elements archived and not, if are not a subProcess
|
void |
deleteParentProcessInstanceAndElements(SProcessInstance processInstance)
Delete the specified process instance, and its elements archived and not, if are not a subProcess
|
void |
deleteProcessInstance(long processInstanceId)
Delete the id specified process instance
|
void |
deleteProcessInstance(SProcessInstance processInstance)
Delete the specified process instance
|
java.util.List<java.lang.Long> |
getArchivedChildrenSourceObjectIdsFromRootProcessInstance(long rootProcessIntanceId,
int fromIndex,
int maxResults,
OrderByType sortingOrder)
Get the list of sourceObjectIds for archived process instances children of process instance identified by rootProcessIntanceId
|
SAProcessInstance |
getArchivedProcessInstance(long archivedProcessInstanceId)
Get the latest archived process instance object for the specific process instance
|
java.util.List<SAProcessInstance> |
getArchivedProcessInstancesInAllStates(java.util.List<java.lang.Long> processInstanceIds)
Get the archived process instances corresponding to the identifiers
|
java.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 pagination
|
SProcessInstance |
getChildOfActivity(long activityInstId)
Get child process instance for the specific call activity or subprocess activity
|
SAProcessInstance |
getLastArchivedProcessInstance(long sourceObjectProcessInstanceId) |
long |
getNumberOfArchivedProcessInstances(QueryOptions queryOptions)
Get total number of archived process instances according to specific criteria
|
long |
getNumberOfArchivedProcessInstancesInvolvingUser(long userId,
QueryOptions countOptions)
Get total number of archived process instance involving the specific user
|
long |
getNumberOfArchivedProcessInstancesSupervisedBy(long userId,
QueryOptions countOptions)
Get total number of archived process instance for the specific supervisor
|
long |
getNumberOfArchivedProcessInstancesWithoutSubProcess(QueryOptions queryOptions)
Get total number of archived process instance according to the search criteria
|
long |
getNumberOfChildInstancesOfProcessInstance(long processInstanceId)
Get total number of child instance for specific process instance
|
long |
getNumberOfFailedProcessInstances(QueryOptions queryOptions)
Get the number of the
SProcessInstance with at least one failed task or the ProcessInstanceState.ERROR
state. |
long |
getNumberOfFailedProcessInstancesSupervisedBy(long userId,
QueryOptions queryOptions)
Get total number of
SProcessInstance with at least one failed task or the ProcessInstanceState.ERROR
state for the specific supervisor |
long |
getNumberOfOpenProcessInstancesInvolvingUser(long userId,
QueryOptions queryOptions)
Get total number of open process instance involving the specific user
|
long |
getNumberOfOpenProcessInstancesInvolvingUsersManagedBy(long managerUserId,
QueryOptions queryOptions)
Get total number of open process instance involving all users of the specific manager
|
long |
getNumberOfOpenProcessInstancesSupervisedBy(long userId,
QueryOptions queryOptions)
Get total number of open process instances for the specific supervisor
|
long |
getNumberOfProcessInstances(long processDefinitionId) |
long |
getNumberOfProcessInstances(QueryOptions queryOptions)
Get total number of process instances
|
SProcessInstance |
getProcessInstance(long processInstanceId)
Get process instance by its id
|
java.util.List<SProcessInstance> |
getProcessInstancesInStates(QueryOptions queryOptions,
org.bonitasoft.engine.bpm.process.ProcessInstanceState... states)
Returns the list of
SProcessInstances in a given list of states. |
java.util.List<java.lang.Long> |
getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition(long processDefinitionId,
int fromIndex,
int maxResults,
OrderByType sortingOrder) |
java.util.List<SAProcessInstance> |
searchArchivedProcessInstances(QueryOptions queryOptions)
Search all archived process instance according to specific criteria
|
java.util.List<SAProcessInstance> |
searchArchivedProcessInstancesInvolvingUser(long userId,
QueryOptions queryOptions)
Search all archived process instance involving the specific user
|
java.util.List<SAProcessInstance> |
searchArchivedProcessInstancesSupervisedBy(long userId,
QueryOptions queryOptions)
Search all archived process instance for the specific supervisor
|
java.util.List<SAProcessInstance> |
searchArchivedProcessInstancesWithoutSubProcess(QueryOptions queryOptions)
Search all archived process instance according to the search criteria
|
java.util.List<SProcessInstance> |
searchFailedProcessInstances(QueryOptions queryOptions)
List all
SProcessInstance with at least one failed task or the ProcessInstanceState.ERROR state. |
java.util.List<SProcessInstance> |
searchFailedProcessInstancesSupervisedBy(long userId,
QueryOptions queryOptions)
Search all
SProcessInstance with at least one failed task or the ProcessInstanceState.ERROR state
for the specific supervisor |
java.util.List<SProcessInstance> |
searchOpenProcessInstancesInvolvingUser(long userId,
QueryOptions queryOptions)
Search all open process instance involving the specific user
|
java.util.List<SProcessInstance> |
searchOpenProcessInstancesInvolvingUsersManagedBy(long managerUserId,
QueryOptions queryOptions)
Search all open process instance involving all users of the specific manager
|
java.util.List<SProcessInstance> |
searchOpenProcessInstancesSupervisedBy(long userId,
QueryOptions queryOptions)
Search all open process instances for the specific supervisor
|
java.util.List<SProcessInstance> |
searchProcessInstances(QueryOptions queryOptions)
Search all process instance according to specific criteria
|
void |
setState(SProcessInstance processInstance,
org.bonitasoft.engine.bpm.process.ProcessInstanceState state)
Set state for the processInstance
|
void |
setStateCategory(SProcessInstance processInstance,
SStateCategory stateCatetory)
Set process state category for the given process instance
|
void |
updateProcess(SProcessInstance processInstance,
EntityUpdateDescriptor descriptor)
Update the specific process instance
|
static final java.lang.String PROCESSINSTANCE
static final java.lang.String PROCESSINSTANCE_STATE
static final java.lang.String PROCESS_INSTANCE_CATEGORY_STATE
static final java.lang.String PROCESSINSTANCE_STATE_UPDATED
static final java.lang.String PROCESSINSTANCE_TOKEN_COUNT
static final java.lang.String EVENT_TRIGGER_INSTANCE
void createProcessInstance(SProcessInstance processInstance) throws SProcessInstanceCreationException
processInstance - the processInstanceSProcessInstanceCreationExceptionvoid deleteProcessInstance(long processInstanceId)
throws SProcessInstanceNotFoundException,
SProcessInstanceReadException,
SFlowNodeReadException,
SProcessInstanceModificationException,
SProcessInstanceHierarchicalDeletionException
processInstanceId - identifier of process instanceSProcessInstanceNotFoundExceptionSProcessInstanceReadExceptionSFlowNodeReadExceptionSProcessInstanceModificationExceptionSProcessInstanceHierarchicalDeletionExceptionvoid deleteProcessInstance(SProcessInstance processInstance) throws SFlowNodeReadException, SProcessInstanceModificationException, SProcessInstanceHierarchicalDeletionException
processInstance - the process instanceSFlowNodeReadExceptionSProcessInstanceModificationExceptionSProcessInstanceHierarchicalDeletionExceptionlong deleteParentProcessInstanceAndElements(java.util.List<SProcessInstance> sProcessInstances) throws SBonitaException
sProcessInstances - list of process instances to deletedSBonitaExceptionvoid deleteParentProcessInstanceAndElements(SProcessInstance processInstance) throws SBonitaException
processInstance - The SProcessInstance to deleteSBonitaExceptionSProcessInstance getProcessInstance(long processInstanceId) throws SProcessInstanceNotFoundException, SProcessInstanceReadException
processInstanceId - identifier of process instanceSProcessInstanceNotFoundExceptionSProcessInstanceReadExceptionvoid setState(SProcessInstance processInstance, org.bonitasoft.engine.bpm.process.ProcessInstanceState state) throws SProcessInstanceNotFoundException, SProcessInstanceModificationException
processInstance - the process instance will be updatedstate - the state will be set to the process instanceSProcessInstanceNotFoundExceptionSProcessInstanceModificationExceptionvoid setStateCategory(SProcessInstance processInstance, SStateCategory stateCatetory) throws SProcessInstanceNotFoundException, SProcessInstanceModificationException
processInstance - process instance to updatestateCatetory - new category state for the process instanceSProcessInstanceNotFoundExceptionSProcessInstanceModificationExceptionvoid deleteArchivedProcessInstance(SAProcessInstance archivedProcessInstance) throws SProcessInstanceModificationException, SFlowNodeReadException
archivedProcessInstance - the archived process instanceSProcessInstanceModificationExceptionSFlowNodeReadExceptionint deleteArchivedProcessInstances(java.util.List<java.lang.Long> sourceProcessInstanceIds)
throws SBonitaException
sourceProcessInstanceIds - list of root source process instance idsSBonitaExceptionjava.util.List<java.lang.Long> getChildInstanceIdsOfProcessInstance(long processInstanceId,
int fromIndex,
int maxResults,
java.lang.String sortingField,
OrderByType sortingOrder)
throws SProcessInstanceReadException
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 DESCSProcessInstanceReadExceptionSProcessInstance getChildOfActivity(long activityInstId) throws SProcessInstanceNotFoundException, SBonitaReadException
activityInstId - identifier of call activity or subprocess activitySProcessInstanceNotFoundExceptionSBonitaReadExceptionlong getNumberOfChildInstancesOfProcessInstance(long processInstanceId)
throws SProcessInstanceReadException
processInstanceId - identifier of process instanceSProcessInstanceReadExceptionjava.util.List<SAProcessInstance> getArchivedProcessInstancesInAllStates(java.util.List<java.lang.Long> processInstanceIds) throws SProcessInstanceReadException
archivedProcessInstanceIds - Identifier of the SAProcessInstancesSAProcessInstanceSProcessInstanceReadExceptionlong getNumberOfArchivedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - the search criteria containing a map of specific parameters of a querySBonitaReadExceptionjava.util.List<SAProcessInstance> searchArchivedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - the search criteria containing a map of specific parameters of a querySBonitaReadExceptionSAProcessInstance getArchivedProcessInstance(long archivedProcessInstanceId) throws SProcessInstanceReadException
archivedProcessInstanceId - identifier of the archived process instance (not the process instance)persistenceService - SProcessInstanceReadExceptionlong getNumberOfProcessInstances(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - a map of specific parameters of a querySBonitaReadExceptionjava.util.List<SProcessInstance> searchProcessInstances(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - a map of specific parameters of a querySBonitaReadExceptionlong getNumberOfOpenProcessInstancesSupervisedBy(long userId,
QueryOptions queryOptions)
throws SBonitaReadException
userId - identifier of supervisor userqueryOptions - a map of specific parameters of a querySBonitaReadExceptionlong getNumberOfFailedProcessInstancesSupervisedBy(long userId,
QueryOptions queryOptions)
throws SBonitaReadException
SProcessInstance with at least one failed task or the ProcessInstanceState.ERROR
state for the specific supervisoruserId - identifier of supervisor userqueryOptions - a map of specific parameters of a querySProcessInstance with at least one failed task or the
ProcessInstanceState.ERROR state for the specific supervisorSBonitaReadExceptionjava.util.List<SProcessInstance> searchFailedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException
SProcessInstance with at least one failed task or the ProcessInstanceState.ERROR state
for the specific supervisoruserId - identifier of supervisor userqueryOptions - a map of specific parameters of a querySProcessInstance with at least one failed task or the ProcessInstanceState.ERROR
state for the specific supervisorSBonitaReadExceptionjava.util.List<SProcessInstance> searchOpenProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException
userId - identifier of supervisor userqueryOptions - a map of specific parameters of a querySBonitaReadExceptionlong getNumberOfOpenProcessInstancesInvolvingUser(long userId,
QueryOptions queryOptions)
throws SBonitaReadException
userId - identifier of user who can perform or be assigned to tasks in process instance.queryOptions - a map of specific parameters of a querySBonitaReadExceptionjava.util.List<SProcessInstance> searchOpenProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions) throws SBonitaReadException
userId - identifier of user who can perform or be assigned to tasks in process instance.queryOptions - SBonitaReadExceptionlong getNumberOfOpenProcessInstancesInvolvingUsersManagedBy(long managerUserId,
QueryOptions queryOptions)
throws SBonitaReadException
managerUserId - queryOptions - SBonitaReadExceptionjava.util.List<SProcessInstance> searchOpenProcessInstancesInvolvingUsersManagedBy(long managerUserId, QueryOptions queryOptions) throws SBonitaReadException
managerUserId - queryOptions - SBonitaReadExceptionjava.util.List<java.lang.Long> getArchivedChildrenSourceObjectIdsFromRootProcessInstance(long rootProcessIntanceId,
int fromIndex,
int maxResults,
OrderByType sortingOrder)
throws SBonitaReadException
rootProcessIntanceId - 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)SBonitaReadExceptionlong getNumberOfArchivedProcessInstancesWithoutSubProcess(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - the search criteria containing a map of specific parameters of a querySBonitaReadExceptionjava.util.List<SAProcessInstance> searchArchivedProcessInstancesWithoutSubProcess(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - the search criteria containing a map of specific parameters of a querySBonitaReadExceptionlong getNumberOfArchivedProcessInstancesSupervisedBy(long userId,
QueryOptions countOptions)
throws SBonitaReadException
userId - identifier of user who is the supervisor of archived process instance.countOptions - the search criteria containing a map of specific parameters of a querySBonitaReadExceptionjava.util.List<SAProcessInstance> searchArchivedProcessInstancesSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException
userId - identifier of user who is the supervisor of archived process instance.queryOptions - the search criteria containing a map of specific parameters of a querySBonitaReadExceptionlong getNumberOfArchivedProcessInstancesInvolvingUser(long userId,
QueryOptions countOptions)
throws SBonitaReadException
userId - the identifier of user who is assignee of tasks of process instancecountOptions - the search criteria containing a map of specific parameters of a querySBonitaReadExceptionjava.util.List<SAProcessInstance> searchArchivedProcessInstancesInvolvingUser(long userId, QueryOptions queryOptions) throws SBonitaReadException
userId - the identifier of user who is assignee of tasks of process instancequeryOptions - the search criteria containing a map of specific parameters of a querySBonitaReadExceptionvoid updateProcess(SProcessInstance processInstance, EntityUpdateDescriptor descriptor) throws SProcessInstanceModificationException
processInstance - the processInstance will be updateddescriptor - update descriptionSProcessInstanceModificationExceptionvoid deleteFlowNodeInstance(SFlowNodeInstance flowNodeInstance, SProcessDefinition processDefinition) throws SFlowNodeReadException, SProcessInstanceModificationException
flowNodeInstance - processDefinition - SFlowNodeReadExceptionSProcessInstanceModificationExceptionjava.util.List<java.lang.Long> getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition(long processDefinitionId,
int fromIndex,
int maxResults,
OrderByType sortingOrder)
throws SProcessInstanceReadException
processDefinitionId - fromIndex - maxResults - sortingOrder - SProcessInstanceReadExceptionjava.util.List<SProcessInstance> getProcessInstancesInStates(QueryOptions queryOptions, org.bonitasoft.engine.bpm.process.ProcessInstanceState... states) throws SProcessInstanceReadException
SProcessInstances in a given list of states.queryOptions - the search criteria containing a map of specific parameters of a querystates - the list of valid states to retrieve.SProcessInstancesSProcessInstanceReadException - if a read error occursSAProcessInstance getLastArchivedProcessInstance(long sourceObjectProcessInstanceId) throws SBonitaReadException
sourceObjectProcessInstanceId - The source identifier of the process instanceSBonitaReadExceptionlong getNumberOfFailedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException
SProcessInstance with at least one failed task or the ProcessInstanceState.ERROR
state.queryOptions - the search criteria containing a map of specific parameters of a querySProcessInstance with at least one failed task or the
ProcessInstanceState.ERROR state.SBonitaExceptionSBonitaReadExceptionjava.util.List<SProcessInstance> searchFailedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException
SProcessInstance with at least one failed task or the ProcessInstanceState.ERROR state.queryOptions - the search criteria containing a map of specific parameters of a querySProcessInstance with at least one failed task or the ProcessInstanceState.ERROR
state.SBonitaExceptionSBonitaReadExceptionlong getNumberOfProcessInstances(long processDefinitionId)
throws SBonitaReadException
SBonitaReadException