Class WorkflowRunOperations
- java.lang.Object
-
- cronapi.workflow.WorkflowRunOperations
-
public class WorkflowRunOperations extends Object
-
-
Constructor Summary
Constructors Constructor Description WorkflowRunOperations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidactivateProcessInstanceById(String processInstanceId)Activates the process instance with the given id.static voidactivateProcessInstanceByProcessDefinitionId(String processDefinitionId)Activates the process instance with the given process definition id.static voidactivateProcessInstanceByProcessDefinitionKey(String processDefinitionKey)Activates the process instance with the given process definition key.static voidcorrelateMessage(String messageName, String businessKey, Map<String,Object> correlationKeys, Map<String,Object> processVariables)Correlates a message to an execution that is waiting for a matching message and can be correlated according to the given correlation keys.static org.camunda.bpm.engine.runtime.ConditionEvaluationBuildercreateConditionEvaluation()Define a complex condition evaluation using a fluent builder.static org.camunda.bpm.engine.runtime.EventSubscriptionQuerycreateEventSubscriptionQuery()Creates a newEventSubscriptionQueryinstance, that can be used to query event subscriptions.static org.camunda.bpm.engine.runtime.ExecutionQuerycreateExecutionQuery()Creates a newExecutionQueryinstance, that can be used to query the executions and process instances.static org.camunda.bpm.engine.runtime.IncidentcreateIncident(String incidentType, String executionId, String configuration, String message)Creates an incidentstatic org.camunda.bpm.engine.runtime.IncidentQuerycreateIncidentQuery()Creates a newIncidentQueryinstance, that can be used to query incidents.static org.camunda.bpm.engine.runtime.MessageCorrelationBuildercreateMessageCorrelation(String messageName)Define a complex message correlation using a fluent builder.static org.camunda.bpm.engine.migration.MigrationPlanBuildercreateMigrationPlan(String sourceProcessDefinitionId, String targetProcessDefinitionId)Creates a migration plan to migrate process instance between different process definitions.static org.camunda.bpm.engine.runtime.ModificationBuildercreateModification(String processDefinitionId)Creates a modification of multiple process instances in terms of activity cancellations and instantiations via a fluent builder.static org.camunda.bpm.engine.runtime.NativeExecutionQuerycreateNativeExecutionQuery()creates a newNativeExecutionQueryto queryExecutions by SQL directlystatic org.camunda.bpm.engine.runtime.NativeProcessInstanceQuerycreateNativeProcessInstanceQuery()creates a newNativeProcessInstanceQueryto queryProcessInstances by SQL directlystatic org.camunda.bpm.engine.runtime.ProcessInstantiationBuildercreateProcessInstanceById(String processDefinitionId)Returns a fluent builder to start a new process instance in the exactly specified version of the process definition with the given id.static org.camunda.bpm.engine.runtime.ProcessInstantiationBuildercreateProcessInstanceByKey(String processDefinitionKey)Returns a fluent builder to start a new process instance in the latest version of the process definition with the given key.static org.camunda.bpm.engine.runtime.ProcessInstanceModificationBuildercreateProcessInstanceModification(String processInstanceId)Define a modification of a process instance in terms of activity cancellations and instantiations via a fluent builder.static org.camunda.bpm.engine.runtime.ProcessInstanceQuerycreateProcessInstanceQuery()Creates a newProcessInstanceQueryinstance, that can be used to query process instances.static org.camunda.bpm.engine.runtime.SignalEventReceivedBuildercreateSignalEvent(String signalName)Notifies the process engine that a signal event has been received using a fluent builder.static org.camunda.bpm.engine.runtime.VariableInstanceQuerycreateVariableInstanceQuery()Creates a newVariableInstanceQueryinstance, that can be used to query variable instances.static voiddeleteProcessInstance(String processInstanceId, String deleteReason)Delete an existing runtime process instance.static voiddeleteProcessInstance(String processInstanceId, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings, boolean skipSubprocesses)Delete an existing runtime process instance.static voiddeleteProcessInstances(List<String> processInstanceIds, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipSubprocesses)Delete existing runtime process instances.static org.camunda.bpm.engine.batch.BatchdeleteProcessInstancesAsync(List<String> processInstanceIds, org.camunda.bpm.engine.runtime.ProcessInstanceQuery processInstanceQuery, String deleteReason, boolean skipCustomListeners, boolean skipSubprocesses)Delete an existing runtime process instances asynchronously using Batch operation.static List<String>getActiveActivityIds(String executionId)Finds the activity ids for all executions that are waiting in activities.static org.camunda.bpm.engine.runtime.ActivityInstancegetActivityInstance(String processInstanceId)Allows retrieving the activity instance tree for a given process instance.static ObjectgetVariable(String executionId, String variableName)The variable value.static ObjectgetVariableLocal(String executionId, String variableName)The variable value for an execution.static <T extends org.camunda.bpm.engine.variable.value.TypedValue>
TgetVariableLocalTyped(String executionId, String variableName, boolean deserializeValue)Returns aTypedValuefor the variable.static Map<String,Object>getVariables(String executionId)All variables visible from the given execution scope (including parent scopes).static 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).static Map<String,Object>getVariablesLocal(String executionId)All variable values that are defined in the execution scope, without taking outer scopes into account.static 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.static org.camunda.bpm.engine.variable.VariableMapgetVariablesLocalTyped(String executionId, boolean deserializeValues)All variable values that are defined in the execution scope, without taking outer scopes into account.static org.camunda.bpm.engine.variable.VariableMapgetVariablesLocalTyped(String executionId, Collection<String> variableNames, boolean deserializeValues)The variable values for the given variableNames only taking the given execution scope into account, not looking in outer scopes.static org.camunda.bpm.engine.variable.VariableMapgetVariablesTyped(String executionId, boolean deserializeValues)All variables visible from the given execution scope (including parent scopes).static org.camunda.bpm.engine.variable.VariableMapgetVariablesTyped(String executionId, Collection<String> variableNames, boolean deserializeValues)The variable values for all given variableNames, takes all variables into account which are visible from the given execution scope (including parent scopes).static <T extends org.camunda.bpm.engine.variable.value.TypedValue>
TgetVariableTyped(String executionId, String variableName, boolean deserializeValue)Returns aTypedValuefor the variable.static voidmessageEventReceived(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'.static org.camunda.bpm.engine.migration.MigrationPlanExecutionBuildernewMigration(org.camunda.bpm.engine.migration.MigrationPlan migrationPlan)Executes a migration plan for a given list of process instances.static voidremoveVariable(String executionId, String variableName)Removes a variable for an execution.static voidremoveVariableLocal(String executionId, String variableName)Removes a variable for an execution (not considering parent scopes).static voidremoveVariables(String executionId, Collection<String> variableNames)Removes variables for an execution.static voidremoveVariablesLocal(String executionId, Collection<String> variableNames)Remove variables for an execution (not considering parent scopes).static voidresolveIncident(String incidentId)Resolves and remove an incidentstatic org.camunda.bpm.engine.runtime.RestartProcessInstanceBuilderrestartProcessInstances(String processDefinitionId)Restarts process instances that are completed or deleted with the initial or last set of variables.static voidsetVariable(String executionId, String variableName, Object value)Update or create a variable for an execution.static voidsetVariableLocal(String executionId, String variableName, Object value)Update or create a variable for an execution (not considering parent scopes).static voidsetVariables(String executionId, Map<String,?> variables)Update or create given variables for an execution (including parent scopes).static voidsetVariablesLocal(String executionId, Map<String,?> variables)Update or create given variables for an execution (not considering parent scopes).static voidsignal(String executionId, String signalName, Object signalData, Map<String,Object> processVariables)Sends an external trigger to an activity instance that is waiting inside the given execution.static voidsignalEventReceived(String signalName, String executionId, Map<String,Object> processVariables)Notifies the process engine that a signal event of name 'signalName' has been received.static org.camunda.bpm.engine.runtime.ProcessInstancestartProcessInstanceById(String processDefinitionId, String businessKey, String caseInstanceId, Map<String,Object> variables)Starts a new process instance in the exactly specified version of the process definition with the given id.static org.camunda.bpm.engine.runtime.ProcessInstancestartProcessInstanceByKey(String processDefinitionKey, String businessKey, String caseInstanceId, Map<String,Object> variables)Starts a new process instance in the latest version of the process definition with the given key.static org.camunda.bpm.engine.runtime.ProcessInstancestartProcessInstanceByMessage(String messageName, String businessKey, Map<String,Object> processVariables)Signals the process engine that a message is received and starts a newProcessInstance.static org.camunda.bpm.engine.runtime.ProcessInstancestartProcessInstanceByMessageAndProcessDefinitionId(String messageName, String processDefinitionId, String businessKey, Map<String,Object> processVariables)Signals the process engine that a message is received and starts a newProcessInstance.static voidsuspendProcessInstanceById(String processInstanceId)Suspends the process instance with the given id.static voidsuspendProcessInstanceByProcessDefinitionId(String processDefinitionId)Suspends the process instances with the given process definition id.static voidsuspendProcessInstanceByProcessDefinitionKey(String processDefinitionKey)Suspends the process instances with the given process definition key.static org.camunda.bpm.engine.runtime.UpdateProcessInstanceSuspensionStateSelectBuilderupdateProcessInstanceSuspensionState()Activate or suspend process instances using a fluent builder.
-
-
-
Method Detail
-
startProcessInstanceByKey
public static org.camunda.bpm.engine.runtime.ProcessInstance startProcessInstanceByKey(String processDefinitionKey, String businessKey, String caseInstanceId, Map<String,Object> variables)
Starts a new process instance in the latest version of the process definition with the given key.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.Note that a business key MUST be unique for the given process definition WHEN you have added a database constraint for it. In this case, only Process instance from different process definition are allowed to have the same business key and the combination of processdefinitionKey-businessKey must be unique.
The combination of processdefinitionKey-businessKey must be unique.
- Parameters:
processDefinitionKey- key of process definition, cannot be null.businessKey- a key that uniquely identifies the process instance in the context of the given process definition.caseInstanceId- an id of a case instance to associate the process instance with a case instance.variables- the variables to pass, can be null.- Returns:
- ProcessInstance
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no process definition is deployed with the given key.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.CREATEpermission onResources.PROCESS_INSTANCEand noPermissions.CREATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
startProcessInstanceById
public static org.camunda.bpm.engine.runtime.ProcessInstance startProcessInstanceById(String processDefinitionId, String businessKey, String caseInstanceId, Map<String,Object> variables)
Starts a new process instance in the exactly specified version of the process definition with the given id.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.Note that a business key MUST be unique for the given process definition WHEN you have added a database constraint for it. In this case, only Process instance from different process definition are allowed to have the same business key and the combination of processdefinitionKey-businessKey must be unique.
- Parameters:
processDefinitionId- the id of the process definition, cannot be null.businessKey- a key that uniquely identifies the process instance in the context of the given process definition.caseInstanceId- an id of a case instance to associate the process instance with a case instance.variables- variables to be passed, can be null- Returns:
- ProcessInstance
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no process definition is deployed with the given key.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.CREATEpermission onResources.PROCESS_INSTANCEand noPermissions.CREATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
startProcessInstanceByMessage
public static org.camunda.bpm.engine.runtime.ProcessInstance startProcessInstanceByMessage(String messageName, String businessKey, Map<String,Object> processVariables)
Signals the process engine that a message is received and starts a new
ProcessInstance.- 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
ProcessInstanceobject representing the started process instance - Throws:
org.camunda.bpm.engine.ProcessEngineException- if no subscription to a message with the given name existsorg.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.CREATEpermission onResources.PROCESS_INSTANCEand noPermissions.CREATE_INSTANCEpermission onResources.PROCESS_DEFINITION.- Since:
- 5.9
-
startProcessInstanceByMessageAndProcessDefinitionId
public static org.camunda.bpm.engine.runtime.ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId(String messageName, String processDefinitionId, String businessKey, Map<String,Object> processVariables)
Signals the process engine that a message is received and starts a new
ProcessInstance.See
startProcessInstanceByMessage(String, String, Map). In addition, this method allows specifying the exactly version of the process definition with the given id.- Parameters:
messageName- the 'name' of the message as specified as an attribute on the bpmn20<message name="messageName" />element, cannot be null.processDefinitionId- the id of the process definition, cannot be null.businessKey- the business key which is added to the started process instanceprocessVariables- the 'payload' of the message. The variables are added as processes variables to the started process instance.- Returns:
- the
ProcessInstanceobject representing the started process instance - Throws:
org.camunda.bpm.engine.ProcessEngineException- if no subscription to a message with the given name exists for the specified version of process definition.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.CREATEpermission onResources.PROCESS_INSTANCEand noPermissions.CREATE_INSTANCEpermission onResources.PROCESS_DEFINITION.- Since:
- 7.3
-
deleteProcessInstance
public static void deleteProcessInstance(String processInstanceId, String deleteReason)
Delete an existing runtime process instance.Deletion propagates upward as far as necessary.
- Parameters:
processInstanceId- id of process instance to delete, cannot be null.deleteReason- reason for deleting, which will be stored in the history. Can be null.- Throws:
org.camunda.bpm.engine.BadUserRequestException- when no process instance is found with the given id or id is null.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.DELETEpermission onResources.PROCESS_INSTANCEor noPermissions.DELETE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
deleteProcessInstancesAsync
public static org.camunda.bpm.engine.batch.Batch deleteProcessInstancesAsync(List<String> processInstanceIds, org.camunda.bpm.engine.runtime.ProcessInstanceQuery processInstanceQuery, String deleteReason, boolean skipCustomListeners, boolean skipSubprocesses)
Delete an existing runtime process instances asynchronously using Batch operation.Deletion propagates upward as far as necessary.
- Parameters:
processInstanceIds- id's of process instances to delete, cannot be null if processInstanceQuery is null.processInstanceQuery- query that will be used to fetch affected process instances. Cannot be null if processInstanceIds are null.deleteReason- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners- skips custom execution listeners when removing instancesskipSubprocesses- skips subprocesses when removing instances- Returns:
- Batch
- Throws:
org.camunda.bpm.engine.BadUserRequestException- when no process instance is found with the given id or id is null.org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.CREATEpermission onResources.BATCH.
-
deleteProcessInstances
public static void deleteProcessInstances(List<String> processInstanceIds, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipSubprocesses)
Delete existing runtime process instances.Deletion propagates upward as far as necessary.
- Parameters:
processInstanceIds- ids of process instance to delete, cannot be null.deleteReason- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners- if true, only the built-inExecutionListeners are notified with theExecutionListener.EVENTNAME_ENDevent.externallyTerminated- indicator if deletion triggered from external context, for instance REST API callskipSubprocesses- specifies whether subprocesses should be deleted- Throws:
org.camunda.bpm.engine.BadUserRequestException- when no process instance is found with the given id or id is null.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.DELETEpermission onResources.PROCESS_INSTANCEor noPermissions.DELETE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
deleteProcessInstance
public static void deleteProcessInstance(String processInstanceId, String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings, boolean skipSubprocesses)
Delete an existing runtime process instance.Deletion propagates upward as far as necessary.
- Parameters:
processInstanceId- id of process instance to delete, cannot be null.deleteReason- reason for deleting, which will be stored in the history. Can be null.skipCustomListeners- if true, only the built-inExecutionListeners are notified with theExecutionListener.EVENTNAME_ENDevent.externallyTerminated- indicator if deletion triggered from external context, for instance REST API callskipIoMappings- specifies whether input/output mappings for tasks should be invokedskipSubprocesses- specifies whether subprocesses should be deleted- Throws:
org.camunda.bpm.engine.BadUserRequestException- when no process instance is found with the given id or id is null.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.DELETEpermission onResources.PROCESS_INSTANCEor noPermissions.DELETE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
getActiveActivityIds
public static List<String> getActiveActivityIds(String executionId)
Finds the activity ids for all executions that are waiting in activities. This is a list because a single activity can be active multiple times.Deletion propagates upward as far as necessary.
- Parameters:
executionId- id of the process instance or the execution, cannot be null.- Returns:
- Lista
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution exists with the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
getActivityInstance
public static org.camunda.bpm.engine.runtime.ActivityInstance getActivityInstance(String processInstanceId)
Allows retrieving the activity instance tree for a given process instance. The activity instance tree is aligned with the concept of scope in the BPMN specification. Activities that are "on the same level of subprocess" (ie. part of the same scope, contained in the same subprocess) will have their activity instances at the same level in the tree.
Examples:
- Process with two parallel user tasks after parallel Gateway: in the activity instance tree you will see two activity instances below the root instance, one for each user task.
- Process with two parallel Multi Instance user tasks after parallel Gateway: in the activity instance tree, all instances of both user tasks will be listed below the root activity instance. Reason: all activity instances are at the same level of subprocess.
- Usertask inside embedded subprocess: the activity instance three will have 3 levels: the root instance representing the process instance itself, below it an activity instance representing the instance of the embedded subprocess, and below this one, the activity instance representing the usertask.
Identity & Uniqueness:
Each activity instance is assigned a unique Id. The id is persistent, if you invoke this method multiple times, the same activity instance ids will be returned for the same activity instances. (However, there might be different executions assigned, see below)
Relation to Executions
The
Executionconcept in the process engine is not completely aligned with the activity instance concept because the execution tree is in general not aligned with the activity / scope concept in BPMN. In general, there is a n-1 relationship between Executions and ActivityInstances, ie. at a given point in time, an activity instance can be linked to multiple executions. In addition, it is not guaranteed that the same execution that started a given activity instance will also end it. The process engine performs several internal optimizations concerning the compacting of the execution tree which might lead to executions being reordered and pruned. This can lead to situations where a given execution starts an activity instance but another execution ends it. Another special case is the process instance: if the process instance is executing a non-scope activity (for example a user task) below the process definition scope, it will be referenced by both the root activity instance and the user task activity instance.If you need to interpret the state of a process instance in terms of a BPMN process model, it is usually easier to use the activity instance tree as opposed to the execution tree.
- Parameters:
processInstanceId- the id of the process instance for which the activity instance tree should be constructed.- Returns:
- the activity instance tree for a given process instance or null if no such process instance exists.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- if processInstanceId is 'null' or an internal error occurs.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.- Since:
- 7.0
-
signal
public static void signal(String executionId, String signalName, Object signalData, Map<String,Object> processVariables)
Sends an external trigger to an activity instance that is waiting inside the given execution.Note that you need to provide the exact execution that is waiting for the signal if the process instance contains multiple executions.
- Parameters:
executionId- id of process instance or execution to signal, cannot be null.signalName- name of the signal (can be null)signalData- additional data of the signal (can be null)processVariables- a map of process variables (can be null)- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
getVariables
public static Map<String,Object> getVariables(String executionId)
All variables visible from the given execution scope (including parent scopes).- Parameters:
executionId- id of process instance or execution, cannot be null.- Returns:
- the variables or an empty map if no such variables are found.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
getVariablesTyped
public static org.camunda.bpm.engine.variable.VariableMap getVariablesTyped(String executionId, boolean deserializeValues)
All variables visible from the given execution scope (including parent scopes).- Parameters:
executionId- id of process instance or execution, cannot be null.deserializeValues- if false,SerializableValues will not be deserialized- Returns:
- the variables or an empty map if no such variables are found.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.- Since:
- 7.2
-
getVariablesLocal
public static Map<String,Object> getVariablesLocal(String executionId)
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 usinggetVariablesLocal(String, Collection)for better performance.- Parameters:
executionId- id of execution, cannot be null.- Returns:
- the variables or an empty map if no such variables are found.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
getVariablesLocalTyped
public static org.camunda.bpm.engine.variable.VariableMap getVariablesLocalTyped(String executionId, boolean deserializeValues)
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 usinggetVariablesLocal(String, Collection)for better performance.- Parameters:
executionId- id of execution, cannot be null.deserializeValues- boolean- Returns:
- the variables or an empty map if no such variables are found.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.- Since:
- 7.2
-
getVariables
public static 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).- Parameters:
executionId- id of process instance or execution, cannot be null.variableNames- the collection of variable names that should be retrieved.- Returns:
- the variables or an empty map if no such variables are found.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
getVariablesTyped
public static org.camunda.bpm.engine.variable.VariableMap getVariablesTyped(String executionId, Collection<String> variableNames, boolean deserializeValues)
The variable values for all given variableNames, takes all variables into account which are visible from the given execution scope (including parent scopes).- Parameters:
executionId- id of process instance or execution, cannot be null.variableNames- the collection of variable names that should be retrieved.deserializeValues- boolean- Returns:
- the variables or an empty map if no such variables are found.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.- Since:
- 7.2
-
getVariablesLocal
public static 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.- 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.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
getVariablesLocalTyped
public static org.camunda.bpm.engine.variable.VariableMap getVariablesLocalTyped(String executionId, Collection<String> variableNames, boolean deserializeValues)
The variable values for the given variableNames only taking the given execution scope into account, not looking in outer scopes.- Parameters:
executionId- id of execution, cannot be null.variableNames- the collection of variable names that should be retrieved.deserializeValues- boolean- Returns:
- the variables or an empty map if no such variables are found.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.- Since:
- 7.2
-
getVariable
public static Object getVariable(String executionId, String variableName)
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.- Parameters:
executionId- id of process instance or execution, cannot be null.variableName- name of variable, cannot be null.- Returns:
- the variable value or null if the variable is undefined or the value of the variable is null.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
getVariableTyped
public static <T extends org.camunda.bpm.engine.variable.value.TypedValue> T getVariableTyped(String executionId, String variableName, boolean deserializeValue)
Returns aTypedValuefor 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.- Type Parameters:
T- TypedValue- Parameters:
executionId- id of process instance or execution, cannot be null.variableName- name of variable, cannot be null.deserializeValue- if false, aSerializableValuewill not be deserialized- Returns:
- the variable value or null if the variable is undefined.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.- Since:
- 7.2
-
getVariableLocal
public static Object getVariableLocal(String executionId, String variableName)
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.- Parameters:
executionId- id of process instance or execution, cannot be null.variableName- name of variable, cannot be null.- Returns:
- the variable value or null if the variable is undefined or the value of the variable is null.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
getVariableLocalTyped
public static <T extends org.camunda.bpm.engine.variable.value.TypedValue> T getVariableLocalTyped(String executionId, String variableName, boolean deserializeValue)
Returns aTypedValuefor the variable. Searching for the variable is done in all scopes that are visible to the given execution (and not searching parent scopes). Returns null when no variable value is found with the given name.- Type Parameters:
T- TypedValue- Parameters:
executionId- id of process instance or execution, cannot be null.variableName- name of variable, cannot be null.deserializeValue- if false, aSerializableValuewill not be deserialized- Returns:
- the variable value or null if the variable is undefined.
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.READpermission onResources.PROCESS_INSTANCEor noPermissions.READ_INSTANCEpermission onResources.PROCESS_DEFINITION.- Since:
- 7.2
-
setVariable
public static void setVariable(String executionId, String variableName, Object value)
Update or create a variable for an execution. If the variable does not already exist somewhere in the execution hierarchy (i.e. the specified execution or any ancestor), it will be created in the process instance (which is the root execution).- Parameters:
executionId- id of process instance or execution to set variable in, cannot be null.variableName- name of variable to set, cannot be null.value- value to set. When null is passed, the variable is not removed, only it's value will be set to null.- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
setVariableLocal
public static void setVariableLocal(String executionId, String variableName, Object value)
Update or create a variable for an execution (not considering parent scopes). If the variable does not already exist, it will be created in the given execution.- 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.- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
setVariables
public static void setVariables(String executionId, Map<String,?> variables)
Update or create given variables for an execution (including parent scopes). If the variables are not already existing, they will be created in the process instance (which is the root execution).- Parameters:
executionId- id of the process instance or the execution, cannot be null.variables- map containing name (key) and value of variables, can be null.- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
setVariablesLocal
public static void setVariablesLocal(String executionId, Map<String,?> variables)
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.- Parameters:
executionId- id of the execution, cannot be null.variables- map containing name (key) and value of variables, can be null.- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
removeVariable
public static void removeVariable(String executionId, String variableName)
Removes a variable for an execution.- Parameters:
executionId- id of process instance or execution to remove variable in.variableName- name of variable to remove.- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
removeVariableLocal
public static void removeVariableLocal(String executionId, String variableName)
Removes a variable for an execution (not considering parent scopes).- Parameters:
executionId- id of execution to remove variable in.variableName- name of variable to remove.- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
removeVariables
public static void removeVariables(String executionId, Collection<String> variableNames)
Removes variables for an execution.- Parameters:
executionId- id of process instance or execution to remove variable in.variableNames- collection containing name of variables to remove.- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
removeVariablesLocal
public static void removeVariablesLocal(String executionId, Collection<String> variableNames)
Remove variables for an execution (not considering parent scopes).- Parameters:
executionId- id of execution to remove variable in.variableNames- collection containing name of variables to remove.- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no execution is found for the given executionId.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
createExecutionQuery
public static org.camunda.bpm.engine.runtime.ExecutionQuery createExecutionQuery()
Creates a newExecutionQueryinstance, that can be used to query the executions and process instances.- Returns:
- ExecutionQuery
-
createNativeExecutionQuery
public static org.camunda.bpm.engine.runtime.NativeExecutionQuery createNativeExecutionQuery()
creates a newNativeExecutionQueryto queryExecutions by SQL directly- Returns:
- NativeExecutionQuery
-
createProcessInstanceQuery
public static org.camunda.bpm.engine.runtime.ProcessInstanceQuery createProcessInstanceQuery()
Creates a newProcessInstanceQueryinstance, that can be used to query process instances.- Returns:
- ProcessInstanceQuery
-
createNativeProcessInstanceQuery
public static org.camunda.bpm.engine.runtime.NativeProcessInstanceQuery createNativeProcessInstanceQuery()
creates a newNativeProcessInstanceQueryto queryProcessInstances by SQL directly- Returns:
- NativeProcessInstanceQuery
-
createIncidentQuery
public static org.camunda.bpm.engine.runtime.IncidentQuery createIncidentQuery()
Creates a newIncidentQueryinstance, that can be used to query incidents.- Returns:
- IncidentQuery
-
createEventSubscriptionQuery
public static org.camunda.bpm.engine.runtime.EventSubscriptionQuery createEventSubscriptionQuery()
Creates a newEventSubscriptionQueryinstance, that can be used to query event subscriptions.- Returns:
- EventSubscriptionQuery
-
createVariableInstanceQuery
public static org.camunda.bpm.engine.runtime.VariableInstanceQuery createVariableInstanceQuery()
Creates a newVariableInstanceQueryinstance, that can be used to query variable instances.- Returns:
- VariableInstanceQuery
-
suspendProcessInstanceById
public static void suspendProcessInstanceById(String processInstanceId)
Suspends the process instance with the given id. This means that the execution is stopped, so the token state will not change. However, actions that do not change token state, like setting/removing variables, etc. will succeed.
Tasks belonging to this process instance will also be suspended. This means that any actions influencing the tasks' lifecycles will fail, such as
- claiming
- completing
- delegation
- changes in task assignees, owners, etc.
If a process instance is in state suspended, the engine will also not execute jobs (timers, messages) associated with this instance.
If you have a process instance hierarchy, suspending one process instance from the hierarchy will not suspend other process instances from that hierarchy.
Note: for more complex suspend commands use
updateProcessInstanceSuspensionState().- Parameters:
processInstanceId- String- Throws:
org.camunda.bpm.engine.ProcessEngineException- if no such processInstance can be found.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
suspendProcessInstanceByProcessDefinitionId
public static void suspendProcessInstanceByProcessDefinitionId(String processDefinitionId)
Suspends the process instances with the given process definition id. This means that the execution is stopped, so the token state will not change. However, actions that do not change token state, like setting/removing variables, etc. will succeed.
Tasks belonging to the suspended process instance will also be suspended. This means that any actions influencing the tasks' lifecycles will fail, such as
- claiming
- completing
- delegation
- changes in task assignees, owners, etc.
If a process instance is in state suspended, the engine will also not execute jobs (timers, messages) associated with this instance.
If you have a process instance hierarchy, suspending one process instance from the hierarchy will not suspend other process instances from that hierarchy.
Note: for more complex suspend commands use
updateProcessInstanceSuspensionState().- Parameters:
processDefinitionId- String- Throws:
org.camunda.bpm.engine.ProcessEngineException- if no such processInstance can be found.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
suspendProcessInstanceByProcessDefinitionKey
public static void suspendProcessInstanceByProcessDefinitionKey(String processDefinitionKey)
Suspends the process instances with the given process definition key. This means that the execution is stopped, so the token state will not change. However, actions that do not change token state, like setting/removing variables, etc. will succeed.
Tasks belonging to the suspended process instance will also be suspended. This means that any actions influencing the tasks' lifecycles will fail, such as
- claiming
- completing
- delegation
- changes in task assignees, owners, etc.
If a process instance is in state suspended, the engine will also not execute jobs (timers, messages) associated with this instance.
If you have a process instance hierarchy, suspending one process instance from the hierarchy will not suspend other process instances from that hierarchy.
Note: for more complex suspend commands use
updateProcessInstanceSuspensionState().- Parameters:
processDefinitionKey- String- Throws:
org.camunda.bpm.engine.ProcessEngineException- if no such processInstance can be found.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
activateProcessInstanceById
public static void activateProcessInstanceById(String processInstanceId)
Activates the process instance with the given id.
If you have a process instance hierarchy, activating one process instance from the hierarchy will not activate other process instances from that hierarchy.
Note: for more complex activate commands use
updateProcessInstanceSuspensionState().- Parameters:
processInstanceId- String- Throws:
org.camunda.bpm.engine.ProcessEngineException- if no such processInstance can be found.org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
activateProcessInstanceByProcessDefinitionId
public static void activateProcessInstanceByProcessDefinitionId(String processDefinitionId)
Activates the process instance with the given process definition id.
If you have a process instance hierarchy, activating one process instance from the hierarchy will not activate other process instances from that hierarchy.
Note: for more complex activate commands use
updateProcessInstanceSuspensionState().- Parameters:
processDefinitionId- String- Throws:
org.camunda.bpm.engine.ProcessEngineException- if the process definition id is nullorg.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
activateProcessInstanceByProcessDefinitionKey
public static void activateProcessInstanceByProcessDefinitionKey(String processDefinitionKey)
Activates the process instance with the given process definition key.
If you have a process instance hierarchy, activating one process instance from the hierarchy will not activate other process instances from that hierarchy.
Note: for more complex activate commands use
updateProcessInstanceSuspensionState().- Parameters:
processDefinitionKey- String- Throws:
org.camunda.bpm.engine.ProcessEngineException- if the process definition id is nullorg.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
updateProcessInstanceSuspensionState
public static org.camunda.bpm.engine.runtime.UpdateProcessInstanceSuspensionStateSelectBuilder updateProcessInstanceSuspensionState()
Activate or suspend process instances using a fluent builder. Specify the instances by calling one of the by methods, like byProcessInstanceId. To update the suspension state callUpdateProcessInstanceSuspensionStateBuilder.activate()orUpdateProcessInstanceSuspensionStateBuilder.suspend().- Returns:
- the builder to update the suspension state
-
signalEventReceived
public static void signalEventReceived(String signalName, String executionId, Map<String,Object> processVariables)
Notifies the process engine that a signal event of name 'signalName' has been received. This method delivers the signal to a single execution, being the execution referenced by 'executionId'. The waiting execution is notified synchronously.Note that you need to provide the exact execution that is waiting for the signal if the process instance contains multiple executions.
- Parameters:
signalName- the name of the signal eventexecutionId- the id of the process instance or the execution to deliver the signal toprocessVariables- a map of variables added to the execution(s)- Throws:
org.camunda.bpm.engine.ProcessEngineException- if no such execution exists or if the execution has not subscribed to the signalorg.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
createSignalEvent
public static org.camunda.bpm.engine.runtime.SignalEventReceivedBuilder createSignalEvent(String signalName)
Notifies the process engine that a signal event has been received using a fluent builder.- Parameters:
signalName- the name of the signal event- Returns:
- the fluent builder to send the signal
-
messageEventReceived
public static 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'.The waiting execution is notified synchronously.
Note that you need to provide the exact execution that is waiting for the message if the process instance contains multiple executions.
- Parameters:
messageName- the name of the message eventexecutionId- the id of the process instance or the execution to deliver the message toprocessVariables- a map of variables added to the execution- Throws:
org.camunda.bpm.engine.ProcessEngineException- if no such execution exists or if the execution has not subscribed to the signalorg.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
createMessageCorrelation
public static org.camunda.bpm.engine.runtime.MessageCorrelationBuilder createMessageCorrelation(String messageName)
Define a complex message correlation using a fluent builder.- Parameters:
messageName- the name of the message. Corresponds to the 'name' element of the message defined in BPMN 2.0 Xml. Can be null to correlate by other criteria (businessKey, processInstanceId, correlationKeys) only.- Returns:
- the fluent builder for defining the message correlation.
-
correlateMessage
public static void correlateMessage(String messageName, String businessKey, Map<String,Object> correlationKeys, Map<String,Object> processVariables)
Correlates a message to- an execution that is waiting for a matching message and can be correlated according to the given correlation keys. This is typically matched against process instance variables. The process instance it belongs to has to have the given business key.
- a process definition that can be started by this message.
Notification and instantiation happen synchronously.
- Parameters:
messageName- the name of the message event; if null, matches any eventbusinessKey- the business key of process instances to correlate againstcorrelationKeys- a map of key value pairs that are used to correlate the message to an executionprocessVariables- a map of variables added to the execution or newly created process instance- Throws:
org.camunda.bpm.engine.MismatchingMessageCorrelationException- if none or more than one execution or process definition is correlatedorg.camunda.bpm.engine.ProcessEngineException- if messageName is null and businessKey is null and correlationKeys is nullorg.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEor noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
createProcessInstanceModification
public static org.camunda.bpm.engine.runtime.ProcessInstanceModificationBuilder createProcessInstanceModification(String processInstanceId)
Define a modification of a process instance in terms of activity cancellations and instantiations via a fluent builder. Instructions are executed in the order they are specified.- Parameters:
processInstanceId- the process instance to modify- Returns:
- ProcessInstanceModificationBuilder
-
createProcessInstanceById
public static org.camunda.bpm.engine.runtime.ProcessInstantiationBuilder createProcessInstanceById(String processDefinitionId)
Returns a fluent builder to start a new process instance in the exactly specified version of the process definition with the given id. The builder can be used to set further properties and specify instantiation instructions to start the instance at any set of activities in the process. If no instantiation instructions are set then the instance start at the default start activity.- Parameters:
processDefinitionId- the id of the process definition, cannot benull.- Returns:
- a builder to create a process instance of the definition
-
createProcessInstanceByKey
public static org.camunda.bpm.engine.runtime.ProcessInstantiationBuilder createProcessInstanceByKey(String processDefinitionKey)
Returns a fluent builder to start a new process instance in the latest version of the process definition with the given key. The builder can be used to set further properties and specify instantiation instructions to start the instance at any set of activities in the process. If no instantiation instructions are set then the instance start at the default start activity.- Parameters:
processDefinitionKey- the key of the process definition, cannot benull.- Returns:
- a builder to create a process instance of the definition
-
createMigrationPlan
public static org.camunda.bpm.engine.migration.MigrationPlanBuilder createMigrationPlan(String sourceProcessDefinitionId, String targetProcessDefinitionId)
Creates a migration plan to migrate process instance between different process definitions. Returns a fluent builder that can be used to specify migration instructions and build the plan.- Parameters:
sourceProcessDefinitionId- the process definition that instances are migrated fromtargetProcessDefinitionId- the process definition that instances are migrated to- Returns:
- a fluent builder
-
newMigration
public static org.camunda.bpm.engine.migration.MigrationPlanExecutionBuilder newMigration(org.camunda.bpm.engine.migration.MigrationPlan migrationPlan)
Executes a migration plan for a given list of process instances. The migration can either be executed synchronously or asynchronously. A synchronously migration blocks the caller until the migration was completed. The migration can only be successfully completed if all process instances can be migrated.If the migration is executed asynchronously a
Batchis immediately returned. The migration is then executed as jobs from the process engine and the batch can be used to track the progress of the migration. The Batch splits the migration in smaller chunks which will be executed independently.- Parameters:
migrationPlan- the migration plan to executed- Returns:
- a fluent builder
-
createModification
public static org.camunda.bpm.engine.runtime.ModificationBuilder createModification(String processDefinitionId)
Creates a modification of multiple process instances in terms of activity cancellations and instantiations via a fluent builder. Returns a fluent builder that can be used to specify modification instructions and set process instances that should be modified.The modification can either be executed synchronously or asynchronously. A synchronously modification blocks the caller until the modification was completed. The modification can only be successfully completed if all process instances can be modified.
If the modification is executed asynchronously a
Batchis immediately returned. The modification is then executed as jobs from the process engine and the batch can be used to track the progress of the modification. The Batch splits the modification in smaller chunks which will be executed independently.- Parameters:
processDefinitionId- the process definition that instances are modified of- Returns:
- a fluent builder
-
restartProcessInstances
public static org.camunda.bpm.engine.runtime.RestartProcessInstanceBuilder restartProcessInstances(String processDefinitionId)
Restarts process instances that are completed or deleted with the initial or last set of variables.- Parameters:
processDefinitionId- the id of the process definition, cannot be null.- Returns:
- RestartProcessInstanceBuilder
- Throws:
org.camunda.bpm.engine.ProcessEngineException- when no process definition is deployed with the given key or a process instance is still active.org.camunda.bpm.engine.AuthorizationException- if the user has not all of the following permissionsPermissions.CREATEpermission onResources.PROCESS_INSTANCEPermissions.CREATE_INSTANCEpermission onResources.PROCESS_DEFINITIONPermissions.READ_HISTORYpermission onResources.PROCESS_DEFINITION
-
createIncident
public static org.camunda.bpm.engine.runtime.Incident createIncident(String incidentType, String executionId, String configuration, String message)
Creates an incident- Parameters:
incidentType- the type of incident, cannot be nullexecutionId- execution id, cannot be nullconfiguration- Stringmessage- String- Returns:
- a new incident
- Throws:
org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEand noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
resolveIncident
public static void resolveIncident(String incidentId)
Resolves and remove an incident- Parameters:
incidentId- the id of an incident to resolve- Throws:
org.camunda.bpm.engine.AuthorizationException- if the user has noPermissions.UPDATEpermission onResources.PROCESS_INSTANCEand noPermissions.UPDATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
createConditionEvaluation
public static org.camunda.bpm.engine.runtime.ConditionEvaluationBuilder createConditionEvaluation()
Define a complex condition evaluation using a fluent builder.- Returns:
- the fluent builder for defining the condition evaluation.
-
-