Class RuntimeServiceImpl
- All Implemented Interfaces:
RuntimeService
- Author:
- Tom Baeyens, Daniel Meyer
-
Field Summary
Fields inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
commandExecutor
Fields inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
configuration
-
Constructor Summary
ConstructorDescriptionRuntimeServiceImpl
(org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
activateProcessInstanceById
(String processInstanceId) Activates the process instance with the given id.void
addEventListener
(org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToAdd) Adds an event-listener which will be notified of ALL events by the dispatcher.void
addEventListener
(org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToAdd, org.flowable.common.engine.api.delegate.event.FlowableEngineEventType... types) Adds an event-listener which will only be notified when an event occurs, which type is in the given types.void
addEventRegistryConsumer
(org.flowable.eventregistry.api.EventRegistryEventConsumer eventConsumer) void
addGroupIdentityLink
(String processInstanceId, String groupId, String identityLinkType) Involves a group with a process instance.addMultiInstanceExecution
(String activityId, String parentExecutionId, Map<String, Object> executionVariables) Adds a new execution to a running multi-instance parent executionvoid
addParticipantGroup
(String processInstanceId, String groupId) Convenience shorthand forRuntimeService.addGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
void
addParticipantUser
(String processInstanceId, String userId) Convenience shorthand forRuntimeService.addUserIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
void
addUserIdentityLink
(String processInstanceId, String userId, String identityLinkType) Involves a user with a process instance.void
bulkDeleteProcessInstances
(Collection<String> processInstanceIds, String deleteReason) Delete a collection of existing runtime process instance.void
changeActivityState
(org.flowable.engine.impl.runtime.ChangeActivityStateBuilderImpl changeActivityStateBuilder) void
completeAdhocSubProcess
(String executionId) Completes the ad-hoc sub processCreates a newActivityInstanceQuery
instance, that can be used to query activities in the currently running process instances.Create aChangeActivityStateBuilder
, that allows to set various options for changing the state of a process instance.org.flowable.eventsubscription.api.EventSubscriptionQuery
Creates a newEventSubscriptionQuery
instance, that can be used to query the event subscriptions.Creates a newExecutionQuery
instance, that can be used to query the executions and process instances.creates a newNativeActivityInstanceQuery
to queryActivityInstance
s which are included in the cuby SQL directly.creates a newNativeExecutionQuery
to queryExecution
s by SQL directlycreates a newNativeProcessInstanceQuery
to queryProcessInstance
s by SQL directlyorg.flowable.variable.api.runtime.NativeVariableInstanceQuery
Returns a newNativeQuery
for variable instances.Create aProcessInstanceBuilder
, that allows to set various options for starting a process instance, as an alternative to the various startProcessInstanceByXX methods.Creates a newProcessInstanceQuery
instance, that can be used to query process instances.Creates a new event subscription builder to register a subscription to start a new process instance based on an event with a particular set of correlation parameter values.Creates a new event subscription deletion builder delete one or more previously registered process start event subscriptions based on a particular process definition and with an optional combination of correlation parameter values.Creates a new event subscription modification builder to modify one or more previously registered process start event subscriptions based on a particular process definition and with an optional combination of correlation parameter values.org.flowable.variable.api.runtime.VariableInstanceQuery
Creates a new programmatic query to search forVariableInstance
s.void
deleteGroupIdentityLink
(String processInstanceId, String groupId, String identityLinkType) Removes the association between a group and a process instance for the given identityLinkType.void
deleteMultiInstanceExecution
(String executionId, boolean executionIsCompleted) Deletes a multi-instance executionvoid
deleteParticipantGroup
(String processInstanceId, String groupId) Convenience shorthand forRuntimeService.deleteGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
void
deleteParticipantUser
(String processInstanceId, String userId) Convenience shorthand forRuntimeService.deleteUserIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
void
deleteProcessInstance
(String processInstanceId, String deleteReason) Delete an existing runtime process instance.void
deleteProcessInstanceStartEventSubscriptions
(org.flowable.engine.impl.runtime.ProcessInstanceStartEventSubscriptionDeletionBuilderImpl builder) void
deleteUserIdentityLink
(String processInstanceId, String userId, String identityLinkType) Removes the association between a user and a process instance for the given identityLinkType.void
dispatchEvent
(org.flowable.common.engine.api.delegate.event.FlowableEvent event) Dispatches the given event to any listeners that are registered.void
evaluateConditionalEvents
(String processInstanceId) Evaluate waiting conditional events (boundary, intermediate catch and event sub process start events) and trigger them if a condition evaluates to true.void
evaluateConditionalEvents
(String processInstanceId, Map<String, Object> processVariables) Evaluate waiting conditional events (boundary, intermediate catch and event sub process start events) and trigger them if a condition evaluates to true.executeActivityInAdhocSubProcess
(String executionId, String activityId) Executes an activity in a ad-hoc sub processgetActiveActivityIds
(String executionId) Finds the activity ids for all executions that are waiting in activities.getAdhocSubProcessExecutions
(String processInstanceId) Gets executions with an adhoc sub process as current flow elementgetDataObject
(String executionId, String dataObject) The DataObject.getDataObject
(String executionId, String dataObjectName, String locale, boolean withLocalizationFallback) The DataObject.getDataObjectLocal
(String executionId, String dataObjectName) The DataObject for an execution.getDataObjectLocal
(String executionId, String dataObjectName, String locale, boolean withLocalizationFallback) The DataObject for an execution.getDataObjects
(String executionId) All DataObjects visible from the given execution scope (including parent scopes).getDataObjects
(String executionId, String locale, boolean withLocalizationFallback) All DataObjects visible from the given execution scope (including parent scopes).getDataObjects
(String executionId, Collection<String> dataObjectNames) The DataObjects for all given dataObjectNames, takes all dataObjects into account which are visible from the given execution scope (including parent scopes).getDataObjects
(String executionId, Collection<String> dataObjectNames, String locale, boolean withLocalizationFallback) The DataObjects for all given dataObjectNames, takes all dataObjects into account which are visible from the given execution scope (including parent scopes).getDataObjectsLocal
(String executionId) All DataObject values that are defined in the execution scope, without taking outer scopes into account.getDataObjectsLocal
(String executionId, String locale, boolean withLocalizationFallback) All DataObject values that are defined in the execution scope, without taking outer scopes into account.getDataObjectsLocal
(String executionId, Collection<String> dataObjects) The DataObjects for the given dataObjectNames only taking the given execution scope into account, not looking in outer scopes.getDataObjectsLocal
(String executionId, Collection<String> dataObjectNames, String locale, boolean withLocalizationFallback) The DataObjects for the given dataObjectNames only taking the given execution scope into account, not looking in outer scopes.List<org.flowable.bpmn.model.FlowNode>
getEnabledActivitiesFromAdhocSubProcess
(String executionId) Gets enabled activities from ad-hoc sub processList<org.flowable.entitylink.api.EntityLink>
getEntityLinkChildrenForProcessInstance
(String processInstanceId) Retrieves theEntityLink
s associated with the given process instance.List<org.flowable.entitylink.api.EntityLink>
getEntityLinkChildrenForTask
(String taskId) Retrieves theEntityLink
s associated with the given task.List<org.flowable.entitylink.api.EntityLink>
getEntityLinkChildrenWithSameRootAsProcessInstance
(String processInstanceId) Retrieves all theEntityLink
s associated with the same root as the given process instance.List<org.flowable.entitylink.api.EntityLink>
getEntityLinkParentsForProcessInstance
(String processInstanceId) Retrieves theEntityLink
s where the given process instance is referenced.List<org.flowable.entitylink.api.EntityLink>
getEntityLinkParentsForTask
(String taskId) Retrieves theEntityLink
s where the given task is referenced.getFormInstanceById
(String processDefinitionId) List<org.flowable.identitylink.api.IdentityLink>
getIdentityLinksForProcessInstance
(String processInstanceId) Retrieves theIdentityLink
s associated with the given process instance.getProcessInstanceEvents
(String processInstanceId) The all events related to the given Process Instance.org.flowable.form.api.FormInfo
getStartFormModel
(String processDefinitionId, String processInstanceId) Gets a Form model instance of the start form of a specific process definition or process instancegetVariable
(String executionId, String variableName) The variable value.<T> T
getVariable
(String executionId, String variableName, Class<T> variableClass) The variable value.org.flowable.variable.api.persistence.entity.VariableInstance
getVariableInstance
(String executionId, String variableName) The variable.org.flowable.variable.api.persistence.entity.VariableInstance
getVariableInstanceLocal
(String executionId, String variableName) The variable for an execution.getVariableInstances
(String executionId) All variables visible from the given execution scope (including parent scopes).getVariableInstances
(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).List<org.flowable.variable.api.persistence.entity.VariableInstance>
getVariableInstancesByExecutionIds
(Set<String> executionIds) All variables visible from the given execution scope (including parent scopes).getVariableInstancesLocal
(String executionId) All variable values that are defined in the execution scope, without taking outer scopes into account.getVariableInstancesLocal
(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.getVariableLocal
(String executionId, String variableName) The variable value for an execution.<T> T
getVariableLocal
(String executionId, String variableName, Class<T> variableClass) The variable value for an execution.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.boolean
hasVariable
(String executionId, String variableName) Check whether or not this execution has variable set with the given name, Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes).boolean
hasVariableLocal
(String executionId, String variableName) Check whether or not this execution has a local variable set with the given name.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'.void
messageEventReceivedAsync
(String messageName, String executionId) 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'.void
migrateProcessInstanceStartEventSubscriptionsToProcessDefinitionVersion
(org.flowable.engine.impl.runtime.ProcessInstanceStartEventSubscriptionModificationBuilderImpl builder) org.flowable.eventsubscription.api.EventSubscription
registerProcessInstanceStartEventSubscription
(org.flowable.engine.impl.runtime.ProcessInstanceStartEventSubscriptionBuilderImpl builder) void
removeAssignee
(String processInstanceId) Removes the assignee of a process instance.void
removeEventListener
(org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToRemove) Removes the given listener from this dispatcher.void
removeEventRegistryConsumer
(org.flowable.eventregistry.api.EventRegistryEventConsumer eventConsumer) void
removeOwner
(String processInstanceId) Removes the owner of a process instance.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
setAssignee
(String processInstanceId, String userId) Set the new assignee of a process instance.void
Set the new owner of a process instance.void
setProcessInstanceName
(String processInstanceId, String name) Sets the name for the process instance with the given id.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, ?> variables) Update or create given variables for an execution (including parent scopes).void
setVariablesLocal
(String executionId, Map<String, ?> variables) Update or create given variables for an execution (not considering parent scopes).void
void
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.void
signalEventReceivedAsync
(String signalName) Notifies the process engine that a signal event of name 'signalName' has been received.void
signalEventReceivedAsync
(String signalName, String executionId) Notifies the process engine that a signal event of name 'signalName' has been received.void
signalEventReceivedAsyncWithTenantId
(String signalName, String tenantId) Similar toRuntimeService.signalEventReceivedAsync(String)
, but within the context of one tenant.void
signalEventReceivedWithTenantId
(String signalName, String tenantId) Similar toRuntimeService.signalEventReceived(String)
, but within the context of one tenant.void
signalEventReceivedWithTenantId
(String signalName, Map<String, Object> processVariables, String tenantId) Similar toRuntimeService.signalEventReceived(String, Map)
, but within the context of one tenant.startProcessInstance
(org.flowable.engine.impl.runtime.ProcessInstanceBuilderImpl processInstanceBuilder) startProcessInstanceAsync
(org.flowable.engine.impl.runtime.ProcessInstanceBuilderImpl processInstanceBuilder) 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, 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, 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 keystartProcessInstanceByKeyAndTenantId
(String processDefinitionKey, String tenantId) Similar toRuntimeService.startProcessInstanceByKey(String)
, but using a specific tenant identifier.startProcessInstanceByKeyAndTenantId
(String processDefinitionKey, String businessKey, String tenantId) Similar toRuntimeService.startProcessInstanceByKey(String, String)
, but using a specific tenant identifier.startProcessInstanceByKeyAndTenantId
(String processDefinitionKey, String businessKey, Map<String, Object> variables, String tenantId) Similar toRuntimeService.startProcessInstanceByKey(String, String, Map)
, but using a specific tenant identifier.startProcessInstanceByKeyAndTenantId
(String processDefinitionKey, Map<String, Object> variables, String tenantId) Similar toRuntimeService.startProcessInstanceByKey(String, Map)
, but using a specific tenant identifier.startProcessInstanceByMessage
(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
.startProcessInstanceByMessageAndTenantId
(String messageName, String tenantId) Similar toRuntimeService.startProcessInstanceByMessage(String)
, but with tenant context.startProcessInstanceByMessageAndTenantId
(String messageName, String businessKey, String tenantId) Similar toRuntimeService.startProcessInstanceByMessage(String, String)
, but with tenant context.startProcessInstanceByMessageAndTenantId
(String messageName, String businessKey, Map<String, Object> processVariables, String tenantId) Similar toRuntimeService.startProcessInstanceByMessage(String, String, Map)
, but with tenant context.startProcessInstanceByMessageAndTenantId
(String messageName, Map<String, Object> processVariables, String tenantId) Similar toRuntimeService.startProcessInstanceByMessage(String, Map)
, but with tenant context.startProcessInstanceWithForm
(String processDefinitionId, String outcome, Map<String, Object> variables, String processInstanceName) Starts a new process instance in the exactly specified version of the process definition with the given id.void
suspendProcessInstanceById
(String processInstanceId) Suspends the process instance with the given id.void
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
trigger
(String executionId, Map<String, Object> processVariables, Map<String, Object> transientVariables) Similar toRuntimeService.trigger(String, Map)
, but with an extra parameter that allows to pass transient variables.void
triggerAsync
(String executionId) Sends an external trigger to an activity instance that is waiting inside the given execution.void
triggerAsync
(String executionId, Map<String, Object> processVariables) Sends an external trigger to an activity instance that is waiting inside the given execution.void
updateBusinessKey
(String processInstanceId, String businessKey) Updates the business key for the provided process instancevoid
updateBusinessStatus
(String processInstanceId, String businessStatus) Updates the business status for the provided process instanceMethods inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
getCommandExecutor, setCommandExecutor
Methods inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
getConfiguration
-
Constructor Details
-
RuntimeServiceImpl
public RuntimeServiceImpl(org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl configuration)
-
-
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 , see
ProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice.- Specified by:
startProcessInstanceByKey
in interfaceRuntimeService
- Parameters:
processDefinitionKey
- key of process definition, cannot be null.businessKey
- a key that identifies the process instance and can be used to retrieve the process instance later via the query API.
-
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 , see
ProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice.- Specified by:
startProcessInstanceByKey
in interfaceRuntimeService
- Parameters:
processDefinitionKey
- key of process definition, cannot be null.businessKey
- a key that identifies the process instance and can be used to retrieve the process instance later via the query API.variables
- the variables to pass, can be null.
-
startProcessInstanceByKeyAndTenantId
public ProcessInstance startProcessInstanceByKeyAndTenantId(String processDefinitionKey, String tenantId) Description copied from interface:RuntimeService
Similar toRuntimeService.startProcessInstanceByKey(String)
, but using a specific tenant identifier.- Specified by:
startProcessInstanceByKeyAndTenantId
in interfaceRuntimeService
-
startProcessInstanceByKeyAndTenantId
public ProcessInstance startProcessInstanceByKeyAndTenantId(String processDefinitionKey, String businessKey, String tenantId) Description copied from interface:RuntimeService
Similar toRuntimeService.startProcessInstanceByKey(String, String)
, but using a specific tenant identifier.- Specified by:
startProcessInstanceByKeyAndTenantId
in interfaceRuntimeService
-
startProcessInstanceByKeyAndTenantId
public ProcessInstance startProcessInstanceByKeyAndTenantId(String processDefinitionKey, Map<String, Object> variables, String tenantId) Description copied from interface:RuntimeService
Similar toRuntimeService.startProcessInstanceByKey(String, Map)
, but using a specific tenant identifier.- Specified by:
startProcessInstanceByKeyAndTenantId
in interfaceRuntimeService
-
startProcessInstanceByKeyAndTenantId
public ProcessInstance startProcessInstanceByKeyAndTenantId(String processDefinitionKey, String businessKey, Map<String, Object> variables, String tenantId) Description copied from interface:RuntimeService
Similar toRuntimeService.startProcessInstanceByKey(String, String, Map)
, but using a specific tenant identifier.- Specified by:
startProcessInstanceByKeyAndTenantId
in interfaceRuntimeService
-
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 , see
ProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice.- Specified by:
startProcessInstanceById
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.businessKey
- a key that identifies the process instance and can be used to retrieve the process instance later via the query API.
-
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 , see
ProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice.- Specified by:
startProcessInstanceById
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.variables
- variables to be passed, can be null
-
startProcessInstanceWithForm
public ProcessInstance startProcessInstanceWithForm(String processDefinitionId, String outcome, Map<String, Object> variables, String processInstanceName) 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 , see
ProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice.Only use this method when a form definition is attached to the start event of the provided process definition. This will expect the Flowable Form Engine to be enabled. A new form instance will be created after successfully starting a new process instance.
- Specified by:
startProcessInstanceWithForm
in interfaceRuntimeService
- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.outcome
- the form outcome of the start form, can be null.variables
- variables to be passed, can be nullprocessInstanceName
- the name of the process instance to be started, can be null.
-
getStartFormModel
public org.flowable.form.api.FormInfo getStartFormModel(String processDefinitionId, String processInstanceId) Description copied from interface:RuntimeService
Gets a Form model instance of the start form of a specific process definition or process instance- Specified by:
getStartFormModel
in interfaceRuntimeService
- Parameters:
processDefinitionId
- id of process definition for which the start form should be retrieved.processInstanceId
- id of process instance for which the start form should be retrieved.
-
deleteProcessInstance
Description copied from interface:RuntimeService
Delete an existing runtime process instance.- Specified by:
deleteProcessInstance
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of process instance to delete, cannot be null.deleteReason
- reason for deleting, can be null.
-
bulkDeleteProcessInstances
Description copied from interface:RuntimeService
Delete a collection of existing runtime process instance.- Specified by:
bulkDeleteProcessInstances
in interfaceRuntimeService
- Parameters:
processInstanceIds
- Set of ids of process instances to delete, cannot be null.deleteReason
- reason for deleting, can be null.
-
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
-
createNativeActivityInstanceQuery
Description copied from interface:RuntimeService
creates a newNativeActivityInstanceQuery
to queryActivityInstance
s which are included in the cuby SQL directly.- Specified by:
createNativeActivityInstanceQuery
in interfaceRuntimeService
-
createEventSubscriptionQuery
public org.flowable.eventsubscription.api.EventSubscriptionQuery createEventSubscriptionQuery()Description copied from interface:RuntimeService
Creates a newEventSubscriptionQuery
instance, that can be used to query the event subscriptions.- Specified by:
createEventSubscriptionQuery
in interfaceRuntimeService
-
updateBusinessKey
Description copied from interface:RuntimeService
Updates the business key for the provided process instance- Specified by:
updateBusinessKey
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance to set the business key, cannot be nullbusinessKey
- new businessKey value
-
updateBusinessStatus
Description copied from interface:RuntimeService
Updates the business status for the provided process instance- Specified by:
updateBusinessStatus
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance to set the business status, cannot be nullbusinessStatus
- new business status value
-
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 execution, cannot be null.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariableInstances
public Map<String,org.flowable.variable.api.persistence.entity.VariableInstance> getVariableInstances(String executionId) Description copied from interface:RuntimeService
All variables visible from the given execution scope (including parent scopes).- Specified by:
getVariableInstances
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.- Returns:
- the variable instances or an empty map if no such variables are found.
-
getVariableInstancesByExecutionIds
public List<org.flowable.variable.api.persistence.entity.VariableInstance> getVariableInstancesByExecutionIds(Set<String> executionIds) Description copied from interface:RuntimeService
All variables visible from the given execution scope (including parent scopes).- Specified by:
getVariableInstancesByExecutionIds
in interfaceRuntimeService
- Parameters:
executionIds
- ids of execution, cannot be null.- Returns:
- the variables.
-
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.
-
getVariableInstancesLocal
public Map<String,org.flowable.variable.api.persistence.entity.VariableInstance> getVariableInstancesLocal(String executionId) 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.getVariableInstancesLocal(String, Collection)
for better performance.- Specified by:
getVariableInstancesLocal
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 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.
-
getVariableInstances
public Map<String,org.flowable.variable.api.persistence.entity.VariableInstance> getVariableInstances(String executionId, Collection<String> variableNames) 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:
getVariableInstances
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.
-
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.
-
getVariableInstancesLocal
public Map<String,org.flowable.variable.api.persistence.entity.VariableInstance> getVariableInstancesLocal(String executionId, Collection<String> variableNames) 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:
getVariableInstancesLocal
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 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.
-
getVariableInstance
public org.flowable.variable.api.persistence.entity.VariableInstance getVariableInstance(String executionId, String variableName) Description copied from interface:RuntimeService
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 or when the value is set to null.- Specified by:
getVariableInstance
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.variableName
- name of variable, cannot be null.- Returns:
- the variable or null if the variable is undefined.
-
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. Throws ClassCastException when cannot cast variable to given class- Specified by:
getVariable
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.variableName
- name of variable, cannot be null.variableClass
- 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.
-
hasVariable
Description copied from interface:RuntimeService
Check whether or not this execution has variable set with the given name, Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes).- Specified by:
hasVariable
in interfaceRuntimeService
-
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
-
getVariableInstanceLocal
public org.flowable.variable.api.persistence.entity.VariableInstance getVariableInstanceLocal(String executionId, String variableName) Description copied from interface:RuntimeService
The variable for an execution. Returns the variable when it is set for the execution (and not searching parent scopes). Returns null when no variable is found with the given name or when the value is set to null.- Specified by:
getVariableInstanceLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.variableName
- name of variable, cannot be null.- Returns:
- the variable or null if the variable is undefined.
-
getVariableLocal
Description copied from interface:RuntimeService
The variable value for an execution. Returns the value casted to given class 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
-
hasVariableLocal
Description copied from interface:RuntimeService
Check whether or not this execution has a local variable set with the given name.- Specified by:
hasVariableLocal
in interfaceRuntimeService
-
setVariable
Description copied from interface:RuntimeService
Update or create a variable for an execution.The variable is set according to the algorithm as documented for
VariableScope.setVariable(String, Object)
.- Specified by:
setVariable
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.- See Also:
-
VariableScope#setVariable(String, Object)
-
setVariableLocal
Description copied from interface:RuntimeService
Update or create a variable for an execution (not considering parent scopes). If the variable is not already existing, 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).Variables are set according to the algorithm as documented for
VariableScope.setVariables(Map)
, applied separately to each variable.- Specified by:
setVariables
in interfaceRuntimeService
- Parameters:
executionId
- id of the execution, cannot be null.variables
- map containing name (key) and value of variables, can be null.- See Also:
-
VariableScope#setVariables(Map)
-
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.
-
removeVariable
Description copied from interface:RuntimeService
Removes a variable for an execution.- Specified by:
removeVariable
in interfaceRuntimeService
- Parameters:
executionId
- id of 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 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.
-
createVariableInstanceQuery
public org.flowable.variable.api.runtime.VariableInstanceQuery createVariableInstanceQuery()Description copied from interface:RuntimeService
Creates a new programmatic query to search forVariableInstance
s.- Specified by:
createVariableInstanceQuery
in interfaceRuntimeService
-
createNativeVariableInstanceQuery
public org.flowable.variable.api.runtime.NativeVariableInstanceQuery createNativeVariableInstanceQuery()Description copied from interface:RuntimeService
Returns a newNativeQuery
for variable instances.- Specified by:
createNativeVariableInstanceQuery
in interfaceRuntimeService
-
getDataObjects
Description copied from interface:RuntimeService
All DataObjects visible from the given execution scope (including parent scopes).- Specified by:
getDataObjects
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.- Returns:
- the DataObjects or an empty map if no such variables are found.
-
getDataObjects
public Map<String,DataObject> getDataObjects(String executionId, String locale, boolean withLocalizationFallback) Description copied from interface:RuntimeService
All DataObjects visible from the given execution scope (including parent scopes).- Specified by:
getDataObjects
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.locale
- locale the DataObject name and description should be returned in (if available).withLocalizationFallback
- When true localization will fallback to more general locales if the specified locale is not found.- Returns:
- the DataObjects or an empty map if no DataObjects are found.
-
getDataObjectsLocal
Description copied from interface:RuntimeService
All DataObject values that are defined in the execution scope, without taking outer scopes into account. If you have many local DataObjects and you only need a few, consider usingRuntimeService.getDataObjectsLocal(String, Collection)
for better performance.- Specified by:
getDataObjectsLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.- Returns:
- the DataObjects or an empty map if no DataObjects are found.
-
getDataObjectsLocal
public Map<String,DataObject> getDataObjectsLocal(String executionId, String locale, boolean withLocalizationFallback) Description copied from interface:RuntimeService
All DataObject values that are defined in the execution scope, without taking outer scopes into account. If you have many local DataObjects and you only need a few, consider usingRuntimeService.getDataObjectsLocal(String, Collection)
for better performance.- Specified by:
getDataObjectsLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.locale
- locale the DataObject name and description should be returned in (if available).withLocalizationFallback
- When true localization will fallback to more general locales if the specified locale is not found.- Returns:
- the DataObjects or an empty map if no such variables are found.
-
getDataObjects
public Map<String,DataObject> getDataObjects(String executionId, Collection<String> dataObjectNames) Description copied from interface:RuntimeService
The DataObjects for all given dataObjectNames, takes all dataObjects into account which are visible from the given execution scope (including parent scopes).- Specified by:
getDataObjects
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.dataObjectNames
- the collection of DataObject names that should be retrieved.- Returns:
- the DataObject or an empty map if no DataObjects are found.
-
getDataObjects
public Map<String,DataObject> getDataObjects(String executionId, Collection<String> dataObjectNames, String locale, boolean withLocalizationFallback) Description copied from interface:RuntimeService
The DataObjects for all given dataObjectNames, takes all dataObjects into account which are visible from the given execution scope (including parent scopes).- Specified by:
getDataObjects
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.dataObjectNames
- the collection of DataObject names that should be retrieved.locale
- locale the DataObject name and description should be returned in (if available).withLocalizationFallback
- When true localization will fallback to more general locales if the specified locale is not found.- Returns:
- the DataObjects or an empty map if no such dataObjects are found.
-
getDataObjectsLocal
public Map<String,DataObject> getDataObjectsLocal(String executionId, Collection<String> dataObjects) Description copied from interface:RuntimeService
The DataObjects for the given dataObjectNames only taking the given execution scope into account, not looking in outer scopes.- Specified by:
getDataObjectsLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.dataObjects
- the collection of DataObject names that should be retrieved.- Returns:
- the DataObjects or an empty map if no DataObjects are found.
-
getDataObjectsLocal
public Map<String,DataObject> getDataObjectsLocal(String executionId, Collection<String> dataObjectNames, String locale, boolean withLocalizationFallback) Description copied from interface:RuntimeService
The DataObjects for the given dataObjectNames only taking the given execution scope into account, not looking in outer scopes.- Specified by:
getDataObjectsLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.dataObjectNames
- the collection of DataObject names that should be retrieved.locale
- locale the DataObject name and description should be returned in (if available).withLocalizationFallback
- When true localization will fallback to more general locales if the specified locale is not found.- Returns:
- the DataObjects or an empty map if no DataObjects are found.
-
getDataObject
Description copied from interface:RuntimeService
The DataObject. Searching for the DataObject is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no DataObject value is found with the given name or when the value is set to null.- Specified by:
getDataObject
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.dataObject
- name of DataObject, cannot be null.- Returns:
- the DataObject or null if the variable is undefined.
-
getDataObject
public DataObject getDataObject(String executionId, String dataObjectName, String locale, boolean withLocalizationFallback) Description copied from interface:RuntimeService
The DataObject. Searching for the DataObject is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no DataObject value is found with the given name or when the value is set to null.- Specified by:
getDataObject
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.dataObjectName
- name of DataObject, cannot be null.locale
- locale the DataObject name and description should be returned in (if available).withLocalizationFallback
- When true localization will fallback to more general locales including the default locale of the JVM if the specified locale is not found.- Returns:
- the DataObject or null if the DataObject is undefined.
-
getDataObjectLocal
Description copied from interface:RuntimeService
The DataObject for an execution. Returns the DataObject when it is set for the execution (and not searching parent scopes). Returns null when no DataObject is found with the given name.- Specified by:
getDataObjectLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.dataObjectName
- name of DataObject, cannot be null.- Returns:
- the DataObject or null if the DataObject is undefined.
-
getDataObjectLocal
public DataObject getDataObjectLocal(String executionId, String dataObjectName, String locale, boolean withLocalizationFallback) Description copied from interface:RuntimeService
The DataObject for an execution. Returns the DataObject when it is set for the execution (and not searching parent scopes). Returns null when no DataObject is found with the given name.- Specified by:
getDataObjectLocal
in interfaceRuntimeService
- Parameters:
executionId
- id of execution, cannot be null.dataObjectName
- name of DataObject, cannot be null.locale
- locale the DataObject name and description should be returned in (if available).withLocalizationFallback
- When true localization will fallback to more general locales if the specified locale is not found.- Returns:
- the DataObject or null if the DataObject is undefined.
-
signal
-
trigger
Description copied from interface:RuntimeService
Sends an external trigger to an activity instance that is waiting inside the given execution.- Specified by:
trigger
in interfaceRuntimeService
- Parameters:
executionId
- id of execution to signal, cannot be null.
-
triggerAsync
Description copied from interface:RuntimeService
Sends an external trigger to an activity instance that is waiting inside the given execution. The waiting execution is notified asynchronously.- Specified by:
triggerAsync
in interfaceRuntimeService
- Parameters:
executionId
- id of execution to signal, cannot be null.
-
signal
-
trigger
Description copied from interface:RuntimeService
Sends an external trigger to an activity instance that is waiting inside the given execution.- Specified by:
trigger
in interfaceRuntimeService
- Parameters:
executionId
- id of execution to signal, cannot be null.processVariables
- a map of process variables
-
triggerAsync
Description copied from interface:RuntimeService
Sends an external trigger to an activity instance that is waiting inside the given execution. The waiting execution is notified asynchronously.- Specified by:
triggerAsync
in interfaceRuntimeService
- Parameters:
executionId
- id of execution to signal, cannot be null.processVariables
- a map of process variables
-
trigger
public void trigger(String executionId, Map<String, Object> processVariables, Map<String, Object> transientVariables) Description copied from interface:RuntimeService
Similar toRuntimeService.trigger(String, Map)
, but with an extra parameter that allows to pass transient variables.- Specified by:
trigger
in interfaceRuntimeService
-
evaluateConditionalEvents
Description copied from interface:RuntimeService
Evaluate waiting conditional events (boundary, intermediate catch and event sub process start events) and trigger them if a condition evaluates to true.- Specified by:
evaluateConditionalEvents
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of process instance, cannot be null.
-
evaluateConditionalEvents
public void evaluateConditionalEvents(String processInstanceId, Map<String, Object> processVariables) Description copied from interface:RuntimeService
Evaluate waiting conditional events (boundary, intermediate catch and event sub process start events) and trigger them if a condition evaluates to true.- Specified by:
evaluateConditionalEvents
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of process instance, cannot be null.processVariables
- a map of process variables to be set before evaluation
-
setOwner
Description copied from interface:RuntimeService
Set the new owner of a process instance.- Specified by:
setOwner
in interfaceRuntimeService
- Parameters:
processInstanceId
- the id of the process to set its new owneruserId
- the id of the user to set as the new owner
-
removeOwner
Description copied from interface:RuntimeService
Removes the owner of a process instance.- Specified by:
removeOwner
in interfaceRuntimeService
- Parameters:
processInstanceId
- the id of the process to remove the owner from
-
setAssignee
Description copied from interface:RuntimeService
Set the new assignee of a process instance.- Specified by:
setAssignee
in interfaceRuntimeService
- Parameters:
processInstanceId
- the id of the process to set its new assigneeuserId
- the id of the user to set as the new assignee
-
removeAssignee
Description copied from interface:RuntimeService
Removes the assignee of a process instance.- Specified by:
removeAssignee
in interfaceRuntimeService
- Parameters:
processInstanceId
- the id of the process to remove the assignee from
-
addUserIdentityLink
Description copied from interface:RuntimeService
Involves a user with a process instance. The type of identity link is defined by the given identityLinkType.- Specified by:
addUserIdentityLink
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance, cannot be null.userId
- id of the user involve, cannot be null.identityLinkType
- type of identityLink, cannot be null (@seeIdentityLinkType
).
-
addGroupIdentityLink
Description copied from interface:RuntimeService
Involves a group with a process instance. The type of identityLink is defined by the given identityLink.- Specified by:
addGroupIdentityLink
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance, cannot be null.groupId
- id of the group to involve, cannot be null.identityLinkType
- type of identity, cannot be null (@seeIdentityLinkType
).
-
addParticipantUser
Description copied from interface:RuntimeService
Convenience shorthand forRuntimeService.addUserIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Specified by:
addParticipantUser
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance, cannot be null.userId
- id of the user to use as candidate, cannot be null.
-
addParticipantGroup
Description copied from interface:RuntimeService
Convenience shorthand forRuntimeService.addGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Specified by:
addParticipantGroup
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance, cannot be null.groupId
- id of the group to use as candidate, cannot be null.
-
deleteParticipantUser
Description copied from interface:RuntimeService
Convenience shorthand forRuntimeService.deleteUserIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Specified by:
deleteParticipantUser
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance, cannot be null.userId
- id of the user to use as candidate, cannot be null.
-
deleteParticipantGroup
Description copied from interface:RuntimeService
Convenience shorthand forRuntimeService.deleteGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Specified by:
deleteParticipantGroup
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance, cannot be null.groupId
- id of the group to use as candidate, cannot be null.
-
deleteUserIdentityLink
public void deleteUserIdentityLink(String processInstanceId, String userId, String identityLinkType) Description copied from interface:RuntimeService
Removes the association between a user and a process instance for the given identityLinkType.- Specified by:
deleteUserIdentityLink
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance, cannot be null.userId
- id of the user involve, cannot be null.identityLinkType
- type of identityLink, cannot be null (@seeIdentityLinkType
).
-
deleteGroupIdentityLink
public void deleteGroupIdentityLink(String processInstanceId, String groupId, String identityLinkType) Description copied from interface:RuntimeService
Removes the association between a group and a process instance for the given identityLinkType.- Specified by:
deleteGroupIdentityLink
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance, cannot be null.groupId
- id of the group to involve, cannot be null.identityLinkType
- type of identity, cannot be null (@seeIdentityLinkType
).
-
getIdentityLinksForProcessInstance
public List<org.flowable.identitylink.api.IdentityLink> getIdentityLinksForProcessInstance(String processInstanceId) Description copied from interface:RuntimeService
Retrieves theIdentityLink
s associated with the given process instance. Such anIdentityLink
informs how a certain user is involved with a process instance.- Specified by:
getIdentityLinksForProcessInstance
in interfaceRuntimeService
-
getEntityLinkChildrenForProcessInstance
public List<org.flowable.entitylink.api.EntityLink> getEntityLinkChildrenForProcessInstance(String processInstanceId) Description copied from interface:RuntimeService
Retrieves theEntityLink
s associated with the given process instance.- Specified by:
getEntityLinkChildrenForProcessInstance
in interfaceRuntimeService
-
getEntityLinkChildrenWithSameRootAsProcessInstance
public List<org.flowable.entitylink.api.EntityLink> getEntityLinkChildrenWithSameRootAsProcessInstance(String processInstanceId) Description copied from interface:RuntimeService
Retrieves all theEntityLink
s associated with the same root as the given process instance.- Specified by:
getEntityLinkChildrenWithSameRootAsProcessInstance
in interfaceRuntimeService
-
getEntityLinkChildrenForTask
Description copied from interface:RuntimeService
Retrieves theEntityLink
s associated with the given task.- Specified by:
getEntityLinkChildrenForTask
in interfaceRuntimeService
-
getEntityLinkParentsForProcessInstance
public List<org.flowable.entitylink.api.EntityLink> getEntityLinkParentsForProcessInstance(String processInstanceId) Description copied from interface:RuntimeService
Retrieves theEntityLink
s where the given process instance is referenced.- Specified by:
getEntityLinkParentsForProcessInstance
in interfaceRuntimeService
-
getEntityLinkParentsForTask
Description copied from interface:RuntimeService
Retrieves theEntityLink
s where the given task is referenced.- Specified by:
getEntityLinkParentsForTask
in interfaceRuntimeService
-
createProcessInstanceQuery
Description copied from interface:RuntimeService
Creates a newProcessInstanceQuery
instance, that can be used to query process instances.- Specified by:
createProcessInstanceQuery
in interfaceRuntimeService
-
createActivityInstanceQuery
Description copied from interface:RuntimeService
Creates a newActivityInstanceQuery
instance, that can be used to query activities in the currently running process instances.- Specified by:
createActivityInstanceQuery
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.- Specified by:
getActiveActivityIds
in interfaceRuntimeService
- Parameters:
executionId
- id of the execution, cannot be null.
-
getFormInstanceById
-
suspendProcessInstanceById
Description copied from interface:RuntimeService
Suspends the process instance with the given id.If a process instance is in state suspended, flowable will not execute jobs (timers, messages) associated with this instance.
If you have a process instance hierarchy, suspending one process instance form the hierarchy will not suspend other process instances form that hierarchy.
- Specified by:
suspendProcessInstanceById
in interfaceRuntimeService
-
activateProcessInstanceById
Description copied from interface:RuntimeService
Activates the process instance with the given id.If you have a process instance hierarchy, suspending one process instance form the hierarchy will not suspend other process instances form that hierarchy.
- Specified by:
activateProcessInstanceById
in interfaceRuntimeService
-
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,
FlowableException
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
-
startProcessInstanceByMessageAndTenantId
public ProcessInstance startProcessInstanceByMessageAndTenantId(String messageName, String tenantId) Description copied from interface:RuntimeService
Similar toRuntimeService.startProcessInstanceByMessage(String)
, but with tenant context.- Specified by:
startProcessInstanceByMessageAndTenantId
in interfaceRuntimeService
-
startProcessInstanceByMessage
Description copied from interface:RuntimeService
Signals the process engine that a message is received and starts a new
ProcessInstance
.See
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
-
startProcessInstanceByMessageAndTenantId
public ProcessInstance startProcessInstanceByMessageAndTenantId(String messageName, String businessKey, String tenantId) Description copied from interface:RuntimeService
Similar toRuntimeService.startProcessInstanceByMessage(String, String)
, but with tenant context.- Specified by:
startProcessInstanceByMessageAndTenantId
in interfaceRuntimeService
-
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
ProcessInstance
.See
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
-
startProcessInstanceByMessageAndTenantId
public ProcessInstance startProcessInstanceByMessageAndTenantId(String messageName, Map<String, Object> processVariables, String tenantId) Description copied from interface:RuntimeService
Similar toRuntimeService.startProcessInstanceByMessage(String, Map)
, but with tenant context.- Specified by:
startProcessInstanceByMessageAndTenantId
in interfaceRuntimeService
-
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
ProcessInstance
.See
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
-
startProcessInstanceByMessageAndTenantId
public ProcessInstance startProcessInstanceByMessageAndTenantId(String messageName, String businessKey, Map<String, Object> processVariables, String tenantId) Description copied from interface:RuntimeService
Similar toRuntimeService.startProcessInstanceByMessage(String, String, Map)
, but with tenant context.- Specified by:
startProcessInstanceByMessageAndTenantId
in interfaceRuntimeService
-
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 all executions waiting on the signal.
NOTE: The waiting executions are notified synchronously.- Specified by:
signalEventReceived
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal event
-
signalEventReceivedWithTenantId
Description copied from interface:RuntimeService
Similar toRuntimeService.signalEventReceived(String)
, but within the context of one tenant.- Specified by:
signalEventReceivedWithTenantId
in interfaceRuntimeService
-
signalEventReceivedAsync
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 all executions waiting on the signal.
- Specified by:
signalEventReceivedAsync
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal event
-
signalEventReceivedAsyncWithTenantId
Description copied from interface:RuntimeService
Similar toRuntimeService.signalEventReceivedAsync(String)
, but within the context of one tenant.- Specified by:
signalEventReceivedAsyncWithTenantId
in interfaceRuntimeService
-
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 all executions waiting on the signal.
NOTE: The waiting executions are notified synchronously.- Specified by:
signalEventReceived
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal eventprocessVariables
- a map of variables added to the execution(s)
-
signalEventReceivedWithTenantId
public void signalEventReceivedWithTenantId(String signalName, Map<String, Object> processVariables, String tenantId) Description copied from interface:RuntimeService
Similar toRuntimeService.signalEventReceived(String, Map)
, but within the context of one tenant.- Specified by:
signalEventReceivedWithTenantId
in interfaceRuntimeService
-
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.- Specified by:
signalEventReceived
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal eventexecutionId
- the id of 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.- Specified by:
signalEventReceived
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal eventexecutionId
- the id of the execution to deliver the signal toprocessVariables
- a map of variables added to the execution(s)
-
signalEventReceivedAsync
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 asynchronously.- Specified by:
signalEventReceivedAsync
in interfaceRuntimeService
- Parameters:
signalName
- the name of the signal eventexecutionId
- the id of the execution to deliver the signal to
-
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.
- Specified by:
messageEventReceived
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message eventexecutionId
- the id of 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.
Variables are set for the scope of the execution of the message event subscribed to the message name. For example:
- The scope for an intermediate message event in the main process is that of the process instance
- The scope for an intermediate message event in a subprocess is that of the subprocess
- The scope for a boundary message event is that of the execution for the Activity the event is attached to
VariableScope.setVariables(Map)
, applied separately to each variable.- Specified by:
messageEventReceived
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message eventexecutionId
- the id of the execution to deliver the message toprocessVariables
- a map of variables added to the execution- See Also:
-
VariableScope#setVariables(Map)
-
messageEventReceivedAsync
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 asynchronously.
- Specified by:
messageEventReceivedAsync
in interfaceRuntimeService
- Parameters:
messageName
- the name of the message eventexecutionId
- the id of the execution to deliver the message to
-
addEventListener
public void addEventListener(org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToAdd) Description copied from interface:RuntimeService
Adds an event-listener which will be notified of ALL events by the dispatcher.- Specified by:
addEventListener
in interfaceRuntimeService
- Parameters:
listenerToAdd
- the listener to add
-
addEventListener
public void addEventListener(org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToAdd, org.flowable.common.engine.api.delegate.event.FlowableEngineEventType... types) Description copied from interface:RuntimeService
Adds an event-listener which will only be notified when an event occurs, which type is in the given types.- Specified by:
addEventListener
in interfaceRuntimeService
- Parameters:
listenerToAdd
- the listener to addtypes
- types of events the listener should be notified for
-
removeEventListener
public void removeEventListener(org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToRemove) Description copied from interface:RuntimeService
Removes the given listener from this dispatcher. The listener will no longer be notified, regardless of the type(s) it was registered for in the first place.- Specified by:
removeEventListener
in interfaceRuntimeService
- Parameters:
listenerToRemove
- listener to remove
-
dispatchEvent
public void dispatchEvent(org.flowable.common.engine.api.delegate.event.FlowableEvent event) Description copied from interface:RuntimeService
Dispatches the given event to any listeners that are registered.- Specified by:
dispatchEvent
in interfaceRuntimeService
- Parameters:
event
- event to dispatch.
-
addEventRegistryConsumer
public void addEventRegistryConsumer(org.flowable.eventregistry.api.EventRegistryEventConsumer eventConsumer) - Specified by:
addEventRegistryConsumer
in interfaceRuntimeService
-
removeEventRegistryConsumer
public void removeEventRegistryConsumer(org.flowable.eventregistry.api.EventRegistryEventConsumer eventConsumer) - Specified by:
removeEventRegistryConsumer
in interfaceRuntimeService
-
createProcessInstanceStartEventSubscriptionBuilder
public ProcessInstanceStartEventSubscriptionBuilder createProcessInstanceStartEventSubscriptionBuilder()Description copied from interface:RuntimeService
Creates a new event subscription builder to register a subscription to start a new process instance based on an event with a particular set of correlation parameter values. In order for this to work, the process definition needs to have an event-registry based start event with a dynamic, manual subscription based behavior and the registered correlation parameter values within the builder need to be based on actual correlation parameter definitions within the event model the start event is based on. Register one or more correlation parameter value with in the builder before invoking theProcessInstanceStartEventSubscriptionBuilder.subscribe()
method to create and register the subscription.- Specified by:
createProcessInstanceStartEventSubscriptionBuilder
in interfaceRuntimeService
- Returns:
- the subscription builder
-
createProcessInstanceStartEventSubscriptionModificationBuilder
public ProcessInstanceStartEventSubscriptionModificationBuilder createProcessInstanceStartEventSubscriptionModificationBuilder()Description copied from interface:RuntimeService
Creates a new event subscription modification builder to modify one or more previously registered process start event subscriptions based on a particular process definition and with an optional combination of correlation parameter values.- Specified by:
createProcessInstanceStartEventSubscriptionModificationBuilder
in interfaceRuntimeService
- Returns:
- the subscription modification builder
-
createProcessInstanceStartEventSubscriptionDeletionBuilder
public ProcessInstanceStartEventSubscriptionDeletionBuilder createProcessInstanceStartEventSubscriptionDeletionBuilder()Description copied from interface:RuntimeService
Creates a new event subscription deletion builder delete one or more previously registered process start event subscriptions based on a particular process definition and with an optional combination of correlation parameter values.- Specified by:
createProcessInstanceStartEventSubscriptionDeletionBuilder
in interfaceRuntimeService
- Returns:
- the subscription deletion builder
-
setProcessInstanceName
Description copied from interface:RuntimeService
Sets the name for the process instance with the given id.- Specified by:
setProcessInstanceName
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance to updatename
- new name for the process instance
-
getProcessInstanceEvents
Description copied from interface:RuntimeService
The all events related to the given Process Instance.- Specified by:
getProcessInstanceEvents
in interfaceRuntimeService
-
getAdhocSubProcessExecutions
Description copied from interface:RuntimeService
Gets executions with an adhoc sub process as current flow element- Specified by:
getAdhocSubProcessExecutions
in interfaceRuntimeService
- Parameters:
processInstanceId
- id of the process instance that is used to search for child executions- Returns:
- a list of executions
-
getEnabledActivitiesFromAdhocSubProcess
public List<org.flowable.bpmn.model.FlowNode> getEnabledActivitiesFromAdhocSubProcess(String executionId) Description copied from interface:RuntimeService
Gets enabled activities from ad-hoc sub process- Specified by:
getEnabledActivitiesFromAdhocSubProcess
in interfaceRuntimeService
- Parameters:
executionId
- id of the execution that has an ad-hoc sub process as current flow element- Returns:
- a list of enabled activities
-
executeActivityInAdhocSubProcess
Description copied from interface:RuntimeService
Executes an activity in a ad-hoc sub process- Specified by:
executeActivityInAdhocSubProcess
in interfaceRuntimeService
- Parameters:
executionId
- id of the execution that has an ad-hoc sub process as current flow elementactivityId
- id of the activity id to enable- Returns:
- the newly created execution of the enabled activity
-
completeAdhocSubProcess
Description copied from interface:RuntimeService
Completes the ad-hoc sub process- Specified by:
completeAdhocSubProcess
in interfaceRuntimeService
- Parameters:
executionId
- id of the execution that has an ad-hoc sub process as current flow element
-
createProcessInstanceBuilder
Description copied from interface:RuntimeService
Create aProcessInstanceBuilder
, that allows to set various options for starting a process instance, as an alternative to the various startProcessInstanceByXX methods.- Specified by:
createProcessInstanceBuilder
in interfaceRuntimeService
-
createChangeActivityStateBuilder
Description copied from interface:RuntimeService
Create aChangeActivityStateBuilder
, that allows to set various options for changing the state of a process instance.- Specified by:
createChangeActivityStateBuilder
in interfaceRuntimeService
-
addMultiInstanceExecution
public Execution addMultiInstanceExecution(String activityId, String parentExecutionId, Map<String, Object> executionVariables) Description copied from interface:RuntimeService
Adds a new execution to a running multi-instance parent execution- Specified by:
addMultiInstanceExecution
in interfaceRuntimeService
- Parameters:
activityId
- id of the multi-instance activity (id attribute in the BPMN XML)parentExecutionId
- can be the process instance id, in case there's one multi-instance execution for the provided activity id. In case of multiple multi-instance executions with the same activity id this can be a specific parent execution id.executionVariables
- variables to be set on as local variable on the newly created multi-instance execution- Returns:
- the newly created multi-instance execution
-
deleteMultiInstanceExecution
Description copied from interface:RuntimeService
Deletes a multi-instance execution- Specified by:
deleteMultiInstanceExecution
in interfaceRuntimeService
- Parameters:
executionId
- id of the multi-instance execution to be deletedexecutionIsCompleted
- defines if the deleted execution should be marked as completed on the parent multi-instance execution
-
startProcessInstance
public ProcessInstance startProcessInstance(org.flowable.engine.impl.runtime.ProcessInstanceBuilderImpl processInstanceBuilder) -
startProcessInstanceAsync
public ProcessInstance startProcessInstanceAsync(org.flowable.engine.impl.runtime.ProcessInstanceBuilderImpl processInstanceBuilder) -
registerProcessInstanceStartEventSubscription
public org.flowable.eventsubscription.api.EventSubscription registerProcessInstanceStartEventSubscription(org.flowable.engine.impl.runtime.ProcessInstanceStartEventSubscriptionBuilderImpl builder) -
migrateProcessInstanceStartEventSubscriptionsToProcessDefinitionVersion
public void migrateProcessInstanceStartEventSubscriptionsToProcessDefinitionVersion(org.flowable.engine.impl.runtime.ProcessInstanceStartEventSubscriptionModificationBuilderImpl builder) -
deleteProcessInstanceStartEventSubscriptions
public void deleteProcessInstanceStartEventSubscriptions(org.flowable.engine.impl.runtime.ProcessInstanceStartEventSubscriptionDeletionBuilderImpl builder) -
changeActivityState
public void changeActivityState(org.flowable.engine.impl.runtime.ChangeActivityStateBuilderImpl changeActivityStateBuilder)
-