Class RuntimeServiceImpl
- All Implemented Interfaces:
RuntimeService
- Author:
- Tom Baeyens, Daniel Meyer
-
Field Summary
Fields inherited from class org.camunda.bpm.engine.impl.ServiceImpl
commandExecutor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activateProcessInstanceById
(String processInstanceId) Activates the process instance with the given id.void
activateProcessInstanceByProcessDefinitionId
(String processDefinitionId) Activates the process instance with the given process definition id.void
activateProcessInstanceByProcessDefinitionKey
(String processDefinitionKey) Activates the process instance with the given process definition key.void
clearAnnotationForIncidentById
(String incidentId) Clear the annotation for an incident.void
correlateMessage
(String messageName) Correlates a message to either an execution that is waiting for this message or a process definition that can be started by this message.void
correlateMessage
(String messageName, String businessKey) Correlates a message to an execution that is waiting for a matching message and belongs to a process instance with the given business key a process definition that can be started by a matching message.void
Correlates a message to an execution that is waiting for a matching message and belongs to a process instance with the given business key a process definition that can be started by this message.void
correlateMessage
(String messageName, String businessKey, Map<String, Object> correlationKeys, Map<String, Object> processVariables) Correlates a message to an execution that is waiting for a matching message and can be correlated according to the given correlation keys.void
correlateMessage
(String messageName, Map<String, Object> correlationKeys) Correlates a message to an execution that is waiting for a matching message and can be correlated according to the given correlation keys.void
correlateMessage
(String messageName, Map<String, Object> correlationKeys, Map<String, Object> processVariables) Correlates a message to an execution that is waiting for a matching message and can be correlated according to the given correlation keys.Define a complex condition evaluation using a fluent builder.Creates a newEventSubscriptionQuery
instance, that can be used to query event subscriptions.Creates a newExecutionQuery
instance, that can be used to query the executions and process instances.createIncident
(String incidentType, String executionId, String configuration) Creates an incidentcreateIncident
(String incidentType, String executionId, String configuration, String message) Creates an incidentCreates a newIncidentQuery
instance, that can be used to query incidents.createMessageCorrelation
(String messageName) Define a complex message correlation using a fluent builder.createMessageCorrelationAsync
(String messageName) Define a complex asynchronous message correlation using a fluent builder.createMigrationPlan
(String sourceProcessDefinitionId, String targetProcessDefinitionId) Creates a migration plan to migrate process instance between different process definitions.createModification
(String processDefinitionId) Creates a modification of multiple process instances in terms of activity cancellations and instantiations via a fluent builder.creates a newNativeExecutionQuery
to queryExecution
s by SQL directlycreates a newNativeProcessInstanceQuery
to queryProcessInstance
s by SQL directlycreateProcessInstanceById
(String processDefinitionId) Returns a fluent builder to start a new process instance in the exactly specified version of the process definition with the given id.createProcessInstanceByKey
(String processDefinitionKey) Returns a fluent builder to start a new process instance in the latest version of the process definition with the given key.createProcessInstanceModification
(String processInstanceId) Define a modification of a process instance in terms of activity cancellations and instantiations via a fluent builder.Creates a newProcessInstanceQuery
instance, that can be used to query process instances.createSignalEvent
(String signalName) Notifies the process engine that a signal event has been received using a fluent builder.Creates a newVariableInstanceQuery
instance, that can be used to query variable instances.void
deleteProcessInstance
(String processInstanceId, String deleteReason) Delete an existing runtime process instance.void
deleteProcessInstance
(String processInstanceId, String deleteReason, boolean skipCustomListeners) Delete an existing runtime process instance.void
deleteProcessInstance
(String processInstanceId, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated) Delete an existing runtime process instance.void
deleteProcessInstance
(String processInstanceId, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings) Delete an existing runtime process instance.void
deleteProcessInstance
(String processInstanceId, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings, boolean skipSubprocesses) Delete an existing runtime process instance.void
deleteProcessInstanceIfExists
(String processInstanceId, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings, boolean skipSubprocesses) Delete an existing runtime process instance.void
deleteProcessInstances
(List<String> processInstanceIds, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated) Delete existing runtime process instances.void
deleteProcessInstances
(List<String> processInstanceIds, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipSubprocesses) Delete existing runtime process instances.deleteProcessInstancesAsync
(List<String> processInstanceIds, String deleteReason) Delete an existing runtime process instances asynchronously using Batch operation.deleteProcessInstancesAsync
(List<String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, String deleteReason) Delete an existing runtime process instances asynchronously using Batch operation.deleteProcessInstancesAsync
(List<String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, String deleteReason, boolean skipCustomListeners) Delete an existing runtime process instances asynchronously using Batch operation.deleteProcessInstancesAsync
(List<String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, String deleteReason, boolean skipCustomListeners, boolean skipSubprocesses) Delete an existing runtime process instances asynchronously using Batch operation.deleteProcessInstancesAsync
(List<String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, HistoricProcessInstanceQuery historicProcessInstanceQuery, String deleteReason, boolean skipCustomListeners, boolean skipSubprocesses) Delete an existing runtime process instances asynchronously using Batch operation.deleteProcessInstancesAsync
(ProcessInstanceQuery processInstanceQuery, String deleteReason) Delete an existing runtime process instances asynchronously using Batch operation.void
deleteProcessInstancesIfExists
(List<String> processInstanceIds, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipSubprocesses) Delete existing runtime process instances.getActiveActivityIds
(String executionId) Finds the activity ids for all executions that are waiting in activities.getActivityInstance
(String processInstanceId) Allows retrieving the activity instance tree for a given process instance.getFormInstanceById
(String processDefinitionId) getVariable
(String executionId, String variableName) The variable value.getVariableLocal
(String executionId, String variableName) The variable value for an execution.<T extends TypedValue>
TgetVariableLocalTyped
(String executionId, String variableName) Returns aTypedValue
for the variable.<T extends TypedValue>
TgetVariableLocalTyped
(String executionId, String variableName, boolean deserializeObjectValue) Returns aTypedValue
for the variable.getVariables
(String executionId) All variables visible from the given execution scope (including parent scopes).getVariables
(String executionId, Collection<String> variableNames) The variable values for all given variableNames, takes all variables into account which are visible from the given execution scope (including parent scopes).getVariablesLocal
(String executionId) All variable values that are defined in the execution scope, without taking outer scopes into account.getVariablesLocal
(String executionId, Collection<String> variableNames) The variable values for the given variableNames only taking the given execution scope into account, not looking in outer scopes.getVariablesLocalTyped
(String executionId) All variable values that are defined in the execution scope, without taking outer scopes into account.getVariablesLocalTyped
(String executionId, boolean deserializeObjectValues) All variable values that are defined in the execution scope, without taking outer scopes into account.getVariablesLocalTyped
(String executionId, Collection<String> variableNames, boolean deserializeObjectValues) The variable values for the given variableNames only taking the given execution scope into account, not looking in outer scopes.getVariablesTyped
(String executionId) All variables visible from the given execution scope (including parent scopes).getVariablesTyped
(String executionId, boolean deserializeObjectValues) All variables visible from the given execution scope (including parent scopes).getVariablesTyped
(String executionId, Collection<String> variableNames, boolean deserializeObjectValues) The variable values for all given variableNames, takes all variables into account which are visible from the given execution scope (including parent scopes).<T extends TypedValue>
TgetVariableTyped
(String executionId, String variableName) Returns aTypedValue
for the variable.<T extends TypedValue>
TgetVariableTyped
(String executionId, String variableName, boolean deserializeObjectValue) Returns aTypedValue
for the variable.void
messageEventReceived
(String messageName, String executionId) Notifies the process engine that a message event with name 'messageName' has been received and has been correlated to an execution with id 'executionId'.void
Notifies the process engine that a message event with the name 'messageName' has been received and has been correlated to an execution with id 'executionId'.newMigration
(MigrationPlan migrationPlan) Executes a migration plan for a given list of process instances.void
removeVariable
(String executionId, String variableName) Removes a variable for an execution.void
removeVariableLocal
(String executionId, String variableName) Removes a variable for an execution (not considering parent scopes).void
removeVariables
(String executionId, Collection<String> variableNames) Removes variables for an execution.void
removeVariablesLocal
(String executionId, Collection<String> variableNames) Remove variables for an execution (not considering parent scopes).void
resolveIncident
(String incidentId) Resolves and remove an incidentrestartProcessInstances
(String processDefinitionId) Restarts process instances that are completed or deleted with the initial or last set of variables.void
setAnnotationForIncidentById
(String incidentId, String annotation) Set an annotation to an incident.void
setVariable
(String executionId, String variableName, Object value) Update or create a variable for an execution.void
setVariableLocal
(String executionId, String variableName, Object value) Update or create a variable for an execution (not considering parent scopes).void
setVariables
(String executionId, Map<String, ? extends Object> variables) Update or create given variables for an execution (including parent scopes).protected void
setVariables
(String executionId, Map<String, ? extends Object> variables, boolean local) setVariablesAsync
(List<String> processInstanceIds, Map<String, ?> variables) Update or create runtime process variables in the root scope of process instances.setVariablesAsync
(List<String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, HistoricProcessInstanceQuery historicProcessInstanceQuery, Map<String, ?> variables) Update or create runtime process variables in the root scope of process instances.setVariablesAsync
(HistoricProcessInstanceQuery historicProcessInstanceQuery, Map<String, ?> variables) Update or create runtime process variables in the root scope of process instances.setVariablesAsync
(ProcessInstanceQuery processInstanceQuery, Map<String, ?> variables) Update or create runtime process variables in the root scope of process instances.void
setVariablesLocal
(String executionId, Map<String, ? extends Object> variables) Update or create given variables for an execution (not considering parent scopes).void
Sends an external trigger to an activity instance that is waiting inside the given execution.void
signal
(String executionId, String signalName, Object signalData, Map<String, Object> processVariables) Sends an external trigger to an activity instance that is waiting inside the given execution.void
Sends an external trigger to an activity instance that is waiting inside the given execution.void
signalEventReceived
(String signalName) Notifies the process engine that a signal event of name 'signalName' has been received.void
signalEventReceived
(String signalName, String executionId) Notifies the process engine that a signal event of name 'signalName' has been received.void
Notifies the process engine that a signal event of name 'signalName' has been received.void
signalEventReceived
(String signalName, Map<String, Object> processVariables) Notifies the process engine that a signal event of name 'signalName' has been received.startProcessInstanceById
(String processDefinitionId) Starts a new process instance in the exactly specified version of the process definition with the given id.startProcessInstanceById
(String processDefinitionId, String businessKey) Starts a new process instance in the exactly specified version of the process definition with the given id.startProcessInstanceById
(String processDefinitionId, String businessKey, String caseInstanceId) Starts a new process instance in the exactly specified version of the process definition with the given id.startProcessInstanceById
(String processDefinitionId, String businessKey, String caseInstanceId, Map<String, Object> variables) Starts a new process instance in the exactly specified version of the process definition with the given id.startProcessInstanceById
(String processDefinitionId, String businessKey, Map<String, Object> variables) Starts a new process instance in the exactly specified version of the process definition with the given id.startProcessInstanceById
(String processDefinitionId, Map<String, Object> variables) Starts a new process instance in the exactly specified version of the process definition with the given id.startProcessInstanceByKey
(String processDefinitionKey) Starts a new process instance in the latest version of the process definition with the given key.startProcessInstanceByKey
(String processDefinitionKey, String businessKey) Starts a new process instance in the latest version of the process definition with the given key.startProcessInstanceByKey
(String processDefinitionKey, String businessKey, String caseInstanceId) Starts a new process instance in the latest version of the process definition with the given key.startProcessInstanceByKey
(String processDefinitionKey, String businessKey, String caseInstanceId, Map<String, Object> variables) Starts a new process instance in the latest version of the process definition with the given key.startProcessInstanceByKey
(String processDefinitionKey, String businessKey, Map<String, Object> variables) Starts a new process instance in the latest version of the process definition with the given key.startProcessInstanceByKey
(String processDefinitionKey, Map<String, Object> variables) Starts a new process instance in the latest version of the process definition with the given keystartProcessInstanceByMessage
(String messageName) Signals the process engine that a message is received and starts a newProcessInstance
.startProcessInstanceByMessage
(String messageName, String businessKey) Signals the process engine that a message is received and starts a newProcessInstance
.startProcessInstanceByMessage
(String messageName, String businessKey, Map<String, Object> processVariables) Signals the process engine that a message is received and starts a newProcessInstance
.startProcessInstanceByMessage
(String messageName, Map<String, Object> processVariables) Signals the process engine that a message is received and starts a newProcessInstance
.startProcessInstanceByMessageAndProcessDefinitionId
(String messageName, String processDefinitionId) Signals the process engine that a message is received and starts a newProcessInstance
.startProcessInstanceByMessageAndProcessDefinitionId
(String messageName, String processDefinitionId, String businessKey) Signals the process engine that a message is received and starts a newProcessInstance
.startProcessInstanceByMessageAndProcessDefinitionId
(String messageName, String processDefinitionId, String businessKey, Map<String, Object> processVariables) Signals the process engine that a message is received and starts a newProcessInstance
.startProcessInstanceByMessageAndProcessDefinitionId
(String messageName, String processDefinitionId, Map<String, Object> processVariables) Signals the process engine that a message is received and starts a newProcessInstance
.void
suspendProcessInstanceById
(String processInstanceId) Suspends the process instance with the given id.void
suspendProcessInstanceByProcessDefinitionId
(String processDefinitionId) Suspends the process instances with the given process definition id.void
suspendProcessInstanceByProcessDefinitionKey
(String processDefinitionKey) Suspends the process instances with the given process definition key.Activate or suspend process instances using a fluent builder.void
updateVariables
(String executionId, Map<String, ? extends Object> modifications, Collection<String> deletions) protected void
updateVariables
(String executionId, Map<String, ? extends Object> modifications, Collection<String> deletions, boolean local) void
updateVariablesLocal
(String executionId, Map<String, ? extends Object> modifications, Collection<String> deletions) Methods inherited from class org.camunda.bpm.engine.impl.ServiceImpl
getCommandExecutor, setCommandExecutor
-
Constructor Details
-
RuntimeServiceImpl
public RuntimeServiceImpl()
-
-
Method Details
-
startProcessInstanceByKey
Description copied from interface:RuntimeService
Starts a new process instance in the latest version of the process definition with the given key.- Specified by:
startProcessInstanceByKey
in interfaceRuntimeService
- Parameters:
processDefinitionKey
- key of process definition, cannot be null.
-
startProcessInstanceByKey
Description copied from interface:RuntimeService
Starts a new process instance in the latest version of the process definition with the given key. A business key can be provided to associate the process instance with a certain identifier that has a clear business meaning. For example in an order process, the business key could be an order id. This business key can then be used to easily look up that process instance , seeProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice. Note that a business key MUST be unique for the given process definition WHEN you have added a database constraint for it. In this case, only Process instance from different process definition are allowed to have the same business key and the combination of processdefinitionKey-businessKey must be unique.- Specified by:
startProcessInstanceByKey
in interfaceRuntimeService
- Parameters:
processDefinitionKey
- key of process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context of the given process definition.
-
startProcessInstanceByKey
public ProcessInstance startProcessInstanceByKey(String processDefinitionKey, String businessKey, String caseInstanceId) Description copied from interface:RuntimeService
Starts a new process instance in the latest version of the process definition with the given key. A business key can be provided to associate the process instance with a certain identifier that has a clear business meaning. For example in an order process, the business key could be an order id. This business key can then be used to easily look up that process instance , seeProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice. Note that a business key MUST be unique for the given process definition WHEN you have added a database constraint for it. In this case, only Process instance from different process definition are allowed to have the same business key and the combination of processdefinitionKey-businessKey must be unique.- Specified by:
startProcessInstanceByKey
in interfaceRuntimeService
- Parameters:
processDefinitionKey
- key of process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context of the given process definition.caseInstanceId
- an id of a case instance to associate the process instance with a case instance.
-
startProcessInstanceByKey
public ProcessInstance startProcessInstanceByKey(String processDefinitionKey, Map<String, Object> variables) Description copied from interface:RuntimeService
Starts a new process instance in the latest version of the process definition with the given key- Specified by:
startProcessInstanceByKey
in interfaceRuntimeService
- Parameters:
processDefinitionKey
- key of process definition, cannot be null.variables
- the variables to pass, can be null.
-
startProcessInstanceByKey
public ProcessInstance startProcessInstanceByKey(String processDefinitionKey, String businessKey, Map<String, Object> variables) Description copied from interface:RuntimeService
Starts a new process instance in the latest version of the process definition with the given key. A business key can be provided to associate the process instance with a certain identifier that has a clear business meaning. For example in an order process, the business key could be an order id. This business key can then be used to easily look up that process instance , seeProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice. Note that a business key MUST be unique for the given process definition WHEN you have added a database constraint for it. In this case, only Process instance from different process definition are allowed to have the same business key and the combination of processdefinitionKey-businessKey must be unique. The combination of processdefinitionKey-businessKey must be unique.- Specified by:
startProcessInstanceByKey
in interfaceRuntimeService
- Parameters:
processDefinitionKey
- key of process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context of the given process definition.variables
- the variables to pass, can be null.
-
startProcessInstanceByKey
public ProcessInstance startProcessInstanceByKey(String processDefinitionKey, String businessKey, String caseInstanceId, Map<String, Object> variables) Description copied from interface:RuntimeService
Starts a new process instance in the latest version of the process definition with the given key. A business key can be provided to associate the process instance with a certain identifier that has a clear business meaning. For example in an order process, the business key could be an order id. This business key can then be used to easily look up that process instance , seeProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice. Note that a business key MUST be unique for the given process definition WHEN you have added a database constraint for it. In this case, only Process instance from different process definition are allowed to have the same business key and the combination of processdefinitionKey-businessKey must be unique. The combination of processdefinitionKey-businessKey must be unique.- Specified by:
startProcessInstanceByKey
in interfaceRuntimeService
- Parameters:
processDefinitionKey
- key of process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context of the given process definition.caseInstanceId
- an id of a case instance to associate the process instance with a case instance.variables
- the variables to pass, can be null.
-
startProcessInstanceById
Description copied from interface:RuntimeService
Starts a new process instance in the exactly specified version of the process definition with the given id.- Specified by:
startProcessInstanceById
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.
-
startProcessInstanceById
Description copied from interface:RuntimeService
Starts a new process instance in the exactly specified version of the process definition with the given id. A business key can be provided to associate the process instance with a certain identifier that has a clear business meaning. For example in an order process, the business key could be an order id. This business key can then be used to easily look up that process instance , seeProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice. Note that a business key MUST be unique for the given process definition WHEN you have added a database constraint for it. In this case, only Process instance from different process definition are allowed to have the same business key and the combination of processdefinitionKey-businessKey must be unique.- Specified by:
startProcessInstanceById
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context of the given process definition.
-
startProcessInstanceById
public ProcessInstance startProcessInstanceById(String processDefinitionId, String businessKey, String caseInstanceId) Description copied from interface:RuntimeService
Starts a new process instance in the exactly specified version of the process definition with the given id. A business key can be provided to associate the process instance with a certain identifier that has a clear business meaning. For example in an order process, the business key could be an order id. This business key can then be used to easily look up that process instance , seeProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice. Note that a business key MUST be unique for the given process definition WHEN you have added a database constraint for it. In this case, only Process instance from different process definition are allowed to have the same business key and the combination of processdefinitionKey-businessKey must be unique.- Specified by:
startProcessInstanceById
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context of the given process definition.caseInstanceId
- an id of a case instance to associate the process instance with a case instance.
-
startProcessInstanceById
public ProcessInstance startProcessInstanceById(String processDefinitionId, Map<String, Object> variables) Description copied from interface:RuntimeService
Starts a new process instance in the exactly specified version of the process definition with the given id.- Specified by:
startProcessInstanceById
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.variables
- variables to be passed, can be null
-
startProcessInstanceById
public ProcessInstance startProcessInstanceById(String processDefinitionId, String businessKey, Map<String, Object> variables) Description copied from interface:RuntimeService
Starts a new process instance in the exactly specified version of the process definition with the given id. A business key can be provided to associate the process instance with a certain identifier that has a clear business meaning. For example in an order process, the business key could be an order id. This business key can then be used to easily look up that process instance , seeProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice. Note that a business key MUST be unique for the given process definition WHEN you have added a database constraint for it. In this case, only Process instance from different process definition are allowed to have the same business key and the combination of processdefinitionKey-businessKey must be unique.- Specified by:
startProcessInstanceById
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context of the given process definition.variables
- variables to be passed, can be null
-
startProcessInstanceById
public ProcessInstance startProcessInstanceById(String processDefinitionId, String businessKey, String caseInstanceId, Map<String, Object> variables) Description copied from interface:RuntimeService
Starts a new process instance in the exactly specified version of the process definition with the given id. A business key can be provided to associate the process instance with a certain identifier that has a clear business meaning. For example in an order process, the business key could be an order id. This business key can then be used to easily look up that process instance , seeProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice. Note that a business key MUST be unique for the given process definition WHEN you have added a database constraint for it. In this case, only Process instance from different process definition are allowed to have the same business key and the combination of processdefinitionKey-businessKey must be unique.- Specified by:
startProcessInstanceById
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context of the given process definition.caseInstanceId
- an id of a case instance to associate the process instance with a case instance.variables
- variables to be passed, can be null
-
deleteProcessInstance
Description copied from interface:RuntimeService
Delete an existing runtime process instance. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstance
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of process instance to delete, cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.
-
deleteProcessInstancesAsync
public Batch deleteProcessInstancesAsync(List<String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, String deleteReason) Description copied from interface:RuntimeService
Delete an existing runtime process instances asynchronously using Batch operation. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstancesAsync
in interfaceRuntimeService
- Parameters:
processInstanceIds
- id's of process instances to delete, cannot be null if processInstanceQuery is null.processInstanceQuery
- query that will be used to fetch affected process instances. Cannot be null if processInstanceIds are null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.
-
deleteProcessInstancesAsync
Description copied from interface:RuntimeService
Delete an existing runtime process instances asynchronously using Batch operation. Deletion propagates upward as far as necessary. If both process instances list and query are provided, process instances containing in both sets will be deleted.- Specified by:
deleteProcessInstancesAsync
in interfaceRuntimeService
- Parameters:
processInstanceIds
- id's of process instances to delete, cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.
-
deleteProcessInstancesAsync
public Batch deleteProcessInstancesAsync(ProcessInstanceQuery processInstanceQuery, String deleteReason) Description copied from interface:RuntimeService
Delete an existing runtime process instances asynchronously using Batch operation. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstancesAsync
in interfaceRuntimeService
- Parameters:
processInstanceQuery
- query that will be used to fetch affected process instances. Cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.
-
deleteProcessInstancesAsync
public Batch deleteProcessInstancesAsync(List<String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, String deleteReason, boolean skipCustomListeners) Description copied from interface:RuntimeService
Delete an existing runtime process instances asynchronously using Batch operation. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstancesAsync
in interfaceRuntimeService
- Parameters:
processInstanceIds
- id's of process instances to delete, cannot be null if processInstanceQuery is null.processInstanceQuery
- query that will be used to fetch affected process instances. Cannot be null if processInstanceIds are null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- skips custom execution listeners when removing instances
-
deleteProcessInstancesAsync
public Batch deleteProcessInstancesAsync(List<String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, String deleteReason, boolean skipCustomListeners, boolean skipSubprocesses) Description copied from interface:RuntimeService
Delete an existing runtime process instances asynchronously using Batch operation. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstancesAsync
in interfaceRuntimeService
- Parameters:
processInstanceIds
- id's of process instances to delete, cannot be null if processInstanceQuery is null.processInstanceQuery
- query that will be used to fetch affected process instances. Cannot be null if processInstanceIds are null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- skips custom execution listeners when removing instancesskipSubprocesses
- skips subprocesses when removing instances
-
deleteProcessInstancesAsync
public Batch deleteProcessInstancesAsync(List<String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, HistoricProcessInstanceQuery historicProcessInstanceQuery, String deleteReason, boolean skipCustomListeners, boolean skipSubprocesses) Description copied from interface:RuntimeService
Delete an existing runtime process instances asynchronously using Batch operation. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstancesAsync
in interfaceRuntimeService
- Parameters:
processInstanceIds
- id's of process instances to delete.processInstanceQuery
- query that will be used to fetch affected process instances.historicProcessInstanceQuery
- query that will be used to fetch affected process instances based on history data.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- skips custom execution listeners when removing instancesskipSubprocesses
- skips subprocesses when removing instances
-
deleteProcessInstance
public void deleteProcessInstance(String processInstanceId, String deleteReason, boolean skipCustomListeners) Description copied from interface:RuntimeService
Delete an existing runtime process instance. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstance
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of process instance to delete, cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- if true, only the built-inExecutionListener
s are notified with theExecutionListener.EVENTNAME_END
event.
-
deleteProcessInstance
public void deleteProcessInstance(String processInstanceId, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated) Description copied from interface:RuntimeService
Delete an existing runtime process instance. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstance
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of process instance to delete, cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- if true, only the built-inExecutionListener
s are notified with theExecutionListener.EVENTNAME_END
event.externallyTerminated
- indicator if deletion triggered from external context, for instance REST API call
-
deleteProcessInstance
public void deleteProcessInstance(String processInstanceId, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings) Description copied from interface:RuntimeService
Delete an existing runtime process instance. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstance
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of process instance to delete, cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- if true, only the built-inExecutionListener
s are notified with theExecutionListener.EVENTNAME_END
event.externallyTerminated
- indicator if deletion triggered from external context, for instance REST API callskipIoMappings
- specifies whether input/output mappings for tasks should be invoked
-
deleteProcessInstance
public void deleteProcessInstance(String processInstanceId, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings, boolean skipSubprocesses) Description copied from interface:RuntimeService
Delete an existing runtime process instance. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstance
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of process instance to delete, cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- if true, only the built-inExecutionListener
s are notified with theExecutionListener.EVENTNAME_END
event.externallyTerminated
- indicator if deletion triggered from external context, for instance REST API callskipIoMappings
- specifies whether input/output mappings for tasks should be invokedskipSubprocesses
- specifies whether subprocesses should be deleted
-
deleteProcessInstanceIfExists
public void deleteProcessInstanceIfExists(String processInstanceId, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings, boolean skipSubprocesses) Description copied from interface:RuntimeService
Delete an existing runtime process instance. Deletion propagates upward as far as necessary. Does not fail if a process instance was not found.- Specified by:
deleteProcessInstanceIfExists
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of process instance to delete, cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- if true, only the built-inExecutionListener
s are notified with theExecutionListener.EVENTNAME_END
event.externallyTerminated
- indicator if deletion triggered from external context, for instance REST API callskipIoMappings
- specifies whether input/output mappings for tasks should be invokedskipSubprocesses
- specifies whether subprocesses should be deleted
-
deleteProcessInstances
public void deleteProcessInstances(List<String> processInstanceIds, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated) Description copied from interface:RuntimeService
Delete existing runtime process instances. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstances
in interfaceRuntimeService
- Parameters:
processInstanceIds
- ids of process instance to delete, cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- if true, only the built-inExecutionListener
s are notified with theExecutionListener.EVENTNAME_END
event.externallyTerminated
- indicator if deletion triggered from external context, for instance REST API call
-
deleteProcessInstances
public void deleteProcessInstances(List<String> processInstanceIds, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipSubprocesses) Description copied from interface:RuntimeService
Delete existing runtime process instances. Deletion propagates upward as far as necessary.- Specified by:
deleteProcessInstances
in interfaceRuntimeService
- Parameters:
processInstanceIds
- ids of process instance to delete, cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- if true, only the built-inExecutionListener
s are notified with theExecutionListener.EVENTNAME_END
event.externallyTerminated
- indicator if deletion triggered from external context, for instance REST API callskipSubprocesses
- specifies whether subprocesses should be deleted
-
deleteProcessInstancesIfExists
public void deleteProcessInstancesIfExists(List<String> processInstanceIds, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipSubprocesses) Description copied from interface:RuntimeService
Delete existing runtime process instances. Deletion propagates upward as far as necessary. Does not fail if a process instance was not found.- Specified by:
deleteProcessInstancesIfExists
in interfaceRuntimeService
- Parameters:
processInstanceIds
- ids of process instance to delete, cannot be null.deleteReason
- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners
- if true, only the built-inExecutionListener
s are notified with theExecutionListener.EVENTNAME_END
event.externallyTerminated
- indicator if deletion triggered from external context, for instance REST API callskipSubprocesses
- specifies whether subprocesses should be deleted
-
createExecutionQuery
Description copied from interface:RuntimeService
Creates a newExecutionQuery
instance, that can be used to query the executions and process instances.- Specified by:
createExecutionQuery
in interfaceRuntimeService
-
createNativeExecutionQuery
Description copied from interface:RuntimeService
creates a newNativeExecutionQuery
to queryExecution
s by SQL directly- Specified by:
createNativeExecutionQuery
in interfaceRuntimeService
-
createNativeProcessInstanceQuery
Description copied from interface:RuntimeService
creates a newNativeProcessInstanceQuery
to queryProcessInstance
s by SQL directly- Specified by:
createNativeProcessInstanceQuery
in interfaceRuntimeService
-
createIncidentQuery
Description copied from interface:RuntimeService
Creates a newIncidentQuery
instance, that can be used to query incidents.- Specified by:
createIncidentQuery
in interfaceRuntimeService
-
createEventSubscriptionQuery
Description copied from interface:RuntimeService
Creates a newEventSubscriptionQuery
instance, that can be used to query event subscriptions.- Specified by:
createEventSubscriptionQuery
in interfaceRuntimeService
-
createVariableInstanceQuery
Description copied from interface:RuntimeService
Creates a newVariableInstanceQuery
instance, that can be used to query variable instances.- Specified by:
createVariableInstanceQuery
in interfaceRuntimeService
-
getVariables
Description copied from interface:RuntimeService
All variables visible from the given execution scope (including parent scopes).- Specified by:
getVariables
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariablesTyped
Description copied from interface:RuntimeService
All variables visible from the given execution scope (including parent scopes).- Specified by:
getVariablesTyped
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariablesTyped
Description copied from interface:RuntimeService
All variables visible from the given execution scope (including parent scopes).- Specified by:
getVariablesTyped
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.deserializeObjectValues
- if false,SerializableValue
s will not be deserialized- Returns:
- the variables or an empty map if no such variables are found.
-
getVariablesLocal
Description copied from interface:RuntimeService
All variable values that are defined in the execution scope, without taking outer scopes into account. If you have many task local variables and you only need a few, consider usingRuntimeService.getVariablesLocal(String, Collection)
for better performance.- Specified by:
getVariablesLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariablesLocalTyped
Description copied from interface:RuntimeService
All variable values that are defined in the execution scope, without taking outer scopes into account. If you have many task local variables and you only need a few, consider usingRuntimeService.getVariablesLocal(String, Collection)
for better performance.- Specified by:
getVariablesLocalTyped
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariablesLocalTyped
Description copied from interface:RuntimeService
All variable values that are defined in the execution scope, without taking outer scopes into account. If you have many task local variables and you only need a few, consider usingRuntimeService.getVariablesLocal(String, Collection)
for better performance.- Specified by:
getVariablesLocalTyped
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariables
Description copied from interface:RuntimeService
The variable values for all given variableNames, takes all variables into account which are visible from the given execution scope (including parent scopes).- Specified by:
getVariables
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.variableNames
- the collection of variable names that should be retrieved.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariablesTyped
public VariableMap getVariablesTyped(String executionId, Collection<String> variableNames, boolean deserializeObjectValues) Description copied from interface:RuntimeService
The variable values for all given variableNames, takes all variables into account which are visible from the given execution scope (including parent scopes).- Specified by:
getVariablesTyped
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.variableNames
- the collection of variable names that should be retrieved.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariablesLocal
Description copied from interface:RuntimeService
The variable values for the given variableNames only taking the given execution scope into account, not looking in outer scopes.- Specified by:
getVariablesLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.variableNames
- the collection of variable names that should be retrieved.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariablesLocalTyped
public VariableMap getVariablesLocalTyped(String executionId, Collection<String> variableNames, boolean deserializeObjectValues) Description copied from interface:RuntimeService
The variable values for the given variableNames only taking the given execution scope into account, not looking in outer scopes.- Specified by:
getVariablesLocalTyped
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.variableNames
- the collection of variable names that should be retrieved.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariable
Description copied from interface:RuntimeService
The variable value. Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no variable value is found with the given name or when the value is set to null.- Specified by:
getVariable
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.variableName
- name of variable, cannot be null.- Returns:
- the variable value or null if the variable is undefined or the value of the variable is null.
-
getVariableTyped
Description copied from interface:RuntimeService
Returns aTypedValue
for the variable. Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no variable value is found with the given name.- Specified by:
getVariableTyped
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.variableName
- name of variable, cannot be null.- Returns:
- the variable value or null if the variable is undefined.
-
getVariableTyped
public <T extends TypedValue> T getVariableTyped(String executionId, String variableName, boolean deserializeObjectValue) Description copied from interface:RuntimeService
Returns aTypedValue
for the variable. Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no variable value is found with the given name.- Specified by:
getVariableTyped
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.variableName
- name of variable, cannot be null.deserializeObjectValue
- if false, aSerializableValue
will not be deserialized- Returns:
- the variable value or null if the variable is undefined.
-
getVariableLocalTyped
Description copied from interface:RuntimeService
Returns aTypedValue
for the variable. Returns the value when the variable is set for the execution (and not searching parent scopes). Returns null when no variable value is found with the given name.- Specified by:
getVariableLocalTyped
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.variableName
- name of variable, cannot be null.- Returns:
- the variable value or null if the variable is undefined.
-
getVariableLocalTyped
public <T extends TypedValue> T getVariableLocalTyped(String executionId, String variableName, boolean deserializeObjectValue) Description copied from interface:RuntimeService
Returns aTypedValue
for the variable. Searching for the variable is done in all scopes that are visible to the given execution (and not searching parent scopes). Returns null when no variable value is found with the given name.- Specified by:
getVariableLocalTyped
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.variableName
- name of variable, cannot be null.deserializeObjectValue
- if false, aSerializableValue
will not be deserialized- Returns:
- the variable value or null if the variable is undefined.
-
getVariableLocal
Description copied from interface:RuntimeService
The variable value for an execution. Returns the value when the variable is set for the execution (and not searching parent scopes). Returns null when no variable value is found with the given name or when the value is set to null.- Specified by:
getVariableLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution, cannot be null.variableName
- name of variable, cannot be null.- Returns:
- the variable value or null if the variable is undefined or the value of the variable is null.
-
setVariable
Description copied from interface:RuntimeService
Update or create a variable for an execution. If the variable does not already exist somewhere in the execution hierarchy (i.e. the specified execution or any ancestor), it will be created in the process instance (which is the root execution).- Specified by:
setVariable
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution to set variable in, cannot be null.variableName
- name of variable to set, cannot be null.value
- value to set. When null is passed, the variable is not removed, only it's value will be set to null.
-
setVariableLocal
Description copied from interface:RuntimeService
Update or create a variable for an execution (not considering parent scopes). If the variable does not already exist, it will be created in the given execution.- Specified by:
setVariableLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution to set variable in, cannot be null.variableName
- name of variable to set, cannot be null.value
- value to set. When null is passed, the variable is not removed, only it's value will be set to null.
-
setVariables
Description copied from interface:RuntimeService
Update or create given variables for an execution (including parent scopes). If the variables are not already existing, they will be created in the process instance (which is the root execution).- Specified by:
setVariables
in interfaceRuntimeService
- Parameters:
executionId
- id of the process instance or the execution, cannot be null.variables
- map containing name (key) and value of variables, can be null.
-
setVariablesLocal
Description copied from interface:RuntimeService
Update or create given variables for an execution (not considering parent scopes). If the variables are not already existing, it will be created in the given execution.- Specified by:
setVariablesLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of the execution, cannot be null.variables
- map containing name (key) and value of variables, can be null.
-
setVariables
-
setVariablesAsync
public Batch setVariablesAsync(List<String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, HistoricProcessInstanceQuery historicProcessInstanceQuery, Map<String, ?> variables) Description copied from interface:RuntimeService
Update or create runtime process variables in the root scope of process instances.- Specified by:
setVariablesAsync
in interfaceRuntimeService
- Parameters:
processInstanceIds
- related to the process instances the variables will be set on; cannot benull
when processInstanceQuery and historicProcessInstanceQuery arenull
.processInstanceQuery
- to select process instances; Cannot benull
when processInstanceIds and historicProcessInstanceQuery arenull
.historicProcessInstanceQuery
- to select process instances; Cannot benull
when processInstanceIds and processInstanceQuery arenull
.variables
- that will be set to the root scope of the process instances- Returns:
- the batch which sets the variables asynchronously.
-
setVariablesAsync
Description copied from interface:RuntimeService
Update or create runtime process variables in the root scope of process instances.- Specified by:
setVariablesAsync
in interfaceRuntimeService
- Parameters:
processInstanceIds
- related to the process instances the variables will be set onvariables
- that will be set to the root scope of the process instances- Returns:
- the batch which sets the variables asynchronously.
-
setVariablesAsync
Description copied from interface:RuntimeService
Update or create runtime process variables in the root scope of process instances.- Specified by:
setVariablesAsync
in interfaceRuntimeService
- Parameters:
processInstanceQuery
- to select process instancesvariables
- that will be set to the root scope of the process instances- Returns:
- the batch which sets the variables asynchronously.
-
setVariablesAsync
public Batch setVariablesAsync(HistoricProcessInstanceQuery historicProcessInstanceQuery, Map<String, ?> variables) Description copied from interface:RuntimeService
Update or create runtime process variables in the root scope of process instances.- Specified by:
setVariablesAsync
in interfaceRuntimeService
- Parameters:
historicProcessInstanceQuery
- to select process instancesvariables
- that will be set to the root scope of the process instances- Returns:
- the batch which sets the variables asynchronously.
-
removeVariable
Description copied from interface:RuntimeService
Removes a variable for an execution.- Specified by:
removeVariable
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution to remove variable in.variableName
- name of variable to remove.
-
removeVariableLocal
Description copied from interface:RuntimeService
Removes a variable for an execution (not considering parent scopes).- Specified by:
removeVariableLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution to remove variable in.variableName
- name of variable to remove.
-
removeVariables
Description copied from interface:RuntimeService
Removes variables for an execution.- Specified by:
removeVariables
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution to remove variable in.variableNames
- collection containing name of variables to remove.
-
removeVariablesLocal
Description copied from interface:RuntimeService
Remove variables for an execution (not considering parent scopes).- Specified by:
removeVariablesLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution to remove variable in.variableNames
- collection containing name of variables to remove.
-
updateVariables
-
updateVariablesLocal
-
updateVariables
-
signal
Description copied from interface:RuntimeService
Sends an external trigger to an activity instance that is waiting inside the given execution. Note that you need to provide the exact execution that is waiting for the signal if the process instance contains multiple executions.- Specified by:
signal
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution to signal, cannot be null.
-
signal
public void signal(String executionId, String signalName, Object signalData, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Sends an external trigger to an activity instance that is waiting inside the given execution. Note that you need to provide the exact execution that is waiting for the signal if the process instance contains multiple executions.- Specified by:
signal
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution to signal, cannot be null.signalName
- name of the signal (can be null)signalData
- additional data of the signal (can be null)processVariables
- a map of process variables (can be null)
-
signal
Description copied from interface:RuntimeService
Sends an external trigger to an activity instance that is waiting inside the given execution. Note that you need to provide the exact execution that is waiting for the signal if the process instance contains multiple executions.- Specified by:
signal
in interfaceRuntimeService
- Parameters:
executionId
- id of process instance or execution to signal, cannot be null.processVariables
- a map of process variables
-
createProcessInstanceQuery
Description copied from interface:RuntimeService
Creates a newProcessInstanceQuery
instance, that can be used to query process instances.- Specified by:
createProcessInstanceQuery
in interfaceRuntimeService
-
getActiveActivityIds
Description copied from interface:RuntimeService
Finds the activity ids for all executions that are waiting in activities. This is a list because a single activity can be active multiple times. Deletion propagates upward as far as necessary.- Specified by:
getActiveActivityIds
in interfaceRuntimeService
- Parameters:
executionId
- id of the process instance or the execution, cannot be null.
-
getActivityInstance
Description copied from interface:RuntimeService
Allows retrieving the activity instance tree for a given process instance. The activity instance tree is aligned with the concept of scope in the BPMN specification. Activities that are "on the same level of subprocess" (ie. part of the same scope, contained in the same subprocess) will have their activity instances at the same level in the tree.
Examples:
- Process with two parallel user tasks after parallel Gateway: in the activity instance tree you will see two activity instances below the root instance, one for each user task.
- Process with two parallel Multi Instance user tasks after parallel Gateway: in the activity instance tree, all instances of both user tasks will be listed below the root activity instance. Reason: all activity instances are at the same level of subprocess.
- Usertask inside embedded subprocess: the activity instance three will have 3 levels: the root instance representing the process instance itself, below it an activity instance representing the instance of the embedded subprocess, and below this one, the activity instance representing the usertask.
Identity & Uniqueness:
Each activity instance is assigned a unique Id. The id is persistent, if you invoke this method multiple times, the same activity instance ids will be returned for the same activity instances. (However, there might be different executions assigned, see below)
Relation to Executions
The
Execution
concept in the process engine is not completely aligned with the activity instance concept because the execution tree is in general not aligned with the activity / scope concept in BPMN. In general, there is a n-1 relationship between Executions and ActivityInstances, ie. at a given point in time, an activity instance can be linked to multiple executions. In addition, it is not guaranteed that the same execution that started a given activity instance will also end it. The process engine performs several internal optimizations concerning the compacting of the execution tree which might lead to executions being reordered and pruned. This can lead to situations where a given execution starts an activity instance but another execution ends it. Another special case is the process instance: if the process instance is executing a non-scope activity (for example a user task) below the process definition scope, it will be referenced by both the root activity instance and the user task activity instance.If you need to interpret the state of a process instance in terms of a BPMN process model, it is usually easier to use the activity instance tree as opposed to the execution tree.
- Specified by:
getActivityInstance
in interfaceRuntimeService
- Parameters:
processInstanceId
- the id of the process instance for which the activity instance tree should be constructed.- Returns:
- the activity instance tree for a given process instance or null if no such process instance exists.
-
getFormInstanceById
-
suspendProcessInstanceById
Description copied from interface:RuntimeService
Suspends the process instance with the given id. This means that the execution is stopped, so the token state will not change. However, actions that do not change token state, like setting/removing variables, etc. will succeed.
Tasks belonging to this process instance will also be suspended. This means that any actions influencing the tasks' lifecycles will fail, such as
- claiming
- completing
- delegation
- changes in task assignees, owners, etc.
If a process instance is in state suspended, the engine will also not execute jobs (timers, messages) associated with this instance.
If you have a process instance hierarchy, suspending one process instance from the hierarchy will not suspend other process instances from that hierarchy.
Note: for more complex suspend commands use
RuntimeService.updateProcessInstanceSuspensionState()
.- Specified by:
suspendProcessInstanceById
in interfaceRuntimeService
-
suspendProcessInstanceByProcessDefinitionId
Description copied from interface:RuntimeService
Suspends the process instances with the given process definition id. This means that the execution is stopped, so the token state will not change. However, actions that do not change token state, like setting/removing variables, etc. will succeed.
Tasks belonging to the suspended process instance will also be suspended. This means that any actions influencing the tasks' lifecycles will fail, such as
- claiming
- completing
- delegation
- changes in task assignees, owners, etc.
If a process instance is in state suspended, the engine will also not execute jobs (timers, messages) associated with this instance.
If you have a process instance hierarchy, suspending one process instance from the hierarchy will not suspend other process instances from that hierarchy.
Note: for more complex suspend commands use
RuntimeService.updateProcessInstanceSuspensionState()
.- Specified by:
suspendProcessInstanceByProcessDefinitionId
in interfaceRuntimeService
-
suspendProcessInstanceByProcessDefinitionKey
Description copied from interface:RuntimeService
Suspends the process instances with the given process definition key. This means that the execution is stopped, so the token state will not change. However, actions that do not change token state, like setting/removing variables, etc. will succeed.
Tasks belonging to the suspended process instance will also be suspended. This means that any actions influencing the tasks' lifecycles will fail, such as
- claiming
- completing
- delegation
- changes in task assignees, owners, etc.
If a process instance is in state suspended, the engine will also not execute jobs (timers, messages) associated with this instance.
If you have a process instance hierarchy, suspending one process instance from the hierarchy will not suspend other process instances from that hierarchy.
Note: for more complex suspend commands use
RuntimeService.updateProcessInstanceSuspensionState()
.- Specified by:
suspendProcessInstanceByProcessDefinitionKey
in interfaceRuntimeService
-
activateProcessInstanceById
Description copied from interface:RuntimeService
Activates the process instance with the given id.
If you have a process instance hierarchy, activating one process instance from the hierarchy will not activate other process instances from that hierarchy.
Note: for more complex activate commands use
RuntimeService.updateProcessInstanceSuspensionState()
.- Specified by:
activateProcessInstanceById
in interfaceRuntimeService
-
activateProcessInstanceByProcessDefinitionId
Description copied from interface:RuntimeService
Activates the process instance with the given process definition id.
If you have a process instance hierarchy, activating one process instance from the hierarchy will not activate other process instances from that hierarchy.
Note: for more complex activate commands use
RuntimeService.updateProcessInstanceSuspensionState()
.- Specified by:
activateProcessInstanceByProcessDefinitionId
in interfaceRuntimeService
-
activateProcessInstanceByProcessDefinitionKey
Description copied from interface:RuntimeService
Activates the process instance with the given process definition key.
If you have a process instance hierarchy, activating one process instance from the hierarchy will not activate other process instances from that hierarchy.
Note: for more complex activate commands use
RuntimeService.updateProcessInstanceSuspensionState()
.- Specified by:
activateProcessInstanceByProcessDefinitionKey
in interfaceRuntimeService
-
updateProcessInstanceSuspensionState
Description copied from interface:RuntimeService
Activate or suspend process instances using a fluent builder. Specify the instances by calling one of the by methods, like byProcessInstanceId. To update the suspension state callUpdateProcessInstanceSuspensionStateBuilder.activate()
orUpdateProcessInstanceSuspensionStateBuilder.suspend()
.- Specified by:
updateProcessInstanceSuspensionState
in interfaceRuntimeService
- Returns:
- the builder to update the suspension state
-
startProcessInstanceByMessage
Description copied from interface:RuntimeService
Signals the process engine that a message is received and starts a new
ProcessInstance
.Calling this method can have two different outcomes:
- If the message name is associated with a message start event, a new process instance is started.
- If no subscription to a message with the given name exists,
ProcessEngineException
is thrown
- Specified by:
startProcessInstanceByMessage
in interfaceRuntimeService
- Parameters:
messageName
- the 'name' of the message as specified as an attribute on the bpmn20<message name="messageName" />
element.- Returns:
- the
ProcessInstance
object representing the started process instance
-
startProcessInstanceByMessage
Description copied from interface:RuntimeService
Signals the process engine that a message is received and starts a new
SeeProcessInstance
.RuntimeService.startProcessInstanceByMessage(String, Map)
. This method allows specifying a business key.- Specified by:
startProcessInstanceByMessage
in interfaceRuntimeService
- Parameters:
messageName
- the 'name' of the message as specified as an attribute on the bpmn20<message name="messageName" />
element.businessKey
- the business key which is added to the started process instance
-
startProcessInstanceByMessage
public ProcessInstance startProcessInstanceByMessage(String messageName, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Signals the process engine that a message is received and starts a new
SeeProcessInstance
.RuntimeService.startProcessInstanceByMessage(String)
. In addition, this method allows specifying a the payload of the message as a map of process variables.- Specified by:
startProcessInstanceByMessage
in interfaceRuntimeService
- Parameters:
messageName
- the 'name' of the message as specified as an attribute on the bpmn20<message name="messageName" />
element.processVariables
- the 'payload' of the message. The variables are added as processes variables to the started process instance.- Returns:
- the
ProcessInstance
object representing the started process instance
-
startProcessInstanceByMessage
public ProcessInstance startProcessInstanceByMessage(String messageName, String businessKey, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Signals the process engine that a message is received and starts a new
SeeProcessInstance
.RuntimeService.startProcessInstanceByMessage(String, Map)
. In addition, this method allows specifying a business key.- Specified by:
startProcessInstanceByMessage
in interfaceRuntimeService
- Parameters:
messageName
- the 'name' of the message as specified as an attribute on the bpmn20<message name="messageName" />
element.businessKey
- the business key which is added to the started process instanceprocessVariables
- the 'payload' of the message. The variables are added as processes variables to the started process instance.- Returns:
- the
ProcessInstance
object representing the started process instance
-
startProcessInstanceByMessageAndProcessDefinitionId
public ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId(String messageName, String processDefinitionId) Description copied from interface:RuntimeService
Signals the process engine that a message is received and starts a new
SeeProcessInstance
.RuntimeService.startProcessInstanceByMessage(String)
. In addition, this method allows specifying the exactly version of the process definition with the given id.- Specified by:
startProcessInstanceByMessageAndProcessDefinitionId
in interfaceRuntimeService
- Parameters:
messageName
- the 'name' of the message as specified as an attribute on the bpmn20<message name="messageName" />
element, cannot be null.processDefinitionId
- the id of the process definition, cannot be null.- Returns:
- the
ProcessInstance
object representing the started process instance
-
startProcessInstanceByMessageAndProcessDefinitionId
public ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId(String messageName, String processDefinitionId, String businessKey) Description copied from interface:RuntimeService
Signals the process engine that a message is received and starts a new
SeeProcessInstance
.RuntimeService.startProcessInstanceByMessage(String, String)
. In addition, this method allows specifying the exactly version of the process definition with the given id.- Specified by:
startProcessInstanceByMessageAndProcessDefinitionId
in interfaceRuntimeService
- Parameters:
messageName
- the 'name' of the message as specified as an attribute on the bpmn20<message name="messageName" />
element, cannot be null.processDefinitionId
- the id of the process definition, cannot be null.businessKey
- the business key which is added to the started process instance- Returns:
- the
ProcessInstance
object representing the started process instance
-
startProcessInstanceByMessageAndProcessDefinitionId
public ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId(String messageName, String processDefinitionId, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Signals the process engine that a message is received and starts a new
SeeProcessInstance
.RuntimeService.startProcessInstanceByMessage(String, Map)
. In addition, this method allows specifying the exactly version of the process definition with the given id.- Specified by:
startProcessInstanceByMessageAndProcessDefinitionId
in interfaceRuntimeService
- Parameters:
messageName
- the 'name' of the message as specified as an attribute on the bpmn20<message name="messageName" />
element, cannot be null.processDefinitionId
- the id of the process definition, cannot be null.processVariables
- the 'payload' of the message. The variables are added as processes variables to the started process instance.- Returns:
- the
ProcessInstance
object representing the started process instance
-
startProcessInstanceByMessageAndProcessDefinitionId
public ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId(String messageName, String processDefinitionId, String businessKey, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Signals the process engine that a message is received and starts a new
SeeProcessInstance
.RuntimeService.startProcessInstanceByMessage(String, String, Map)
. In addition, this method allows specifying the exactly version of the process definition with the given id.- Specified by:
startProcessInstanceByMessageAndProcessDefinitionId
in interfaceRuntimeService
- Parameters:
messageName
- the 'name' of the message as specified as an attribute on the bpmn20<message name="messageName" />
element, cannot be null.processDefinitionId
- the id of the process definition, cannot be null.businessKey
- the business key which is added to the started process instanceprocessVariables
- the 'payload' of the message. The variables are added as processes variables to the started process instance.- Returns:
- the
ProcessInstance
object representing the started process instance
-
signalEventReceived
Description copied from interface:RuntimeService
Notifies the process engine that a signal event of name 'signalName' has been received. Delivers the signal to all executions waiting on the signal and to all process definitions that can started by this signal. NOTE: Notification and instantiation happen synchronously.- Specified by:
signalEventReceived
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal event
-
signalEventReceived
Description copied from interface:RuntimeService
Notifies the process engine that a signal event of name 'signalName' has been received. Delivers the signal to all executions waiting on the signal and to all process definitions that can started by this signal. NOTE: Notification and instantiation happen synchronously.- Specified by:
signalEventReceived
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal eventprocessVariables
- a map of variables added to the execution(s)
-
signalEventReceived
Description copied from interface:RuntimeService
Notifies the process engine that a signal event of name 'signalName' has been received. This method delivers the signal to a single execution, being the execution referenced by 'executionId'. The waiting execution is notified synchronously. Note that you need to provide the exact execution that is waiting for the signal if the process instance contains multiple executions.- Specified by:
signalEventReceived
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal eventexecutionId
- id of the process instance or the execution to deliver the signal to
-
signalEventReceived
public void signalEventReceived(String signalName, String executionId, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Notifies the process engine that a signal event of name 'signalName' has been received. This method delivers the signal to a single execution, being the execution referenced by 'executionId'. The waiting execution is notified synchronously. Note that you need to provide the exact execution that is waiting for the signal if the process instance contains multiple executions.- Specified by:
signalEventReceived
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal eventexecutionId
- the id of the process instance or the execution to deliver the signal toprocessVariables
- a map of variables added to the execution(s)
-
createSignalEvent
Description copied from interface:RuntimeService
Notifies the process engine that a signal event has been received using a fluent builder.- Specified by:
createSignalEvent
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal event- Returns:
- the fluent builder to send the signal
-
messageEventReceived
Description copied from interface:RuntimeService
Notifies the process engine that a message event with name 'messageName' has been received and has been correlated to an execution with id 'executionId'. The waiting execution is notified synchronously. Note that you need to provide the exact execution that is waiting for the message if the process instance contains multiple executions.- Specified by:
messageEventReceived
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message eventexecutionId
- the id of the process instance or the execution to deliver the message to
-
messageEventReceived
public void messageEventReceived(String messageName, String executionId, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Notifies the process engine that a message event with the name 'messageName' has been received and has been correlated to an execution with id 'executionId'. The waiting execution is notified synchronously. Note that you need to provide the exact execution that is waiting for the message if the process instance contains multiple executions.- Specified by:
messageEventReceived
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message eventexecutionId
- the id of the process instance or the execution to deliver the message toprocessVariables
- a map of variables added to the execution
-
createMessageCorrelation
Description copied from interface:RuntimeService
Define a complex message correlation using a fluent builder.- Specified by:
createMessageCorrelation
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message. Corresponds to the 'name' element of the message defined in BPMN 2.0 Xml. Can be null to correlate by other criteria (businessKey, processInstanceId, correlationKeys) only.- Returns:
- the fluent builder for defining the message correlation.
-
correlateMessage
public void correlateMessage(String messageName, Map<String, Object> correlationKeys, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Correlates a message to- an execution that is waiting for a matching message and can be correlated according to the given correlation keys. This is typically matched against process instance variables.
- a process definition that can be started by this message.
- Specified by:
correlateMessage
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message event; if null, matches any eventcorrelationKeys
- a map of key value pairs that are used to correlate the message to an executionprocessVariables
- a map of variables added to the execution or newly created process instance
-
correlateMessage
public void correlateMessage(String messageName, String businessKey, Map<String, Object> correlationKeys, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Correlates a message to- an execution that is waiting for a matching message and can be correlated according to the given correlation keys. This is typically matched against process instance variables. The process instance it belongs to has to have the given business key.
- a process definition that can be started by this message.
- Specified by:
correlateMessage
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message event; if null, matches any eventbusinessKey
- the business key of process instances to correlate againstcorrelationKeys
- a map of key value pairs that are used to correlate the message to an executionprocessVariables
- a map of variables added to the execution or newly created process instance
-
correlateMessage
Description copied from interface:RuntimeService
Correlates a message to either an execution that is waiting for this message or a process definition that can be started by this message. Notification and instantiation happen synchronously.- Specified by:
correlateMessage
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message event; if null, matches any event
-
correlateMessage
Description copied from interface:RuntimeService
Correlates a message to- an execution that is waiting for a matching message and belongs to a process instance with the given business key
- a process definition that can be started by a matching message.
- Specified by:
correlateMessage
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message event; if null, matches any eventbusinessKey
- the business key of process instances to correlate against
-
correlateMessage
Description copied from interface:RuntimeService
Correlates a message to- an execution that is waiting for a matching message and can be correlated according to the given correlation keys. This is typically matched against process instance variables.
- a process definition that can be started by message with the provided name.
- Specified by:
correlateMessage
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message event; if null, matches any eventcorrelationKeys
- a map of key value pairs that are used to correlate the message to an execution
-
correlateMessage
public void correlateMessage(String messageName, String businessKey, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Correlates a message to- an execution that is waiting for a matching message and belongs to a process instance with the given business key
- a process definition that can be started by this message.
- Specified by:
correlateMessage
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message event; if null, matches any eventbusinessKey
- the business key of process instances to correlate againstprocessVariables
- a map of variables added to the execution or newly created process instance
-
createMessageCorrelationAsync
Description copied from interface:RuntimeService
Define a complex asynchronous message correlation using a fluent builder.- Specified by:
createMessageCorrelationAsync
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message. Corresponds to the 'name' element of the message defined in BPMN 2.0 Xml. Can be null to correlate by other criteria only.- Returns:
- the fluent builder for defining the asynchronous message correlation.
-
createProcessInstanceModification
public ProcessInstanceModificationBuilder createProcessInstanceModification(String processInstanceId) Description copied from interface:RuntimeService
Define a modification of a process instance in terms of activity cancellations and instantiations via a fluent builder. Instructions are executed in the order they are specified.- Specified by:
createProcessInstanceModification
in interfaceRuntimeService
- Parameters:
processInstanceId
- the process instance to modify
-
createProcessInstanceById
Description copied from interface:RuntimeService
Returns a fluent builder to start a new process instance in the exactly specified version of the process definition with the given id. The builder can be used to set further properties and specify instantiation instructions to start the instance at any set of activities in the process. If no instantiation instructions are set then the instance start at the default start activity.- Specified by:
createProcessInstanceById
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot benull
.- Returns:
- a builder to create a process instance of the definition
-
createProcessInstanceByKey
Description copied from interface:RuntimeService
Returns a fluent builder to start a new process instance in the latest version of the process definition with the given key. The builder can be used to set further properties and specify instantiation instructions to start the instance at any set of activities in the process. If no instantiation instructions are set then the instance start at the default start activity.- Specified by:
createProcessInstanceByKey
in interfaceRuntimeService
- Parameters:
processDefinitionKey
- the key of the process definition, cannot benull
.- Returns:
- a builder to create a process instance of the definition
-
createMigrationPlan
public MigrationPlanBuilder createMigrationPlan(String sourceProcessDefinitionId, String targetProcessDefinitionId) Description copied from interface:RuntimeService
Creates a migration plan to migrate process instance between different process definitions. Returns a fluent builder that can be used to specify migration instructions and build the plan.- Specified by:
createMigrationPlan
in interfaceRuntimeService
- Parameters:
sourceProcessDefinitionId
- the process definition that instances are migrated fromtargetProcessDefinitionId
- the process definition that instances are migrated to- Returns:
- a fluent builder
-
newMigration
Description copied from interface:RuntimeService
Executes a migration plan for a given list of process instances. The migration can either be executed synchronously or asynchronously. A synchronously migration blocks the caller until the migration was completed. The migration can only be successfully completed if all process instances can be migrated. If the migration is executed asynchronously aBatch
is immediately returned. The migration is then executed as jobs from the process engine and the batch can be used to track the progress of the migration. The Batch splits the migration in smaller chunks which will be executed independently.- Specified by:
newMigration
in interfaceRuntimeService
- Parameters:
migrationPlan
- the migration plan to executed- Returns:
- a fluent builder
-
createModification
Description copied from interface:RuntimeService
Creates a modification of multiple process instances in terms of activity cancellations and instantiations via a fluent builder. Returns a fluent builder that can be used to specify modification instructions and set process instances that should be modified. The modification can either be executed synchronously or asynchronously. A synchronously modification blocks the caller until the modification was completed. The modification can only be successfully completed if all process instances can be modified. If the modification is executed asynchronously aBatch
is immediately returned. The modification is then executed as jobs from the process engine and the batch can be used to track the progress of the modification. The Batch splits the modification in smaller chunks which will be executed independently.- Specified by:
createModification
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the process definition that instances are modified of- Returns:
- a fluent builder
-
restartProcessInstances
Description copied from interface:RuntimeService
Restarts process instances that are completed or deleted with the initial or last set of variables.- Specified by:
restartProcessInstances
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.
-
createIncident
Description copied from interface:RuntimeService
Creates an incident- Specified by:
createIncident
in interfaceRuntimeService
- Parameters:
incidentType
- the type of incident, cannot be nullexecutionId
- execution id, cannot be null- Returns:
- a new incident
-
createIncident
public Incident createIncident(String incidentType, String executionId, String configuration, String message) Description copied from interface:RuntimeService
Creates an incident- Specified by:
createIncident
in interfaceRuntimeService
- Parameters:
incidentType
- the type of incident, cannot be nullexecutionId
- execution id, cannot be null- Returns:
- a new incident
-
resolveIncident
Description copied from interface:RuntimeService
Resolves and remove an incident- Specified by:
resolveIncident
in interfaceRuntimeService
- Parameters:
incidentId
- the id of an incident to resolve
-
setAnnotationForIncidentById
Description copied from interface:RuntimeService
Set an annotation to an incident.- Specified by:
setAnnotationForIncidentById
in interfaceRuntimeService
- Parameters:
incidentId
- of the incident that the annotation is updated atannotation
- that is set to the incident
-
clearAnnotationForIncidentById
Description copied from interface:RuntimeService
Clear the annotation for an incident.- Specified by:
clearAnnotationForIncidentById
in interfaceRuntimeService
- Parameters:
incidentId
- of the incident that the annotation is cleared at
-
createConditionEvaluation
Description copied from interface:RuntimeService
Define a complex condition evaluation using a fluent builder.- Specified by:
createConditionEvaluation
in interfaceRuntimeService
- Returns:
- the fluent builder for defining the condition evaluation.
-