Interface RuntimeService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void activateProcessInstanceById​(java.lang.String processInstanceId)
      Activates the process instance with the given id.
      void activateProcessInstanceByProcessDefinitionId​(java.lang.String processDefinitionId)
      Activates the process instance with the given process definition id.
      void activateProcessInstanceByProcessDefinitionKey​(java.lang.String processDefinitionKey)
      Activates the process instance with the given process definition key.
      void clearAnnotationForIncidentById​(java.lang.String incidentId)
      Clear the annotation for an incident.
      void correlateMessage​(java.lang.String messageName)
      Correlates a message to either an execution that is waiting for this message or a process definition that can be started by this message.
      void correlateMessage​(java.lang.String messageName, java.lang.String businessKey)
      Correlates a message to an execution that is waiting for a matching message and belongs to a process instance with the given business key a process definition that can be started by a matching message.
      void correlateMessage​(java.lang.String messageName, java.lang.String businessKey, java.util.Map<java.lang.String,​java.lang.Object> processVariables)
      Correlates a message to an execution that is waiting for a matching message and belongs to a process instance with the given business key a process definition that can be started by this message.
      void correlateMessage​(java.lang.String messageName, java.lang.String businessKey, java.util.Map<java.lang.String,​java.lang.Object> correlationKeys, java.util.Map<java.lang.String,​java.lang.Object> processVariables)
      Correlates a message to an execution that is waiting for a matching message and can be correlated according to the given correlation keys.
      void correlateMessage​(java.lang.String messageName, java.util.Map<java.lang.String,​java.lang.Object> correlationKeys)
      Correlates a message to an execution that is waiting for a matching message and can be correlated according to the given correlation keys.
      void correlateMessage​(java.lang.String messageName, java.util.Map<java.lang.String,​java.lang.Object> correlationKeys, java.util.Map<java.lang.String,​java.lang.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.
      ConditionEvaluationBuilder createConditionEvaluation()
      Define a complex condition evaluation using a fluent builder.
      EventSubscriptionQuery createEventSubscriptionQuery()
      Creates a new EventSubscriptionQuery instance, that can be used to query event subscriptions.
      ExecutionQuery createExecutionQuery()
      Creates a new ExecutionQuery instance, that can be used to query the executions and process instances.
      Incident createIncident​(java.lang.String incidentType, java.lang.String executionId, java.lang.String configuration)
      Creates an incident
      Incident createIncident​(java.lang.String incidentType, java.lang.String executionId, java.lang.String configuration, java.lang.String message)
      Creates an incident
      IncidentQuery createIncidentQuery()
      Creates a new IncidentQuery instance, that can be used to query incidents.
      MessageCorrelationBuilder createMessageCorrelation​(java.lang.String messageName)
      Define a complex message correlation using a fluent builder.
      MessageCorrelationAsyncBuilder createMessageCorrelationAsync​(java.lang.String messageName)
      Define a complex asynchronous message correlation using a fluent builder.
      MigrationPlanBuilder createMigrationPlan​(java.lang.String sourceProcessDefinitionId, java.lang.String targetProcessDefinitionId)
      Creates a migration plan to migrate process instance between different process definitions.
      ModificationBuilder createModification​(java.lang.String processDefinitionId)
      Creates a modification of multiple process instances in terms of activity cancellations and instantiations via a fluent builder.
      NativeExecutionQuery createNativeExecutionQuery()
      creates a new NativeExecutionQuery to query Executions by SQL directly
      NativeProcessInstanceQuery createNativeProcessInstanceQuery()
      creates a new NativeProcessInstanceQuery to query ProcessInstances by SQL directly
      ProcessInstantiationBuilder createProcessInstanceById​(java.lang.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.
      ProcessInstantiationBuilder createProcessInstanceByKey​(java.lang.String processDefinitionKey)
      Returns a fluent builder to start a new process instance in the latest version of the process definition with the given key.
      ProcessInstanceModificationBuilder createProcessInstanceModification​(java.lang.String processInstanceId)
      Define a modification of a process instance in terms of activity cancellations and instantiations via a fluent builder.
      ProcessInstanceQuery createProcessInstanceQuery()
      Creates a new ProcessInstanceQuery instance, that can be used to query process instances.
      SignalEventReceivedBuilder createSignalEvent​(java.lang.String signalName)
      Notifies the process engine that a signal event has been received using a fluent builder.
      VariableInstanceQuery createVariableInstanceQuery()
      Creates a new VariableInstanceQuery instance, that can be used to query variable instances.
      void deleteProcessInstance​(java.lang.String processInstanceId, java.lang.String deleteReason)
      Delete an existing runtime process instance.
      void deleteProcessInstance​(java.lang.String processInstanceId, java.lang.String deleteReason, boolean skipCustomListeners)
      Delete an existing runtime process instance.
      void deleteProcessInstance​(java.lang.String processInstanceId, java.lang.String deleteReason, boolean skipCustomListeners, boolean externallyTerminated)
      Delete an existing runtime process instance.
      void deleteProcessInstance​(java.lang.String processInstanceId, java.lang.String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings)
      Delete an existing runtime process instance.
      void deleteProcessInstance​(java.lang.String processInstanceId, java.lang.String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings, boolean skipSubprocesses)
      Delete an existing runtime process instance.
      void deleteProcessInstanceIfExists​(java.lang.String processInstanceId, java.lang.String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipIoMappings, boolean skipSubprocesses)
      Delete an existing runtime process instance.
      void deleteProcessInstances​(java.util.List<java.lang.String> processInstanceIds, java.lang.String deleteReason, boolean skipCustomListeners, boolean externallyTerminated)
      Delete existing runtime process instances.
      void deleteProcessInstances​(java.util.List<java.lang.String> processInstanceIds, java.lang.String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipSubprocesses)
      Delete existing runtime process instances.
      Batch deleteProcessInstancesAsync​(java.util.List<java.lang.String> processInstanceIds, java.lang.String deleteReason)
      Delete an existing runtime process instances asynchronously using Batch operation.
      Batch deleteProcessInstancesAsync​(java.util.List<java.lang.String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, java.lang.String deleteReason)
      Delete an existing runtime process instances asynchronously using Batch operation.
      Batch deleteProcessInstancesAsync​(java.util.List<java.lang.String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, java.lang.String deleteReason, boolean skipCustomListeners)
      Delete an existing runtime process instances asynchronously using Batch operation.
      Batch deleteProcessInstancesAsync​(java.util.List<java.lang.String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, java.lang.String deleteReason, boolean skipCustomListeners, boolean skipSubprocesses)
      Delete an existing runtime process instances asynchronously using Batch operation.
      Batch deleteProcessInstancesAsync​(java.util.List<java.lang.String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, HistoricProcessInstanceQuery historicProcessInstanceQuery, java.lang.String deleteReason, boolean skipCustomListeners, boolean skipSubprocesses)
      Delete an existing runtime process instances asynchronously using Batch operation.
      Batch deleteProcessInstancesAsync​(ProcessInstanceQuery processInstanceQuery, java.lang.String deleteReason)
      Delete an existing runtime process instances asynchronously using Batch operation.
      void deleteProcessInstancesIfExists​(java.util.List<java.lang.String> processInstanceIds, java.lang.String deleteReason, boolean skipCustomListeners, boolean externallyTerminated, boolean skipSubprocesses)
      Delete existing runtime process instances.
      java.util.List<java.lang.String> getActiveActivityIds​(java.lang.String executionId)
      Finds the activity ids for all executions that are waiting in activities.
      ActivityInstance getActivityInstance​(java.lang.String processInstanceId)
      Allows retrieving the activity instance tree for a given process instance.
      java.lang.Object getVariable​(java.lang.String executionId, java.lang.String variableName)
      The variable value.
      java.lang.Object getVariableLocal​(java.lang.String executionId, java.lang.String variableName)
      The variable value for an execution.
      <T extends TypedValue>
      T
      getVariableLocalTyped​(java.lang.String executionId, java.lang.String variableName)
      Returns a TypedValue for the variable.
      <T extends TypedValue>
      T
      getVariableLocalTyped​(java.lang.String executionId, java.lang.String variableName, boolean deserializeValue)
      Returns a TypedValue for the variable.
      java.util.Map<java.lang.String,​java.lang.Object> getVariables​(java.lang.String executionId)
      All variables visible from the given execution scope (including parent scopes).
      java.util.Map<java.lang.String,​java.lang.Object> getVariables​(java.lang.String executionId, java.util.Collection<java.lang.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).
      java.util.Map<java.lang.String,​java.lang.Object> getVariablesLocal​(java.lang.String executionId)
      All variable values that are defined in the execution scope, without taking outer scopes into account.
      java.util.Map<java.lang.String,​java.lang.Object> getVariablesLocal​(java.lang.String executionId, java.util.Collection<java.lang.String> variableNames)
      The variable values for the given variableNames only taking the given execution scope into account, not looking in outer scopes.
      VariableMap getVariablesLocalTyped​(java.lang.String executionId)
      All variable values that are defined in the execution scope, without taking outer scopes into account.
      VariableMap getVariablesLocalTyped​(java.lang.String executionId, boolean deserializeValues)
      All variable values that are defined in the execution scope, without taking outer scopes into account.
      VariableMap getVariablesLocalTyped​(java.lang.String executionId, java.util.Collection<java.lang.String> variableNames, boolean deserializeValues)
      The variable values for the given variableNames only taking the given execution scope into account, not looking in outer scopes.
      VariableMap getVariablesTyped​(java.lang.String executionId)
      All variables visible from the given execution scope (including parent scopes).
      VariableMap getVariablesTyped​(java.lang.String executionId, boolean deserializeValues)
      All variables visible from the given execution scope (including parent scopes).
      VariableMap getVariablesTyped​(java.lang.String executionId, java.util.Collection<java.lang.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).
      <T extends TypedValue>
      T
      getVariableTyped​(java.lang.String executionId, java.lang.String variableName)
      Returns a TypedValue for the variable.
      <T extends TypedValue>
      T
      getVariableTyped​(java.lang.String executionId, java.lang.String variableName, boolean deserializeValue)
      Returns a TypedValue for the variable.
      void messageEventReceived​(java.lang.String messageName, java.lang.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​(java.lang.String messageName, java.lang.String executionId, java.util.Map<java.lang.String,​java.lang.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'.
      MigrationPlanExecutionBuilder newMigration​(MigrationPlan migrationPlan)
      Executes a migration plan for a given list of process instances.
      void removeVariable​(java.lang.String executionId, java.lang.String variableName)
      Removes a variable for an execution.
      void removeVariableLocal​(java.lang.String executionId, java.lang.String variableName)
      Removes a variable for an execution (not considering parent scopes).
      void removeVariables​(java.lang.String executionId, java.util.Collection<java.lang.String> variableNames)
      Removes variables for an execution.
      void removeVariablesLocal​(java.lang.String executionId, java.util.Collection<java.lang.String> variableNames)
      Remove variables for an execution (not considering parent scopes).
      void resolveIncident​(java.lang.String incidentId)
      Resolves and remove an incident
      RestartProcessInstanceBuilder restartProcessInstances​(java.lang.String processDefinitionId)
      Restarts process instances that are completed or deleted with the initial or last set of variables.
      void setAnnotationForIncidentById​(java.lang.String incidentId, java.lang.String annotation)
      Set an annotation to an incident.
      void setVariable​(java.lang.String executionId, java.lang.String variableName, java.lang.Object value)
      Update or create a variable for an execution.
      void setVariableLocal​(java.lang.String executionId, java.lang.String variableName, java.lang.Object value)
      Update or create a variable for an execution (not considering parent scopes).
      void setVariables​(java.lang.String executionId, java.util.Map<java.lang.String,​? extends java.lang.Object> variables)
      Update or create given variables for an execution (including parent scopes).
      Batch setVariablesAsync​(java.util.List<java.lang.String> processInstanceIds, java.util.Map<java.lang.String,​?> variables)
      Update or create runtime process variables in the root scope of process instances.
      Batch setVariablesAsync​(java.util.List<java.lang.String> processInstanceIds, ProcessInstanceQuery processInstanceQuery, HistoricProcessInstanceQuery historicProcessInstanceQuery, java.util.Map<java.lang.String,​?> variables)
      Update or create runtime process variables in the root scope of process instances.
      Batch setVariablesAsync​(HistoricProcessInstanceQuery historicProcessInstanceQuery, java.util.Map<java.lang.String,​?> variables)
      Update or create runtime process variables in the root scope of process instances.
      Batch setVariablesAsync​(ProcessInstanceQuery processInstanceQuery, java.util.Map<java.lang.String,​?> variables)
      Update or create runtime process variables in the root scope of process instances.
      void setVariablesLocal​(java.lang.String executionId, java.util.Map<java.lang.String,​? extends java.lang.Object> variables)
      Update or create given variables for an execution (not considering parent scopes).
      void signal​(java.lang.String executionId)
      Sends an external trigger to an activity instance that is waiting inside the given execution.
      void signal​(java.lang.String executionId, java.lang.String signalName, java.lang.Object signalData, java.util.Map<java.lang.String,​java.lang.Object> processVariables)
      Sends an external trigger to an activity instance that is waiting inside the given execution.
      void signal​(java.lang.String executionId, java.util.Map<java.lang.String,​java.lang.Object> processVariables)
      Sends an external trigger to an activity instance that is waiting inside the given execution.
      void signalEventReceived​(java.lang.String signalName)
      Notifies the process engine that a signal event of name 'signalName' has been received.
      void signalEventReceived​(java.lang.String signalName, java.lang.String executionId)
      Notifies the process engine that a signal event of name 'signalName' has been received.
      void signalEventReceived​(java.lang.String signalName, java.lang.String executionId, java.util.Map<java.lang.String,​java.lang.Object> processVariables)
      Notifies the process engine that a signal event of name 'signalName' has been received.
      void signalEventReceived​(java.lang.String signalName, java.util.Map<java.lang.String,​java.lang.Object> processVariables)
      Notifies the process engine that a signal event of name 'signalName' has been received.
      ProcessInstance startProcessInstanceById​(java.lang.String processDefinitionId)
      Starts a new process instance in the exactly specified version of the process definition with the given id.
      ProcessInstance startProcessInstanceById​(java.lang.String processDefinitionId, java.lang.String businessKey)
      Starts a new process instance in the exactly specified version of the process definition with the given id.
      ProcessInstance startProcessInstanceById​(java.lang.String processDefinitionId, java.lang.String businessKey, java.lang.String caseInstanceId)
      Starts a new process instance in the exactly specified version of the process definition with the given id.
      ProcessInstance startProcessInstanceById​(java.lang.String processDefinitionId, java.lang.String businessKey, java.lang.String caseInstanceId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Starts a new process instance in the exactly specified version of the process definition with the given id.
      ProcessInstance startProcessInstanceById​(java.lang.String processDefinitionId, java.lang.String businessKey, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Starts a new process instance in the exactly specified version of the process definition with the given id.
      ProcessInstance startProcessInstanceById​(java.lang.String processDefinitionId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Starts a new process instance in the exactly specified version of the process definition with the given id.
      ProcessInstance startProcessInstanceByKey​(java.lang.String processDefinitionKey)
      Starts a new process instance in the latest version of the process definition with the given key.
      ProcessInstance startProcessInstanceByKey​(java.lang.String processDefinitionKey, java.lang.String businessKey)
      Starts a new process instance in the latest version of the process definition with the given key.
      ProcessInstance startProcessInstanceByKey​(java.lang.String processDefinitionKey, java.lang.String businessKey, java.lang.String caseInstanceId)
      Starts a new process instance in the latest version of the process definition with the given key.
      ProcessInstance startProcessInstanceByKey​(java.lang.String processDefinitionKey, java.lang.String businessKey, java.lang.String caseInstanceId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Starts a new process instance in the latest version of the process definition with the given key.
      ProcessInstance startProcessInstanceByKey​(java.lang.String processDefinitionKey, java.lang.String businessKey, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Starts a new process instance in the latest version of the process definition with the given key.
      ProcessInstance startProcessInstanceByKey​(java.lang.String processDefinitionKey, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Starts a new process instance in the latest version of the process definition with the given key
      ProcessInstance startProcessInstanceByMessage​(java.lang.String messageName)
      Signals the process engine that a message is received and starts a new ProcessInstance.
      ProcessInstance startProcessInstanceByMessage​(java.lang.String messageName, java.lang.String businessKey)
      Signals the process engine that a message is received and starts a new ProcessInstance.
      ProcessInstance startProcessInstanceByMessage​(java.lang.String messageName, java.lang.String businessKey, java.util.Map<java.lang.String,​java.lang.Object> processVariables)
      Signals the process engine that a message is received and starts a new ProcessInstance.
      ProcessInstance startProcessInstanceByMessage​(java.lang.String messageName, java.util.Map<java.lang.String,​java.lang.Object> processVariables)
      Signals the process engine that a message is received and starts a new ProcessInstance.
      ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId​(java.lang.String messageName, java.lang.String processDefinitionId)
      Signals the process engine that a message is received and starts a new ProcessInstance.
      ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId​(java.lang.String messageName, java.lang.String processDefinitionId, java.lang.String businessKey)
      Signals the process engine that a message is received and starts a new ProcessInstance.
      ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId​(java.lang.String messageName, java.lang.String processDefinitionId, java.lang.String businessKey, java.util.Map<java.lang.String,​java.lang.Object> processVariables)
      Signals the process engine that a message is received and starts a new ProcessInstance.
      ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId​(java.lang.String messageName, java.lang.String processDefinitionId, java.util.Map<java.lang.String,​java.lang.Object> processVariables)
      Signals the process engine that a message is received and starts a new ProcessInstance.
      void suspendProcessInstanceById​(java.lang.String processInstanceId)
      Suspends the process instance with the given id.
      void suspendProcessInstanceByProcessDefinitionId​(java.lang.String processDefinitionId)
      Suspends the process instances with the given process definition id.
      void suspendProcessInstanceByProcessDefinitionKey​(java.lang.String processDefinitionKey)
      Suspends the process instances with the given process definition key.
      UpdateProcessInstanceSuspensionStateSelectBuilder updateProcessInstanceSuspensionState()
      Activate or suspend process instances using a fluent builder.
    • Method Detail

      • startProcessInstanceByKey

        ProcessInstance startProcessInstanceByKey​(java.lang.String processDefinitionKey,
                                                  java.lang.String businessKey)
        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.
        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.
        Throws:
        ProcessEngineException - when no process definition is deployed with the given key.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • startProcessInstanceByKey

        ProcessInstance startProcessInstanceByKey​(java.lang.String processDefinitionKey,
                                                  java.lang.String businessKey,
                                                  java.lang.String caseInstanceId)
        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.
        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.
        Throws:
        ProcessEngineException - when no process definition is deployed with the given key.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • startProcessInstanceByKey

        ProcessInstance startProcessInstanceByKey​(java.lang.String processDefinitionKey,
                                                  java.lang.String businessKey,
                                                  java.util.Map<java.lang.String,​java.lang.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.
        variables - the variables to pass, can be null.
        businessKey - a key that uniquely identifies the process instance in the context of the given process definition.
        Throws:
        ProcessEngineException - when no process definition is deployed with the given key.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • startProcessInstanceByKey

        ProcessInstance startProcessInstanceByKey​(java.lang.String processDefinitionKey,
                                                  java.lang.String businessKey,
                                                  java.lang.String caseInstanceId,
                                                  java.util.Map<java.lang.String,​java.lang.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.
        variables - the variables to pass, can 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.
        Throws:
        ProcessEngineException - when no process definition is deployed with the given key.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • startProcessInstanceById

        ProcessInstance startProcessInstanceById​(java.lang.String processDefinitionId,
                                                 java.lang.String businessKey)
        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.
        Throws:
        ProcessEngineException - when no process definition is deployed with the given key.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • startProcessInstanceById

        ProcessInstance startProcessInstanceById​(java.lang.String processDefinitionId,
                                                 java.lang.String businessKey,
                                                 java.lang.String caseInstanceId)
        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.
        Throws:
        ProcessEngineException - when no process definition is deployed with the given key.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • startProcessInstanceById

        ProcessInstance startProcessInstanceById​(java.lang.String processDefinitionId,
                                                 java.lang.String businessKey,
                                                 java.util.Map<java.lang.String,​java.lang.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.
        variables - variables to be passed, can be null
        Throws:
        ProcessEngineException - when no process definition is deployed with the given key.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • startProcessInstanceById

        ProcessInstance startProcessInstanceById​(java.lang.String processDefinitionId,
                                                 java.lang.String businessKey,
                                                 java.lang.String caseInstanceId,
                                                 java.util.Map<java.lang.String,​java.lang.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
        Throws:
        ProcessEngineException - when no process definition is deployed with the given key.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • startProcessInstanceByMessageAndProcessDefinitionId

        ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId​(java.lang.String messageName,
                                                                            java.lang.String processDefinitionId,
                                                                            java.lang.String businessKey)

        Signals the process engine that a message is received and starts a new ProcessInstance.

        See startProcessInstanceByMessage(String, String). 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 instance
        Returns:
        the ProcessInstance object representing the started process instance
        Throws:
        ProcessEngineException - if no subscription to a message with the given name exists for the specified version of process definition.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
        Since:
        7.3
      • startProcessInstanceByMessageAndProcessDefinitionId

        ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId​(java.lang.String messageName,
                                                                            java.lang.String processDefinitionId,
                                                                            java.util.Map<java.lang.String,​java.lang.Object> processVariables)

        Signals the process engine that a message is received and starts a new ProcessInstance.

        See startProcessInstanceByMessage(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.
        processVariables - the 'payload' of the message. The variables are added as processes variables to the started process instance.
        Returns:
        the ProcessInstance object representing the started process instance
        Throws:
        ProcessEngineException - if no subscription to a message with the given name exists for the specified version of process definition.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
        Since:
        7.3
      • startProcessInstanceByMessageAndProcessDefinitionId

        ProcessInstance startProcessInstanceByMessageAndProcessDefinitionId​(java.lang.String messageName,
                                                                            java.lang.String processDefinitionId,
                                                                            java.lang.String businessKey,
                                                                            java.util.Map<java.lang.String,​java.lang.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 instance
        processVariables - the 'payload' of the message. The variables are added as processes variables to the started process instance.
        Returns:
        the ProcessInstance object representing the started process instance
        Throws:
        ProcessEngineException - if no subscription to a message with the given name exists for the specified version of process definition.
        AuthorizationException - if the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
        Since:
        7.3
      • deleteProcessInstancesAsync

        Batch deleteProcessInstancesAsync​(java.util.List<java.lang.String> processInstanceIds,
                                          ProcessInstanceQuery processInstanceQuery,
                                          java.lang.String deleteReason)
        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.
        Throws:
        BadUserRequestException - when no process instance is found with the given id or id is null.
        AuthorizationException - If the user has no Permissions.CREATE or BatchPermissions.CREATE_BATCH_DELETE_RUNNING_PROCESS_INSTANCES permission on Resources.BATCH.
      • deleteProcessInstancesAsync

        Batch deleteProcessInstancesAsync​(java.util.List<java.lang.String> processInstanceIds,
                                          ProcessInstanceQuery processInstanceQuery,
                                          java.lang.String deleteReason,
                                          boolean skipCustomListeners)
        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 instances
        Throws:
        BadUserRequestException - when no process instance is found with the given id or id is null.
        AuthorizationException - If the user has no Permissions.CREATE or BatchPermissions.CREATE_BATCH_DELETE_RUNNING_PROCESS_INSTANCES permission on Resources.BATCH.
      • deleteProcessInstancesAsync

        Batch deleteProcessInstancesAsync​(java.util.List<java.lang.String> processInstanceIds,
                                          ProcessInstanceQuery processInstanceQuery,
                                          java.lang.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 instances
        skipSubprocesses - skips subprocesses when removing instances
        Throws:
        BadUserRequestException - when no process instance is found with the given id or id is null.
        AuthorizationException - If the user has no Permissions.CREATE or BatchPermissions.CREATE_BATCH_DELETE_RUNNING_PROCESS_INSTANCES permission on Resources.BATCH.
      • deleteProcessInstancesAsync

        Batch deleteProcessInstancesAsync​(java.util.List<java.lang.String> processInstanceIds,
                                          ProcessInstanceQuery processInstanceQuery,
                                          HistoricProcessInstanceQuery historicProcessInstanceQuery,
                                          java.lang.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.
        processInstanceQuery - query that will be used to fetch affected process instances.
        historicProcessInstanceQuery - query that will be used to fetch affected process instances based on history data.
        deleteReason - reason for deleting, which will be stored in the history. Can be null.
        skipCustomListeners - skips custom execution listeners when removing instances
        skipSubprocesses - skips subprocesses when removing instances
        Throws:
        BadUserRequestException - when no process instance is found with the given queries or ids.
        AuthorizationException - If the user has no Permissions.CREATE or BatchPermissions.CREATE_BATCH_DELETE_RUNNING_PROCESS_INSTANCES permission on Resources.BATCH.
      • deleteProcessInstancesAsync

        Batch deleteProcessInstancesAsync​(java.util.List<java.lang.String> processInstanceIds,
                                          java.lang.String deleteReason)
        Delete an existing runtime process instances asynchronously using Batch operation. Deletion propagates upward as far as necessary. If both process instances list and query are provided, process instances containing in both sets will be deleted.
        Parameters:
        processInstanceIds - id's of process instances to delete, cannot be null.
        deleteReason - reason for deleting, which will be stored in the history. Can be null.
        Throws:
        BadUserRequestException - when no process instance is found with the given id or id is null.
        AuthorizationException - If the user has no Permissions.CREATE or BatchPermissions.CREATE_BATCH_DELETE_RUNNING_PROCESS_INSTANCES permission on Resources.BATCH.
      • deleteProcessInstances

        void deleteProcessInstances​(java.util.List<java.lang.String> processInstanceIds,
                                    java.lang.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-in ExecutionListeners are notified with the ExecutionListener.EVENTNAME_END event.
        externallyTerminated - indicator if deletion triggered from external context, for instance REST API call
        skipSubprocesses - specifies whether subprocesses should be deleted
        Throws:
        BadUserRequestException - when a processInstanceId is null.
        NotFoundException - when no process instance is found with a given processInstanceId.
        AuthorizationException - if the user has no Permissions.DELETE permission on Resources.PROCESS_INSTANCE or no Permissions.DELETE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • deleteProcessInstancesIfExists

        void deleteProcessInstancesIfExists​(java.util.List<java.lang.String> processInstanceIds,
                                            java.lang.String deleteReason,
                                            boolean skipCustomListeners,
                                            boolean externallyTerminated,
                                            boolean skipSubprocesses)
        Delete existing runtime process instances. Deletion propagates upward as far as necessary. Does not fail if a process instance was not found.
        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-in ExecutionListeners are notified with the ExecutionListener.EVENTNAME_END event.
        externallyTerminated - indicator if deletion triggered from external context, for instance REST API call
        skipSubprocesses - specifies whether subprocesses should be deleted
        Throws:
        BadUserRequestException - when a processInstanceId is null.
        AuthorizationException - if the user has no Permissions.DELETE permission on Resources.PROCESS_INSTANCE or no Permissions.DELETE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • deleteProcessInstance

        void deleteProcessInstance​(java.lang.String processInstanceId,
                                   java.lang.String deleteReason,
                                   boolean skipCustomListeners,
                                   boolean externallyTerminated,
                                   boolean skipIoMappings)
        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-in ExecutionListeners are notified with the ExecutionListener.EVENTNAME_END event.
        externallyTerminated - indicator if deletion triggered from external context, for instance REST API call
        skipIoMappings - specifies whether input/output mappings for tasks should be invoked
        Throws:
        BadUserRequestException - when the processInstanceId is null.
        NotFoundException - when no process instance is found with the given processInstanceId.
        AuthorizationException - if the user has no Permissions.DELETE permission on Resources.PROCESS_INSTANCE or no Permissions.DELETE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • deleteProcessInstance

        void deleteProcessInstance​(java.lang.String processInstanceId,
                                   java.lang.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-in ExecutionListeners are notified with the ExecutionListener.EVENTNAME_END event.
        externallyTerminated - indicator if deletion triggered from external context, for instance REST API call
        skipIoMappings - specifies whether input/output mappings for tasks should be invoked
        skipSubprocesses - specifies whether subprocesses should be deleted
        Throws:
        BadUserRequestException - when the processInstanceId is null.
        NotFoundException - when no process instance is found with the given processInstanceId.
        AuthorizationException - if the user has no Permissions.DELETE permission on Resources.PROCESS_INSTANCE or no Permissions.DELETE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • deleteProcessInstanceIfExists

        void deleteProcessInstanceIfExists​(java.lang.String processInstanceId,
                                           java.lang.String deleteReason,
                                           boolean skipCustomListeners,
                                           boolean externallyTerminated,
                                           boolean skipIoMappings,
                                           boolean skipSubprocesses)
        Delete an existing runtime process instance. Deletion propagates upward as far as necessary. Does not fail if a process instance was not found.
        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-in ExecutionListeners are notified with the ExecutionListener.EVENTNAME_END event.
        externallyTerminated - indicator if deletion triggered from external context, for instance REST API call
        skipIoMappings - specifies whether input/output mappings for tasks should be invoked
        skipSubprocesses - specifies whether subprocesses should be deleted
        Throws:
        BadUserRequestException - when processInstanceId is null.
        AuthorizationException - if the user has no Permissions.DELETE permission on Resources.PROCESS_INSTANCE or no Permissions.DELETE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • getActivityInstance

        ActivityInstance getActivityInstance​(java.lang.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 Execution concept in the process engine is not completely aligned with the activity instance concept because the execution tree is in general not aligned with the activity / scope concept in BPMN. In general, there is a n-1 relationship between Executions and ActivityInstances, ie. at a given point in time, an activity instance can be linked to multiple executions. In addition, it is not guaranteed that the same execution that started a given activity instance will also end it. The process engine performs several internal optimizations concerning the compacting of the execution tree which might lead to executions being reordered and pruned. This can lead to situations where a given execution starts an activity instance but another execution ends it. Another special case is the process instance: if the process instance is executing a non-scope activity (for example a user task) below the process definition scope, it will be referenced by both the root activity instance and the user task activity instance.

        If you need to interpret the state of a process instance in terms of a BPMN process model, it is usually easier to use the activity instance tree as opposed to the execution tree.

        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:
        ProcessEngineException - if processInstanceId is 'null' or an internal error occurs.
        AuthorizationException - if the user has no Permissions.READ permission on Resources.PROCESS_INSTANCE or no Permissions.READ_INSTANCE permission on Resources.PROCESS_DEFINITION.
        Since:
        7.0
      • signal

        void signal​(java.lang.String executionId,
                    java.lang.String signalName,
                    java.lang.Object signalData,
                    java.util.Map<java.lang.String,​java.lang.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:
        ProcessEngineException - when no execution is found for the given executionId.
        AuthorizationException - if the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • getVariables

        java.util.Map<java.lang.String,​java.lang.Object> getVariables​(java.lang.String executionId,
                                                                            java.util.Collection<java.lang.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:
        ProcessEngineException - when no execution is found for the given executionId.
        AuthorizationException -
      • if the user has no Permissions.READ permission on Resources.PROCESS_INSTANCE or no Permissions.READ_INSTANCE permission on Resources.PROCESS_DEFINITION
      • In case this config is enabled and the user has no ProcessDefinitionPermisions#READ_INSTANCE_VARIABLE permission on Resources.PROCESS_DEFINITION
      • getVariablesTyped

        VariableMap getVariablesTyped​(java.lang.String executionId,
                                      java.util.Collection<java.lang.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.
        deserializeObjectValues - if false, SerializableValues will not be deserialized
        Returns:
        the variables or an empty map if no such variables are found.
        Throws:
        ProcessEngineException - when no execution is found for the given executionId.
        AuthorizationException -
      • if the user has no Permissions.READ permission on Resources.PROCESS_INSTANCE or no Permissions.READ_INSTANCE permission on Resources.PROCESS_DEFINITION
      • In case this config is enabled and the user has no ProcessDefinitionPermisions#READ_INSTANCE_VARIABLE permission on Resources.PROCESS_DEFINITION
      • Since:
        7.2
      • getVariablesLocal

        java.util.Map<java.lang.String,​java.lang.Object> getVariablesLocal​(java.lang.String executionId,
                                                                                 java.util.Collection<java.lang.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:
        ProcessEngineException - when no execution is found for the given executionId.
        AuthorizationException -
      • if the user has no Permissions.READ permission on Resources.PROCESS_INSTANCE or no Permissions.READ_INSTANCE permission on Resources.PROCESS_DEFINITION
      • In case this config is enabled and the user has no ProcessDefinitionPermisions#READ_INSTANCE_VARIABLE permission on Resources.PROCESS_DEFINITION
      • getVariablesLocalTyped

        VariableMap getVariablesLocalTyped​(java.lang.String executionId,
                                           java.util.Collection<java.lang.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.
        deserializeObjectValues - if false, SerializableValues will not be deserialized
        Returns:
        the variables or an empty map if no such variables are found.
        Throws:
        ProcessEngineException - when no execution is found for the given executionId.
        AuthorizationException -
      • if the user has no Permissions.READ permission on Resources.PROCESS_INSTANCE or no Permissions.READ_INSTANCE permission on Resources.PROCESS_DEFINITION
      • In case this config is enabled and the user has no ProcessDefinitionPermisions#READ_INSTANCE_VARIABLE permission on Resources.PROCESS_DEFINITION
      • Since:
        7.2
      • getVariable

        java.lang.Object getVariable​(java.lang.String executionId,
                                     java.lang.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:
        ProcessEngineException - when no execution is found for the given executionId.
        AuthorizationException -
      • if the user has no Permissions.READ permission on Resources.PROCESS_INSTANCE or no Permissions.READ_INSTANCE permission on Resources.PROCESS_DEFINITION
      • In case this config is enabled and the user has no ProcessDefinitionPermisions#READ_INSTANCE_VARIABLE permission on Resources.PROCESS_DEFINITION
      • getVariableTyped

        <T extends TypedValue> T getVariableTyped​(java.lang.String executionId,
                                                  java.lang.String variableName)
        Returns a TypedValue for the variable. Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no variable value is found with the given name.
        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.
        Throws:
        ProcessEngineException - when no execution is found for the given executionId.
        AuthorizationException -
      • if the user has no Permissions.READ permission on Resources.PROCESS_INSTANCE or no Permissions.READ_INSTANCE permission on Resources.PROCESS_DEFINITION
      • In case this config is enabled and the user has no ProcessDefinitionPermisions#READ_INSTANCE_VARIABLE permission on Resources.PROCESS_DEFINITION
      • Since:
        7.2
      • getVariableTyped

        <T extends TypedValue> T getVariableTyped​(java.lang.String executionId,
                                                  java.lang.String variableName,
                                                  boolean deserializeValue)
        Returns a TypedValue for the variable. Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no variable value is found with the given name.
        Parameters:
        executionId - id of process instance or execution, cannot be null.
        variableName - name of variable, cannot be null.
        deserializeValue - if false, a SerializableValue will not be deserialized
        Returns:
        the variable value or null if the variable is undefined.
        Throws:
        ProcessEngineException - when no execution is found for the given executionId.
        AuthorizationException -
      • if the user has no Permissions.READ permission on Resources.PROCESS_INSTANCE or no Permissions.READ_INSTANCE permission on Resources.PROCESS_DEFINITION
      • In case this config is enabled and the user has no ProcessDefinitionPermisions#READ_INSTANCE_VARIABLE permission on Resources.PROCESS_DEFINITION
      • Since:
        7.2
      • getVariableLocal

        java.lang.Object getVariableLocal​(java.lang.String executionId,
                                          java.lang.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:
        ProcessEngineException - when no execution is found for the given executionId.
        AuthorizationException -
      • if the user has no Permissions.READ permission on Resources.PROCESS_INSTANCE or no Permissions.READ_INSTANCE permission on Resources.PROCESS_DEFINITION
      • In case this config is enabled and the user has no ProcessDefinitionPermisions#READ_INSTANCE_VARIABLE permission on Resources.PROCESS_DEFINITION
      • getVariableLocalTyped

        <T extends TypedValue> T getVariableLocalTyped​(java.lang.String executionId,
                                                       java.lang.String variableName,
                                                       boolean deserializeValue)
        Returns a TypedValue for the variable. Searching for the variable is done in all scopes that are visible to the given execution (and not searching parent scopes). Returns null when no variable value is found with the given name.
        Parameters:
        executionId - id of process instance or execution, cannot be null.
        variableName - name of variable, cannot be null.
        deserializeValue - if false, a SerializableValue will not be deserialized
        Returns:
        the variable value or null if the variable is undefined.
        Throws:
        ProcessEngineException - when no execution is found for the given executionId.
        AuthorizationException -
      • if the user has no Permissions.READ permission on Resources.PROCESS_INSTANCE or no Permissions.READ_INSTANCE permission on Resources.PROCESS_DEFINITION
      • In case this config is enabled and the user has no ProcessDefinitionPermisions#READ_INSTANCE_VARIABLE permission on Resources.PROCESS_DEFINITION
      • Since:
        7.2
      • setVariablesAsync

        Batch setVariablesAsync​(java.util.List<java.lang.String> processInstanceIds,
                                ProcessInstanceQuery processInstanceQuery,
                                HistoricProcessInstanceQuery historicProcessInstanceQuery,
                                java.util.Map<java.lang.String,​?> variables)
        Update or create runtime process variables in the root scope of process instances.
        Parameters:
        processInstanceIds - related to the process instances the variables will be set on; cannot be null when processInstanceQuery and historicProcessInstanceQuery are null.
        processInstanceQuery - to select process instances; Cannot be null when processInstanceIds and historicProcessInstanceQuery are null.
        historicProcessInstanceQuery - to select process instances; Cannot be null when processInstanceIds and processInstanceQuery are null.
        variables - that will be set to the root scope of the process instances
        Returns:
        the batch which sets the variables asynchronously.
        Throws:
        NullValueException -
        • when variables is null
        • when processInstanceIds, processInstanceQuery and historicProcessInstanceQuery are null
        BadUserRequestException -
        • when variables is empty
        • when no process instance ids were found
        • when a transient variable is set
        ProcessEngineException - when the java serialization format is prohibited
        AuthorizationException - when the user has no BatchPermissions.CREATE or BatchPermissions.CREATE_BATCH_SET_VARIABLES permission on Resources.BATCH.
      • setVariablesAsync

        Batch setVariablesAsync​(java.util.List<java.lang.String> processInstanceIds,
                                java.util.Map<java.lang.String,​?> variables)
        Update or create runtime process variables in the root scope of process instances.
        Parameters:
        processInstanceIds - related to the process instances the variables will be set on
        variables - that will be set to the root scope of the process instances
        Returns:
        the batch which sets the variables asynchronously.
        Throws:
        NullValueException -
        • when variables is null
        • when processInstanceIds is null
        BadUserRequestException -
        • when variables is empty
        • when no process instance ids were found
        • when a transient variable is set
        ProcessEngineException - when the java serialization format is prohibited
        AuthorizationException - when the user has no BatchPermissions.CREATE or BatchPermissions.CREATE_BATCH_SET_VARIABLES permission on Resources.BATCH.
      • createExecutionQuery

        ExecutionQuery createExecutionQuery()
        Creates a new ExecutionQuery instance, that can be used to query the executions and process instances.
      • createIncidentQuery

        IncidentQuery createIncidentQuery()
        Creates a new IncidentQuery instance, that can be used to query incidents.
      • signalEventReceived

        void signalEventReceived​(java.lang.String signalName,
                                 java.lang.String executionId)
        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 event
        executionId - id of the process instance or the execution to deliver the signal to
        Throws:
        ProcessEngineException - if no such execution exists or if the execution has not subscribed to the signal
        AuthorizationException - if the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • signalEventReceived

        void signalEventReceived​(java.lang.String signalName,
                                 java.lang.String executionId,
                                 java.util.Map<java.lang.String,​java.lang.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 event
        executionId - the id of the process instance or the execution to deliver the signal to
        processVariables - a map of variables added to the execution(s)
        Throws:
        ProcessEngineException - if no such execution exists or if the execution has not subscribed to the signal
        AuthorizationException - if the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • createSignalEvent

        SignalEventReceivedBuilder createSignalEvent​(java.lang.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

        void messageEventReceived​(java.lang.String messageName,
                                  java.lang.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'. 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 event
        executionId - the id of the process instance or the execution to deliver the message to
        Throws:
        ProcessEngineException - if no such execution exists or if the execution has not subscribed to the signal
        AuthorizationException - if the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • messageEventReceived

        void messageEventReceived​(java.lang.String messageName,
                                  java.lang.String executionId,
                                  java.util.Map<java.lang.String,​java.lang.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 event
        executionId - the id of the process instance or the execution to deliver the message to
        processVariables - a map of variables added to the execution
        Throws:
        ProcessEngineException - if no such execution exists or if the execution has not subscribed to the signal
        AuthorizationException - if the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • createMessageCorrelation

        MessageCorrelationBuilder createMessageCorrelation​(java.lang.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

        void correlateMessage​(java.lang.String messageName,
                              java.util.Map<java.lang.String,​java.lang.Object> correlationKeys)
        Correlates a message to
        • an execution that is waiting for a matching message and can be correlated according to the given correlation keys. This is typically matched against process instance variables.
        • a process definition that can be started by message with the provided name.
        Notification and instantiation happen synchronously.
        Parameters:
        messageName - the name of the message event; if null, matches any event
        correlationKeys - a map of key value pairs that are used to correlate the message to an execution
        Throws:
        MismatchingMessageCorrelationException - if none or more than one execution or process definition is correlated
        ProcessEngineException - if messageName is null and correlationKeys is null
        AuthorizationException - if the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • correlateMessage

        void correlateMessage​(java.lang.String messageName,
                              java.lang.String businessKey,
                              java.util.Map<java.lang.String,​java.lang.Object> processVariables)
        Correlates a message to
        • an execution that is waiting for a matching message and belongs to a process instance with the given business key
        • a process definition that can be started by this message.
        and updates the process instance variables. Notification and instantiation happen synchronously.
        Parameters:
        messageName - the name of the message event; if null, matches any event
        businessKey - the business key of process instances to correlate against
        processVariables - a map of variables added to the execution or newly created process instance
        Throws:
        MismatchingMessageCorrelationException - if none or more than one execution or process definition is correlated
        ProcessEngineException - if messageName is null and businessKey is null
        AuthorizationException - if the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • correlateMessage

        void correlateMessage​(java.lang.String messageName,
                              java.util.Map<java.lang.String,​java.lang.Object> correlationKeys,
                              java.util.Map<java.lang.String,​java.lang.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.
        • a process definition that can be started by this message.
        and updates the process instance variables. Notification and instantiation happen synchronously.
        Parameters:
        messageName - the name of the message event; if null, matches any event
        correlationKeys - a map of key value pairs that are used to correlate the message to an execution
        processVariables - a map of variables added to the execution or newly created process instance
        Throws:
        MismatchingMessageCorrelationException - if none or more than one execution or process definition is correlated
        ProcessEngineException - if messageName is null and correlationKeys is null
        AuthorizationException - if the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • correlateMessage

        void correlateMessage​(java.lang.String messageName,
                              java.lang.String businessKey,
                              java.util.Map<java.lang.String,​java.lang.Object> correlationKeys,
                              java.util.Map<java.lang.String,​java.lang.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.
        and updates the process instance variables. Notification and instantiation happen synchronously.
        Parameters:
        messageName - the name of the message event; if null, matches any event
        businessKey - the business key of process instances to correlate against
        correlationKeys - a map of key value pairs that are used to correlate the message to an execution
        processVariables - a map of variables added to the execution or newly created process instance
        Throws:
        MismatchingMessageCorrelationException - if none or more than one execution or process definition is correlated
        ProcessEngineException - if messageName is null and businessKey is null and correlationKeys is null
        AuthorizationException - if the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION.
      • createMessageCorrelationAsync

        MessageCorrelationAsyncBuilder createMessageCorrelationAsync​(java.lang.String messageName)
        Define a complex asynchronous 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 only.
        Returns:
        the fluent builder for defining the asynchronous message correlation.
      • createProcessInstanceModification

        ProcessInstanceModificationBuilder createProcessInstanceModification​(java.lang.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
      • createProcessInstanceById

        ProcessInstantiationBuilder createProcessInstanceById​(java.lang.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 be null.
        Returns:
        a builder to create a process instance of the definition
      • createProcessInstanceByKey

        ProcessInstantiationBuilder createProcessInstanceByKey​(java.lang.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 be null.
        Returns:
        a builder to create a process instance of the definition
      • createMigrationPlan

        MigrationPlanBuilder createMigrationPlan​(java.lang.String sourceProcessDefinitionId,
                                                 java.lang.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 from
        targetProcessDefinitionId - the process definition that instances are migrated to
        Returns:
        a fluent builder
      • newMigration

        MigrationPlanExecutionBuilder newMigration​(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 Batch is immediately returned. The migration is then executed as jobs from the process engine and the batch can be used to track the progress of the migration. The Batch splits the migration in smaller chunks which will be executed independently.
        Parameters:
        migrationPlan - the migration plan to executed
        Returns:
        a fluent builder
      • createModification

        ModificationBuilder createModification​(java.lang.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 Batch is immediately returned. The modification is then executed as jobs from the process engine and the batch can be used to track the progress of the modification. The Batch splits the modification in smaller chunks which will be executed independently.
        Parameters:
        processDefinitionId - the process definition that instances are modified of
        Returns:
        a fluent builder
      • createConditionEvaluation

        ConditionEvaluationBuilder createConditionEvaluation()
        Define a complex condition evaluation using a fluent builder.
        Returns:
        the fluent builder for defining the condition evaluation.