public class RuntimeServiceImpl extends ServiceImpl implements RuntimeService
commandExecutor, processEngineConfiguration
Constructor and Description |
---|
RuntimeServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
activateProcessInstanceById(String processInstanceId)
Activates the process instance with the given id.
|
void |
addEventListener(ActivitiEventListener listenerToAdd)
Adds an event-listener which will be notified of ALL events by the
dispatcher.
|
void |
addEventListener(ActivitiEventListener listenerToAdd,
ActivitiEventType... types)
Adds an event-listener which will only be notified when an event occurs,
which type is in the given types.
|
void |
addGroupIdentityLink(String processInstanceId,
String groupId,
String identityLinkType)
Involves a group with a process instance.
|
void |
addParticipantGroup(String processInstanceId,
String groupId)
Convenience shorthand for
RuntimeService.addGroupIdentityLink(String, String, String) ; with type IdentityLinkType.CANDIDATE |
void |
addParticipantUser(String processInstanceId,
String userId)
Convenience shorthand for
RuntimeService.addUserIdentityLink(String, String, String) ; with type IdentityLinkType.CANDIDATE |
void |
addUserIdentityLink(String processInstanceId,
String userId,
String identityLinkType)
Involves a user with a process instance.
|
ExecutionQuery |
createExecutionQuery()
Creates a new
ExecutionQuery instance, that can be used to query
the executions and process instances. |
NativeExecutionQuery |
createNativeExecutionQuery()
creates a new
NativeExecutionQuery to query Execution s by
SQL directly |
NativeProcessInstanceQuery |
createNativeProcessInstanceQuery()
creates a new
NativeProcessInstanceQuery to query
ProcessInstance s by SQL directly |
ProcessInstanceBuilder |
createProcessInstanceBuilder()
Create a ProcessInstanceBuilder
|
ProcessInstanceQuery |
createProcessInstanceQuery()
Creates a new
ProcessInstanceQuery instance, that can be used to
query process instances. |
void |
deleteGroupIdentityLink(String processInstanceId,
String groupId,
String identityLinkType)
Removes the association between a group and a process instance for the given identityLinkType.
|
void |
deleteParticipantGroup(String processInstanceId,
String groupId)
Convenience shorthand for
RuntimeService.deleteGroupIdentityLink(String, String, String) ; with type IdentityLinkType.CANDIDATE |
void |
deleteParticipantUser(String processInstanceId,
String userId)
Convenience shorthand for
RuntimeService.deleteUserIdentityLink(String, String, String) ; with type IdentityLinkType.CANDIDATE |
void |
deleteProcessInstance(String processInstanceId,
String deleteReason)
Delete an existing runtime process instance.
|
void |
deleteUserIdentityLink(String processInstanceId,
String userId,
String identityLinkType)
Removes the association between a user and a process instance for the given identityLinkType.
|
void |
dispatchEvent(ActivitiEvent event)
Dispatches the given event to any listeners that are registered.
|
List<String> |
getActiveActivityIds(String executionId)
Finds the activity ids for all executions that are waiting in activities.
|
FormData |
getFormInstanceById(String processDefinitionId) |
List<IdentityLink> |
getIdentityLinksForProcessInstance(String processInstanceId)
Retrieves the
IdentityLink s associated with the given process
instance. |
List<Event> |
getProcessInstanceEvents(String processInstanceId)
The all events related to the given Process Instance.
|
Object |
getVariable(String executionId,
String variableName)
The variable value.
|
<T> T |
getVariable(String executionId,
String variableName,
Class<T> variableClass)
The variable value.
|
VariableInstance |
getVariableInstance(String executionId,
String variableName)
The variable.
|
VariableInstance |
getVariableInstance(String executionId,
String variableName,
String locale,
boolean withLocalizationFallback)
The variable.
|
VariableInstance |
getVariableInstanceLocal(String executionId,
String variableName)
The variable for an execution.
|
VariableInstance |
getVariableInstanceLocal(String executionId,
String variableName,
String locale,
boolean withLocalizationFallback)
The variable for an execution.
|
Map<String,VariableInstance> |
getVariableInstances(String executionId)
All variables visible from the given execution scope (including parent scopes).
|
Map<String,VariableInstance> |
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).
|
Map<String,VariableInstance> |
getVariableInstances(String executionId,
Collection<String> variableNames,
String locale,
boolean withLocalizationFallback)
The variable values for all given variableNames, takes all variables into account which are visible from the given execution scope (including parent scopes).
|
Map<String,VariableInstance> |
getVariableInstances(String executionId,
String locale,
boolean withLocalizationFallback)
All variables visible from the given execution scope (including parent scopes).
|
Map<String,VariableInstance> |
getVariableInstancesLocal(String executionId)
All variable values that are defined in the execution scope, without taking outer scopes into account.
|
Map<String,VariableInstance> |
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.
|
Map<String,VariableInstance> |
getVariableInstancesLocal(String executionId,
Collection<String> variableNames,
String locale,
boolean withLocalizationFallback)
The variable values for the given variableNames only taking the given execution scope into account, not looking in outer scopes.
|
Map<String,VariableInstance> |
getVariableInstancesLocal(String executionId,
String locale,
boolean withLocalizationFallback)
All variable values that are defined in the execution scope, without taking outer scopes into account.
|
Object |
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.
|
Map<String,Object> |
getVariables(String executionId)
All variables visible from the given execution scope (including parent
scopes).
|
Map<String,Object> |
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).
|
Map<String,Object> |
getVariablesLocal(String executionId)
All variable values that are defined in the execution scope, without taking
outer scopes into account.
|
Map<String,Object> |
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 |
messageEventReceived(String messageName,
String executionId,
Map<String,Object> processVariables)
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 |
removeEventListener(ActivitiEventListener listenerToRemove)
Removes the given listener from this dispatcher.
|
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 |
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,? extends Object> variables)
Update or create given variables for an execution (including parent
scopes).
|
void |
setVariablesLocal(String executionId,
Map<String,? extends Object> variables)
Update or create given variables for an execution (not considering parent
scopes).
|
void |
signal(String executionId)
Sends an external trigger to an activity instance that is waiting inside
the given execution.
|
void |
signal(String executionId,
Map<String,Object> processVariables)
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,
Map<String,Object> processVariables)
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 |
signalEventReceived(String signalName,
String executionId,
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 to
RuntimeService.signalEventReceivedAsync(String) , but within the context of one tenant. |
void |
signalEventReceivedWithTenantId(String signalName,
Map<String,Object> processVariables,
String tenantId)
Similar to
#signalEventReceived(String, Map , but within the context of one tenant. |
void |
signalEventReceivedWithTenantId(String signalName,
String tenantId)
Similar to
RuntimeService.signalEventReceived(String) , but within the context of one tenant. |
ProcessInstance |
startProcessInstance(ProcessInstanceBuilderImpl processInstanceBuilder) |
ProcessInstance |
startProcessInstanceById(String processDefinitionId)
Starts a new process instance in the exactly specified version of the
process definition with the given id.
|
ProcessInstance |
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.
|
ProcessInstance |
startProcessInstanceById(String processDefinitionId,
String businessKey)
Starts a new process instance in the exactly specified version of the
process definition with the given id.
|
ProcessInstance |
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.
|
ProcessInstance |
startProcessInstanceByKey(String processDefinitionKey)
Starts a new process instance in the latest version of the process
definition with the given key.
|
ProcessInstance |
startProcessInstanceByKey(String processDefinitionKey,
Map<String,Object> variables)
Starts a new process instance in the latest version of the process
definition with the given key
|
ProcessInstance |
startProcessInstanceByKey(String processDefinitionKey,
String businessKey)
Starts a new process instance in the latest version of the process
definition with the given key.
|
ProcessInstance |
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.
|
ProcessInstance |
startProcessInstanceByKeyAndTenantId(String processDefinitionKey,
Map<String,Object> variables,
String tenantId)
Similar to
RuntimeService.startProcessInstanceByKey(String, Map) , but using a specific tenant identifier. |
ProcessInstance |
startProcessInstanceByKeyAndTenantId(String processDefinitionKey,
String tenantId)
Similar to
RuntimeService.startProcessInstanceByKey(String) , but using a specific tenant identifier. |
ProcessInstance |
startProcessInstanceByKeyAndTenantId(String processDefinitionKey,
String businessKey,
Map<String,Object> variables,
String tenantId)
Similar to
RuntimeService.startProcessInstanceByKey(String, String, Map) , but using a specific tenant identifier. |
ProcessInstance |
startProcessInstanceByKeyAndTenantId(String processDefinitionKey,
String businessKey,
String tenantId)
Similar to
RuntimeService.startProcessInstanceByKey(String, String) , but using a specific tenant identifier. |
ProcessInstance |
startProcessInstanceByMessage(String messageName)
Signals the process engine that a message is received and starts a new
ProcessInstance . |
ProcessInstance |
startProcessInstanceByMessage(String messageName,
Map<String,Object> processVariables)
Signals the process engine that a message is received and starts a new
ProcessInstance . |
ProcessInstance |
startProcessInstanceByMessage(String messageName,
String businessKey)
Signals the process engine that a message is received and starts a new
ProcessInstance . |
ProcessInstance |
startProcessInstanceByMessage(String messageName,
String businessKey,
Map<String,Object> processVariables)
Signals the process engine that a message is received and starts a new
ProcessInstance . |
ProcessInstance |
startProcessInstanceByMessageAndTenantId(String messageName,
Map<String,Object> processVariables,
String tenantId)
Similar to
RuntimeService#startProcessInstanceByMessage(String, Map , but with tenant context. |
ProcessInstance |
startProcessInstanceByMessageAndTenantId(String messageName,
String tenantId)
Similar to
RuntimeService.startProcessInstanceByMessage(String) , but with tenant context. |
ProcessInstance |
startProcessInstanceByMessageAndTenantId(String messageName,
String businessKey,
Map<String,Object> processVariables,
String tenantId)
Similar to
RuntimeService#startProcessInstanceByMessage(String, String, Map , but with tenant context. |
ProcessInstance |
startProcessInstanceByMessageAndTenantId(String messageName,
String businessKey,
String tenantId)
Similar to
RuntimeService.startProcessInstanceByMessage(String, String) , but with tenant context. |
void |
suspendProcessInstanceById(String processInstanceId)
Suspends the process instance with the given id.
|
void |
updateBusinessKey(String processInstanceId,
String businessKey)
Updates the business key for the provided process instance
|
getCommandExecutor, setCommandExecutor
public ProcessInstance startProcessInstanceByKey(String processDefinitionKey)
RuntimeService
startProcessInstanceByKey
in interface RuntimeService
processDefinitionKey
- key of process definition, cannot be null.public ProcessInstance startProcessInstanceByKey(String processDefinitionKey, String businessKey)
RuntimeService
ProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing
such a business key is definitely a best practice.startProcessInstanceByKey
in interface RuntimeService
processDefinitionKey
- key of process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context
or the given process definition.public ProcessInstance startProcessInstanceByKey(String processDefinitionKey, Map<String,Object> variables)
RuntimeService
startProcessInstanceByKey
in interface RuntimeService
processDefinitionKey
- key of process definition, cannot be null.variables
- the variables to pass, can be null.public ProcessInstance startProcessInstanceByKey(String processDefinitionKey, String businessKey, Map<String,Object> variables)
RuntimeService
ProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing
such a business key is definitely a best practice.
The combination of processdefinitionKey-businessKey must be unique.startProcessInstanceByKey
in interface RuntimeService
processDefinitionKey
- key of process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context
or the given process definition.variables
- the variables to pass, can be null.public ProcessInstance startProcessInstanceByKeyAndTenantId(String processDefinitionKey, String tenantId)
RuntimeService
RuntimeService.startProcessInstanceByKey(String)
, but using a specific tenant identifier.startProcessInstanceByKeyAndTenantId
in interface RuntimeService
public ProcessInstance startProcessInstanceByKeyAndTenantId(String processDefinitionKey, String businessKey, String tenantId)
RuntimeService
RuntimeService.startProcessInstanceByKey(String, String)
, but using a specific tenant identifier.startProcessInstanceByKeyAndTenantId
in interface RuntimeService
public ProcessInstance startProcessInstanceByKeyAndTenantId(String processDefinitionKey, Map<String,Object> variables, String tenantId)
RuntimeService
RuntimeService.startProcessInstanceByKey(String, Map)
, but using a specific tenant identifier.startProcessInstanceByKeyAndTenantId
in interface RuntimeService
public ProcessInstance startProcessInstanceByKeyAndTenantId(String processDefinitionKey, String businessKey, Map<String,Object> variables, String tenantId)
RuntimeService
RuntimeService.startProcessInstanceByKey(String, String, Map)
, but using a specific tenant identifier.startProcessInstanceByKeyAndTenantId
in interface RuntimeService
public ProcessInstance startProcessInstanceById(String processDefinitionId)
RuntimeService
startProcessInstanceById
in interface RuntimeService
processDefinitionId
- the id of the process definition, cannot be null.public ProcessInstance startProcessInstanceById(String processDefinitionId, String businessKey)
RuntimeService
ProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing
such a business key is definitely a best practice.startProcessInstanceById
in interface RuntimeService
processDefinitionId
- the id of the process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context
or the given process definition.public ProcessInstance startProcessInstanceById(String processDefinitionId, Map<String,Object> variables)
RuntimeService
startProcessInstanceById
in interface RuntimeService
processDefinitionId
- the id of the process definition, cannot be null.variables
- variables to be passed, can be nullpublic ProcessInstance startProcessInstanceById(String processDefinitionId, String businessKey, Map<String,Object> variables)
RuntimeService
ProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing
such a business key is definitely a best practice.startProcessInstanceById
in interface RuntimeService
processDefinitionId
- the id of the process definition, cannot be null.variables
- variables to be passed, can be nullpublic void deleteProcessInstance(String processInstanceId, String deleteReason)
RuntimeService
deleteProcessInstance
in interface RuntimeService
processInstanceId
- id of process instance to delete, cannot be null.deleteReason
- reason for deleting, can be null.public ExecutionQuery createExecutionQuery()
RuntimeService
ExecutionQuery
instance, that can be used to query
the executions and process instances.createExecutionQuery
in interface RuntimeService
public NativeExecutionQuery createNativeExecutionQuery()
RuntimeService
NativeExecutionQuery
to query Execution
s by
SQL directlycreateNativeExecutionQuery
in interface RuntimeService
public NativeProcessInstanceQuery createNativeProcessInstanceQuery()
RuntimeService
NativeProcessInstanceQuery
to query
ProcessInstance
s by SQL directlycreateNativeProcessInstanceQuery
in interface RuntimeService
public void updateBusinessKey(String processInstanceId, String businessKey)
RuntimeService
updateBusinessKey
in interface RuntimeService
processInstanceId
- id of the process instance to set the business key, cannot be nullbusinessKey
- new businessKey valuepublic Map<String,Object> getVariables(String executionId)
RuntimeService
getVariables
in interface RuntimeService
executionId
- id of execution, cannot be null.public Map<String,VariableInstance> getVariableInstances(String executionId)
RuntimeService
getVariableInstances
in interface RuntimeService
executionId
- id of execution, cannot be null.public Map<String,VariableInstance> getVariableInstances(String executionId, String locale, boolean withLocalizationFallback)
RuntimeService
getVariableInstances
in interface RuntimeService
executionId
- id of execution, cannot be null.locale
- locale the variable 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.public Map<String,Object> getVariablesLocal(String executionId)
RuntimeService
RuntimeService.getVariablesLocal(String, Collection)
for better performance.getVariablesLocal
in interface RuntimeService
executionId
- id of execution, cannot be null.public Map<String,VariableInstance> getVariableInstancesLocal(String executionId)
RuntimeService
RuntimeService.getVariableInstancesLocal(String, Collection)
for better performance.getVariableInstancesLocal
in interface RuntimeService
executionId
- id of execution, cannot be null.public Map<String,VariableInstance> getVariableInstancesLocal(String executionId, String locale, boolean withLocalizationFallback)
RuntimeService
RuntimeService.getVariableInstancesLocal(String, Collection)
for better performance.getVariableInstancesLocal
in interface RuntimeService
executionId
- id of execution, cannot be null.locale
- locale the variable 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.public Map<String,Object> getVariables(String executionId, Collection<String> variableNames)
RuntimeService
getVariables
in interface RuntimeService
executionId
- id of execution, cannot be null.variableNames
- the collection of variable names that should be retrieved.public Map<String,VariableInstance> getVariableInstances(String executionId, Collection<String> variableNames)
RuntimeService
getVariableInstances
in interface RuntimeService
executionId
- id of execution, cannot be null.variableNames
- the collection of variable names that should be retrieved.public Map<String,VariableInstance> getVariableInstances(String executionId, Collection<String> variableNames, String locale, boolean withLocalizationFallback)
RuntimeService
getVariableInstances
in interface RuntimeService
executionId
- id of execution, cannot be null.variableNames
- the collection of variable names that should be retrieved.locale
- locale the variable 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.public Map<String,Object> getVariablesLocal(String executionId, Collection<String> variableNames)
RuntimeService
getVariablesLocal
in interface RuntimeService
executionId
- id of execution, cannot be null.variableNames
- the collection of variable names that should be retrieved.public Map<String,VariableInstance> getVariableInstancesLocal(String executionId, Collection<String> variableNames)
RuntimeService
getVariableInstancesLocal
in interface RuntimeService
executionId
- id of execution, cannot be null.variableNames
- the collection of variable names that should be retrieved.public Map<String,VariableInstance> getVariableInstancesLocal(String executionId, Collection<String> variableNames, String locale, boolean withLocalizationFallback)
RuntimeService
getVariableInstancesLocal
in interface RuntimeService
executionId
- id of execution, cannot be null.variableNames
- the collection of variable names that should be retrieved.locale
- locale the variable 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.public Object getVariable(String executionId, String variableName)
RuntimeService
getVariable
in interface RuntimeService
executionId
- id of execution, cannot be null.variableName
- name of variable, cannot be null.public VariableInstance getVariableInstance(String executionId, String variableName)
RuntimeService
getVariableInstance
in interface RuntimeService
executionId
- id of execution, cannot be null.variableName
- name of variable, cannot be null.public VariableInstance getVariableInstance(String executionId, String variableName, String locale, boolean withLocalizationFallback)
RuntimeService
getVariableInstance
in interface RuntimeService
executionId
- id of execution, cannot be null.variableName
- name of variable, cannot be null.locale
- locale the variable 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.public <T> T getVariable(String executionId, String variableName, Class<T> variableClass)
RuntimeService
getVariable
in interface RuntimeService
executionId
- id of execution, cannot be null.variableName
- name of variable, cannot be null.variableClass
- name of variable, cannot be null.public boolean hasVariable(String executionId, String variableName)
RuntimeService
hasVariable
in interface RuntimeService
public Object getVariableLocal(String executionId, String variableName)
RuntimeService
getVariableLocal
in interface RuntimeService
public VariableInstance getVariableInstanceLocal(String executionId, String variableName)
RuntimeService
getVariableInstanceLocal
in interface RuntimeService
executionId
- id of execution, cannot be null.variableName
- name of variable, cannot be null.public VariableInstance getVariableInstanceLocal(String executionId, String variableName, String locale, boolean withLocalizationFallback)
RuntimeService
getVariableInstanceLocal
in interface RuntimeService
executionId
- id of execution, cannot be null.variableName
- name of variable, cannot be null.locale
- locale the variable 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.public <T> T getVariableLocal(String executionId, String variableName, Class<T> variableClass)
RuntimeService
getVariableLocal
in interface RuntimeService
public boolean hasVariableLocal(String executionId, String variableName)
RuntimeService
hasVariableLocal
in interface RuntimeService
public void setVariable(String executionId, String variableName, Object value)
RuntimeService
The variable is set according to the algorithm as documented for
VariableScope.setVariable(String, Object)
.
setVariable
in interface RuntimeService
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.{@link VariableScope#setVariable(String, Object)}
public void setVariableLocal(String executionId, String variableName, Object value)
RuntimeService
setVariableLocal
in interface RuntimeService
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.public void setVariables(String executionId, Map<String,? extends Object> variables)
RuntimeService
Variables are set according to the algorithm as documented for
VariableScope.setVariables(Map)
, applied separately to each
variable.
setVariables
in interface RuntimeService
executionId
- id of the execution, cannot be null.variables
- map containing name (key) and value of variables, can be null.{@link VariableScope#setVariables(Map)}
public void setVariablesLocal(String executionId, Map<String,? extends Object> variables)
RuntimeService
setVariablesLocal
in interface RuntimeService
executionId
- id of the execution, cannot be null.variables
- map containing name (key) and value of variables, can be null.public void removeVariable(String executionId, String variableName)
RuntimeService
removeVariable
in interface RuntimeService
executionId
- id of execution to remove variable in.variableName
- name of variable to remove.public void removeVariableLocal(String executionId, String variableName)
RuntimeService
removeVariableLocal
in interface RuntimeService
executionId
- id of execution to remove variable in.variableName
- name of variable to remove.public void removeVariables(String executionId, Collection<String> variableNames)
RuntimeService
removeVariables
in interface RuntimeService
executionId
- id of execution to remove variable in.variableNames
- collection containing name of variables to remove.public void removeVariablesLocal(String executionId, Collection<String> variableNames)
RuntimeService
removeVariablesLocal
in interface RuntimeService
executionId
- id of execution to remove variable in.variableNames
- collection containing name of variables to remove.public void signal(String executionId)
RuntimeService
signal
in interface RuntimeService
executionId
- id of execution to signal, cannot be null.public void signal(String executionId, Map<String,Object> processVariables)
RuntimeService
signal
in interface RuntimeService
executionId
- id of execution to signal, cannot be null.processVariables
- a map of process variablespublic void addUserIdentityLink(String processInstanceId, String userId, String identityLinkType)
RuntimeService
addUserIdentityLink
in interface RuntimeService
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 (@see
IdentityLinkType
).public void addGroupIdentityLink(String processInstanceId, String groupId, String identityLinkType)
RuntimeService
addGroupIdentityLink
in interface RuntimeService
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 (@see IdentityLinkType
).public void addParticipantUser(String processInstanceId, String userId)
RuntimeService
RuntimeService.addUserIdentityLink(String, String, String)
; with type IdentityLinkType.CANDIDATE
addParticipantUser
in interface RuntimeService
processInstanceId
- id of the process instance, cannot be null.userId
- id of the user to use as candidate, cannot be null.public void addParticipantGroup(String processInstanceId, String groupId)
RuntimeService
RuntimeService.addGroupIdentityLink(String, String, String)
; with type IdentityLinkType.CANDIDATE
addParticipantGroup
in interface RuntimeService
processInstanceId
- id of the process instance, cannot be null.groupId
- id of the group to use as candidate, cannot be null.public void deleteParticipantUser(String processInstanceId, String userId)
RuntimeService
RuntimeService.deleteUserIdentityLink(String, String, String)
; with type IdentityLinkType.CANDIDATE
deleteParticipantUser
in interface RuntimeService
processInstanceId
- id of the process instance, cannot be null.userId
- id of the user to use as candidate, cannot be null.public void deleteParticipantGroup(String processInstanceId, String groupId)
RuntimeService
RuntimeService.deleteGroupIdentityLink(String, String, String)
; with type IdentityLinkType.CANDIDATE
deleteParticipantGroup
in interface RuntimeService
processInstanceId
- id of the process instance, cannot be null.groupId
- id of the group to use as candidate, cannot be null.public void deleteUserIdentityLink(String processInstanceId, String userId, String identityLinkType)
RuntimeService
deleteUserIdentityLink
in interface RuntimeService
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 (@see IdentityLinkType
).public void deleteGroupIdentityLink(String processInstanceId, String groupId, String identityLinkType)
RuntimeService
deleteGroupIdentityLink
in interface RuntimeService
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 (@see IdentityLinkType
).public List<IdentityLink> getIdentityLinksForProcessInstance(String processInstanceId)
RuntimeService
IdentityLink
s associated with the given process
instance. Such an IdentityLink
informs how a certain user is
involved with a process instance.getIdentityLinksForProcessInstance
in interface RuntimeService
public ProcessInstanceQuery createProcessInstanceQuery()
RuntimeService
ProcessInstanceQuery
instance, that can be used to
query process instances.createProcessInstanceQuery
in interface RuntimeService
public List<String> getActiveActivityIds(String executionId)
RuntimeService
getActiveActivityIds
in interface RuntimeService
executionId
- id of the execution, cannot be null.public void suspendProcessInstanceById(String processInstanceId)
RuntimeService
suspendProcessInstanceById
in interface RuntimeService
public void activateProcessInstanceById(String processInstanceId)
RuntimeService
activateProcessInstanceById
in interface RuntimeService
public ProcessInstance startProcessInstanceByMessage(String messageName)
RuntimeService
Signals the process engine that a message is received and starts a new
ProcessInstance
.
Calling this method can have two different outcomes:
ActivitiException
is thrownstartProcessInstanceByMessage
in interface RuntimeService
messageName
- the 'name' of the message as specified as an attribute on the
bpmn20 <message name="messageName" />
element.ProcessInstance
object representing the started process
instancepublic ProcessInstance startProcessInstanceByMessageAndTenantId(String messageName, String tenantId)
RuntimeService
RuntimeService.startProcessInstanceByMessage(String)
, but with tenant context.startProcessInstanceByMessageAndTenantId
in interface RuntimeService
public ProcessInstance startProcessInstanceByMessage(String messageName, String businessKey)
RuntimeService
Signals the process engine that a message is received and starts a new
ProcessInstance
.
RuntimeService.startProcessInstanceByMessage(String, Map)
. This method allows
specifying a business key.startProcessInstanceByMessage
in interface RuntimeService
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 instancepublic ProcessInstance startProcessInstanceByMessageAndTenantId(String messageName, String businessKey, String tenantId)
RuntimeService
RuntimeService.startProcessInstanceByMessage(String, String)
, but with tenant context.startProcessInstanceByMessageAndTenantId
in interface RuntimeService
public ProcessInstance startProcessInstanceByMessage(String messageName, Map<String,Object> processVariables)
RuntimeService
Signals the process engine that a message is received and starts a new
ProcessInstance
.
RuntimeService.startProcessInstanceByMessage(String)
. In addition, this
method allows specifying a the payload of the message as a map of process
variables.startProcessInstanceByMessage
in interface RuntimeService
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.ProcessInstance
object representing the started process
instancepublic ProcessInstance startProcessInstanceByMessageAndTenantId(String messageName, Map<String,Object> processVariables, String tenantId)
RuntimeService
RuntimeService#startProcessInstanceByMessage(String, Map)
, but with tenant context.startProcessInstanceByMessageAndTenantId
in interface RuntimeService
public ProcessInstance startProcessInstanceByMessage(String messageName, String businessKey, Map<String,Object> processVariables)
RuntimeService
Signals the process engine that a message is received and starts a new
ProcessInstance
.
RuntimeService.startProcessInstanceByMessage(String, Map)
. In addition, this
method allows specifying a business key.startProcessInstanceByMessage
in interface RuntimeService
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.ProcessInstance
object representing the started process
instancepublic ProcessInstance startProcessInstanceByMessageAndTenantId(String messageName, String businessKey, Map<String,Object> processVariables, String tenantId)
RuntimeService
RuntimeService#startProcessInstanceByMessage(String, String, Map)
, but with tenant context.startProcessInstanceByMessageAndTenantId
in interface RuntimeService
public void signalEventReceived(String signalName)
RuntimeService
signalEventReceived
in interface RuntimeService
signalName
- the name of the signal eventpublic void signalEventReceivedWithTenantId(String signalName, String tenantId)
RuntimeService
RuntimeService.signalEventReceived(String)
, but within the context of one tenant.signalEventReceivedWithTenantId
in interface RuntimeService
public void signalEventReceivedAsync(String signalName)
RuntimeService
signalEventReceivedAsync
in interface RuntimeService
signalName
- the name of the signal eventpublic void signalEventReceivedAsyncWithTenantId(String signalName, String tenantId)
RuntimeService
RuntimeService.signalEventReceivedAsync(String)
, but within the context of one tenant.signalEventReceivedAsyncWithTenantId
in interface RuntimeService
public void signalEventReceived(String signalName, Map<String,Object> processVariables)
RuntimeService
signalEventReceived
in interface RuntimeService
signalName
- the name of the signal eventprocessVariables
- a map of variables added to the execution(s)public void signalEventReceivedWithTenantId(String signalName, Map<String,Object> processVariables, String tenantId)
RuntimeService
#signalEventReceived(String, Map)
, but within the context of one tenant.signalEventReceivedWithTenantId
in interface RuntimeService
public void signalEventReceived(String signalName, String executionId)
RuntimeService
signalEventReceived
in interface RuntimeService
signalName
- the name of the signal eventexecutionId
- the id of the execution to deliver the signal topublic void signalEventReceived(String signalName, String executionId, Map<String,Object> processVariables)
RuntimeService
signalEventReceived
in interface RuntimeService
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)public void signalEventReceivedAsync(String signalName, String executionId)
RuntimeService
signalEventReceivedAsync
in interface RuntimeService
signalName
- the name of the signal eventexecutionId
- the id of the execution to deliver the signal topublic void messageEventReceived(String messageName, String executionId)
RuntimeService
messageEventReceived
in interface RuntimeService
messageName
- the name of the message eventexecutionId
- the id of the execution to deliver the message topublic void messageEventReceived(String messageName, String executionId, Map<String,Object> processVariables)
RuntimeService
Variables are set for the scope of the execution of the message event subscribed to the message name. For example:
Variables are set according to the algorithm as documented for
VariableScope.setVariables(Map)
, applied separately to each
variable.
messageEventReceived
in interface RuntimeService
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{@link VariableScope#setVariables(Map)}
public void messageEventReceivedAsync(String messageName, String executionId)
RuntimeService
messageEventReceivedAsync
in interface RuntimeService
messageName
- the name of the message eventexecutionId
- the id of the execution to deliver the message topublic void addEventListener(ActivitiEventListener listenerToAdd)
RuntimeService
addEventListener
in interface RuntimeService
listenerToAdd
- the listener to addpublic void addEventListener(ActivitiEventListener listenerToAdd, ActivitiEventType... types)
RuntimeService
addEventListener
in interface RuntimeService
listenerToAdd
- the listener to addtypes
- types of events the listener should be notified forpublic void removeEventListener(ActivitiEventListener listenerToRemove)
RuntimeService
removeEventListener
in interface RuntimeService
listenerToRemove
- listener to removepublic void dispatchEvent(ActivitiEvent event)
RuntimeService
dispatchEvent
in interface RuntimeService
event
- event to dispatch.public void setProcessInstanceName(String processInstanceId, String name)
RuntimeService
setProcessInstanceName
in interface RuntimeService
processInstanceId
- id of the process instance to updatename
- new name for the process instancepublic List<Event> getProcessInstanceEvents(String processInstanceId)
RuntimeService
getProcessInstanceEvents
in interface RuntimeService
public ProcessInstanceBuilder createProcessInstanceBuilder()
RuntimeService
createProcessInstanceBuilder
in interface RuntimeService
public ProcessInstance startProcessInstance(ProcessInstanceBuilderImpl processInstanceBuilder)
Copyright © 2016 Alfresco. All rights reserved.