public class RuntimeServiceImpl extends ServiceImpl implements RuntimeService
commandExecutor| Constructor and Description |
|---|
RuntimeServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
activateProcessInstanceById(String processInstanceId)
Activates the process instance with the given id.
|
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 Executions
by SQL directly |
NativeProcessInstanceQuery |
createNativeProcessInstanceQuery()
creates a new
NativeProcessInstanceQuery to query ProcessInstances
by SQL directly |
ProcessInstanceQuery |
createProcessInstanceQuery()
Creates a new
ProcessInstanceQuery instance, that can be used
to query process instances. |
void |
deleteProcessInstance(String processInstanceId,
String deleteReason)
Delete an existing runtime process instance.
|
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
IdentityLinks associated with the given process instance. |
Object |
getVariable(String executionId,
String variableName)
The variable value.
|
Object |
getVariableLocal(String executionId,
String variableName)
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 |
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 |
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.
|
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 |
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. |
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, setCommandExecutorpublic ProcessInstance startProcessInstanceByKey(String processDefinitionKey)
RuntimeServicestartProcessInstanceByKey in interface RuntimeServiceprocessDefinitionKey - key of process definition, cannot be null.public ProcessInstance startProcessInstanceByKey(String processDefinitionKey, String businessKey)
RuntimeServiceProcessInstanceQuery.processInstanceBusinessKey(String). Providing such a business
key is definitely a best practice.
Note that a business key MUST be unique for the given process definition.
Process instance from different process definition are allowed to have the
same business key.
The combination of processdefinitionKey-businessKey must be unique.startProcessInstanceByKey in interface RuntimeServiceprocessDefinitionKey - 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)
RuntimeServicestartProcessInstanceByKey in interface RuntimeServiceprocessDefinitionKey - 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)
RuntimeServiceProcessInstanceQuery.processInstanceBusinessKey(String). Providing such a business
key is definitely a best practice.
Note that a business key MUST be unique for the given process definition.
Process instance from different process definition are allowed to have the
same business key.
The combination of processdefinitionKey-businessKey must be unique.startProcessInstanceByKey in interface RuntimeServiceprocessDefinitionKey - 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 startProcessInstanceById(String processDefinitionId)
RuntimeServicestartProcessInstanceById in interface RuntimeServiceprocessDefinitionId - the id of the process definition, cannot be null.public ProcessInstance startProcessInstanceById(String processDefinitionId, String businessKey)
RuntimeServiceProcessInstanceQuery.processInstanceBusinessKey(String). Providing such a business
key is definitely a best practice.
Note that a business key MUST be unique for the given process definition.
Process instance from different process definition are allowed to have the
same business key.startProcessInstanceById in interface RuntimeServiceprocessDefinitionId - 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)
RuntimeServicestartProcessInstanceById in interface RuntimeServiceprocessDefinitionId - 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)
RuntimeServiceProcessInstanceQuery.processInstanceBusinessKey(String). Providing such a business
key is definitely a best practice.
Note that a business key MUST be unique for the given process definition.
Process instance from different process definition are allowed to have the
same business key.startProcessInstanceById in interface RuntimeServiceprocessDefinitionId - the id of the process definition, cannot be null.variables - variables to be passed, can be nullpublic void deleteProcessInstance(String processInstanceId, String deleteReason)
RuntimeServicedeleteProcessInstance in interface RuntimeServiceprocessInstanceId - id of process instance to delete, cannot be null.deleteReason - reason for deleting, can be null.public ExecutionQuery createExecutionQuery()
RuntimeServiceExecutionQuery instance,
that can be used to query the executions and process instances.createExecutionQuery in interface RuntimeServicepublic NativeExecutionQuery createNativeExecutionQuery()
RuntimeServiceNativeExecutionQuery to query Executions
by SQL directlycreateNativeExecutionQuery in interface RuntimeServicepublic NativeProcessInstanceQuery createNativeProcessInstanceQuery()
RuntimeServiceNativeProcessInstanceQuery to query ProcessInstances
by SQL directlycreateNativeProcessInstanceQuery in interface RuntimeServicepublic void updateBusinessKey(String processInstanceId, String businessKey)
RuntimeServiceupdateBusinessKey in interface RuntimeServiceprocessInstanceId - id of the process instance to set the business key, cannot be nullbusinessKey - new businessKey valuepublic Map<String,Object> getVariables(String executionId)
RuntimeServicegetVariables in interface RuntimeServiceexecutionId - id of execution, cannot be null.public Map<String,Object> getVariablesLocal(String executionId)
RuntimeServiceRuntimeService.getVariablesLocal(String, Collection)
for better performance.getVariablesLocal in interface RuntimeServiceexecutionId - id of execution, cannot be null.public Map<String,Object> getVariables(String executionId, Collection<String> variableNames)
RuntimeServicegetVariables in interface RuntimeServiceexecutionId - id of execution, cannot be null.variableNames - the collection of variable names that should be retrieved.public Map<String,Object> getVariablesLocal(String executionId, Collection<String> variableNames)
RuntimeServicegetVariablesLocal in interface RuntimeServiceexecutionId - id of execution, cannot be null.variableNames - the collection of variable names that should be retrieved.public Object getVariable(String executionId, String variableName)
RuntimeServicegetVariable in interface RuntimeServiceexecutionId - id of execution, cannot be null.variableName - name of variable, cannot be null.public boolean hasVariable(String executionId, String variableName)
RuntimeServicehasVariable in interface RuntimeServicepublic Object getVariableLocal(String executionId, String variableName)
RuntimeServicegetVariableLocal in interface RuntimeServicepublic boolean hasVariableLocal(String executionId, String variableName)
RuntimeServicehasVariableLocal in interface RuntimeServicepublic void setVariable(String executionId, String variableName, Object value)
RuntimeServicesetVariable in interface RuntimeServiceexecutionId - 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 setVariableLocal(String executionId, String variableName, Object value)
RuntimeServicesetVariableLocal in interface RuntimeServiceexecutionId - 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)
RuntimeServicesetVariables in interface RuntimeServiceexecutionId - id of the execution, cannot be null.variables - map containing name (key) and value of variables, can be null.public void setVariablesLocal(String executionId, Map<String,? extends Object> variables)
RuntimeServicesetVariablesLocal in interface RuntimeServiceexecutionId - 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)
RuntimeServiceremoveVariable in interface RuntimeServiceexecutionId - id of execution to remove variable in.variableName - name of variable to remove.public void removeVariableLocal(String executionId, String variableName)
RuntimeServiceremoveVariableLocal in interface RuntimeServiceexecutionId - id of execution to remove variable in.variableName - name of variable to remove.public void removeVariables(String executionId, Collection<String> variableNames)
RuntimeServiceremoveVariables in interface RuntimeServiceexecutionId - id of execution to remove variable in.variableNames - collection containing name of variables to remove.public void removeVariablesLocal(String executionId, Collection<String> variableNames)
RuntimeServiceremoveVariablesLocal in interface RuntimeServiceexecutionId - id of execution to remove variable in.variableNames - collection containing name of variables to remove.public void signal(String executionId)
RuntimeServicesignal in interface RuntimeServiceexecutionId - id of execution to signal, cannot be null.public void signal(String executionId, Map<String,Object> processVariables)
RuntimeServicesignal in interface RuntimeServiceexecutionId - id of execution to signal, cannot be null.processVariables - a map of process variablespublic void addUserIdentityLink(String processInstanceId, String userId, String identityLinkType)
RuntimeServiceaddUserIdentityLink in interface RuntimeServiceprocessInstanceId - 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 List<IdentityLink> getIdentityLinksForProcessInstance(String processInstanceId)
RuntimeServiceIdentityLinks associated with the given process instance.
Such an IdentityLink informs how a certain user is involved with a process instance.getIdentityLinksForProcessInstance in interface RuntimeServicepublic ProcessInstanceQuery createProcessInstanceQuery()
RuntimeServiceProcessInstanceQuery instance, that can be used
to query process instances.createProcessInstanceQuery in interface RuntimeServicepublic List<String> getActiveActivityIds(String executionId)
RuntimeServicegetActiveActivityIds in interface RuntimeServiceexecutionId - id of the execution, cannot be null.public void suspendProcessInstanceById(String processInstanceId)
RuntimeServicesuspendProcessInstanceById in interface RuntimeServicepublic void activateProcessInstanceById(String processInstanceId)
RuntimeServiceactivateProcessInstanceById in interface RuntimeServicepublic ProcessInstance startProcessInstanceByMessage(String messageName)
RuntimeServiceSignals 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 RuntimeServicemessageName - 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 startProcessInstanceByMessage(String messageName, String businessKey)
RuntimeServiceSignals 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 RuntimeServicemessageName - 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 startProcessInstanceByMessage(String messageName, Map<String,Object> processVariables)
RuntimeServiceSignals 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 RuntimeServicemessageName - 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 startProcessInstanceByMessage(String messageName, String businessKey, Map<String,Object> processVariables)
RuntimeServiceSignals 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 RuntimeServicemessageName - 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 void signalEventReceived(String signalName)
RuntimeServicesignalEventReceived in interface RuntimeServicesignalName - the name of the signal eventpublic void signalEventReceivedAsync(String signalName)
RuntimeServicesignalEventReceivedAsync in interface RuntimeServicesignalName - the name of the signal eventpublic void signalEventReceived(String signalName, Map<String,Object> processVariables)
RuntimeServicesignalEventReceived in interface RuntimeServicesignalName - the name of the signal eventprocessVariables - a map of variables added to the execution(s)public void signalEventReceived(String signalName, String executionId)
RuntimeServicesignalEventReceived in interface RuntimeServicesignalName - 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)
RuntimeServicesignalEventReceived in interface RuntimeServicesignalName - 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)
RuntimeServicesignalEventReceivedAsync in interface RuntimeServicesignalName - the name of the signal eventexecutionId - the id of the execution to deliver the signal topublic void messageEventReceived(String messageName, String executionId)
RuntimeServicemessageEventReceived in interface RuntimeServicemessageName - 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)
RuntimeServicemessageEventReceived in interface RuntimeServicemessageName - the name of the message eventexecutionId - the id of the execution to deliver the message toprocessVariables - a map of variables added to the executionpublic void messageEventReceivedAsync(String messageName, String executionId)
RuntimeServicemessageEventReceivedAsync in interface RuntimeServicemessageName - the name of the message eventexecutionId - the id of the execution to deliver the message toCopyright © 2013 Alfresco. All rights reserved.