Class CaseServiceImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      CaseServiceImpl()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void closeCaseInstance​(java.lang.String caseInstanceId)
      Closes the case instance the execution identified by the given id belongs to.
      void completeCaseExecution​(java.lang.String caseExecutionId)
      Completes the case execution identified by the given id.
      void completeCaseExecution​(java.lang.String caseExecutionId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Completes the case execution identified by the given id.
      CaseExecutionQuery createCaseExecutionQuery()
      Creates a new CaseExecutionQuery instance, that can be used to query the executions and case instances.
      CaseInstance createCaseInstanceById​(java.lang.String caseDefinitionId)
      Creates a new CaseInstance in the exactly specified version identify by the provided process definition id.
      CaseInstance createCaseInstanceById​(java.lang.String caseDefinitionId, java.lang.String businessKey)
      Creates a new CaseInstance in the exactly specified version identify by the provided process definition id.
      CaseInstance createCaseInstanceById​(java.lang.String caseDefinitionId, java.lang.String businessKey, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Creates a new CaseInstance in the exactly specified version identify by the provided process definition id.
      CaseInstance createCaseInstanceById​(java.lang.String caseDefinitionId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Creates a new CaseInstance in the exactly specified version identify by the provided process definition id.
      CaseInstance createCaseInstanceByKey​(java.lang.String caseDefinitionKey)
      Creates a new CaseInstance of the latest version of the case definition with the given key.
      CaseInstance createCaseInstanceByKey​(java.lang.String caseDefinitionKey, java.lang.String businessKey)
      Creates a new CaseInstance of the latest version of the case definition with the given key.
      CaseInstance createCaseInstanceByKey​(java.lang.String caseDefinitionKey, java.lang.String businessKey, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Creates a new CaseInstance of the latest version of the case definition with the given key.
      CaseInstance createCaseInstanceByKey​(java.lang.String caseDefinitionKey, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Creates a new CaseInstance of the latest version of the case definition with the given key.
      CaseInstanceQuery createCaseInstanceQuery()
      Creates a new CaseInstanceQuery instance, that can be used to query case instances.
      void disableCaseExecution​(java.lang.String caseExecutionId)
      Disables the case execution identified by the given id.
      void disableCaseExecution​(java.lang.String caseExecutionId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Disables the case execution identified by the given id.
      protected java.lang.Object getCaseExecutionVariable​(java.lang.String caseExecutionId, java.lang.String variableName, boolean isLocal)  
      protected VariableMap getCaseExecutionVariables​(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames, boolean isLocal, boolean deserializeValues)  
      protected <T extends TypedValue>
      T
      getCaseExecutionVariableTyped​(java.lang.String caseExecutionId, java.lang.String variableName, boolean isLocal, boolean deserializeValue)  
      java.lang.Object getVariable​(java.lang.String caseExecutionId, java.lang.String variableName)
      Searching for the variable is done in all scopes that are visible to the given case execution (including parent scopes).
      java.lang.Object getVariableLocal​(java.lang.String caseExecutionId, java.lang.String variableName)
      The variable value for an case execution.
      <T extends TypedValue>
      T
      getVariableLocalTyped​(java.lang.String caseExecutionId, java.lang.String variableName)
      The variable value for an case execution.
      <T extends TypedValue>
      T
      getVariableLocalTyped​(java.lang.String caseExecutionId, java.lang.String variableName, boolean deserializeValue)
      The variable value for an case execution.
      VariableMap getVariables​(java.lang.String caseExecutionId)
      All variables visible from the given execution scope (including parent scopes).
      VariableMap getVariables​(java.lang.String caseExecutionId, 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 case execution scope (including parent scopes).
      VariableMap getVariablesLocal​(java.lang.String caseExecutionId)
      All variable values that are defined in the case execution scope, without taking outer scopes into account.
      VariableMap getVariablesLocal​(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames)
      The variable values for the given variableNames only taking the given case execution scope into account, not looking in outer scopes.
      VariableMap getVariablesLocalTyped​(java.lang.String caseExecutionId)
      All variable values that are defined in the case execution scope, without taking outer scopes into account.
      VariableMap getVariablesLocalTyped​(java.lang.String caseExecutionId, boolean deserializeValues)
      All variable values that are defined in the case execution scope, without taking outer scopes into account.
      VariableMap getVariablesLocalTyped​(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames, boolean deserializeValues)
      The variable values for the given variableNames only taking the given case execution scope into account, not looking in outer scopes.
      VariableMap getVariablesTyped​(java.lang.String caseExecutionId)
      All variables visible from the given execution scope (including parent scopes).
      VariableMap getVariablesTyped​(java.lang.String caseExecutionId, boolean deserializeValues)
      All variables visible from the given execution scope (including parent scopes).
      VariableMap getVariablesTyped​(java.lang.String caseExecutionId, 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 case execution scope (including parent scopes).
      <T extends TypedValue>
      T
      getVariableTyped​(java.lang.String caseExecutionId, java.lang.String variableName)
      Searching for the variable is done in all scopes that are visible to the given case execution (including parent scopes).
      <T extends TypedValue>
      T
      getVariableTyped​(java.lang.String caseExecutionId, java.lang.String variableName, boolean deserializeValue)
      Searching for the variable is done in all scopes that are visible to the given case execution (including parent scopes).
      void manuallyStartCaseExecution​(java.lang.String caseExecutionId)
      Starts the case execution identified by the given id manually.
      void manuallyStartCaseExecution​(java.lang.String caseExecutionId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Starts the case execution identified by the given id manually.
      void reenableCaseExecution​(java.lang.String caseExecutionId)
      Re-enables the case execution identified by the given id.
      void reenableCaseExecution​(java.lang.String caseExecutionId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Re-enables the case execution identified by the given id.
      void removeVariable​(java.lang.String caseExecutionId, java.lang.String variableName)
      Pass a name of a variable to be removed from a case execution.
      void removeVariableLocal​(java.lang.String caseExecutionId, java.lang.String variableName)
      Pass a variable name of a local variable to be removed from a case execution (not considering parent scopes).
      void removeVariables​(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames)
      Pass a collection of names identifying variables to be removed from a case execution.
      void removeVariablesLocal​(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames)
      Pass a collection of names identifying local variables to be removed from a case execution (not considering parent scopes).
      void setVariable​(java.lang.String caseExecutionId, java.lang.String variableName, java.lang.Object value)
      Pass a variable to the case execution.
      void setVariableLocal​(java.lang.String caseExecutionId, java.lang.String variableName, java.lang.Object value)
      Pass a local variable to the case execution (not considering parent scopes).
      void setVariables​(java.lang.String caseExecutionId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Pass a map of variables to the case execution.
      void setVariablesLocal​(java.lang.String caseExecutionId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Pass a map of variables to the case execution (not considering parent scopes).
      void terminateCaseExecution​(java.lang.String caseExecutionId)
      Terminates the case execution identified by the given id.
      void terminateCaseExecution​(java.lang.String caseExecutionId, java.util.Map<java.lang.String,​java.lang.Object> variables)
      Terminates the case execution identified by the given id.
      CaseInstanceBuilder withCaseDefinition​(java.lang.String caseDefinitionId)
      Define a CaseInstance using a fluent builder.
      CaseInstanceBuilder withCaseDefinitionByKey​(java.lang.String caseDefinitionKey)
      Define a CaseInstance using a fluent builder.
      CaseExecutionCommandBuilder withCaseExecution​(java.lang.String caseExecutionId)
      Define a command to be executed for a CaseExecution using a fluent builder.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CaseServiceImpl

        public CaseServiceImpl()
    • Method Detail

      • withCaseDefinitionByKey

        public CaseInstanceBuilder withCaseDefinitionByKey​(java.lang.String caseDefinitionKey)
        Description copied from interface: CaseService

        Define a CaseInstance using a fluent builder.

        Starts a new case instance with the latest version of the corresponding case definition.

        Specified by:
        withCaseDefinitionByKey in interface CaseService
        Parameters:
        caseDefinitionKey - the key of a case definition to create a new case instance of, cannot be null
        Returns:
        a fluent builder for defining a new case instance
      • withCaseDefinition

        public CaseInstanceBuilder withCaseDefinition​(java.lang.String caseDefinitionId)
        Description copied from interface: CaseService

        Define a CaseInstance using a fluent builder.

        Starts a new case instance with the case definition version corresponding to the given id.

        Specified by:
        withCaseDefinition in interface CaseService
        Parameters:
        caseDefinitionId - the id of a case definition to create a new case instance, cannot be null
        Returns:
        a fluent builder for defining a new case instance
      • getVariables

        public VariableMap getVariables​(java.lang.String caseExecutionId)
        Description copied from interface: CaseService

        All variables visible from the given execution scope (including parent scopes).

        If you have many local variables and you only need a few, consider using CaseService.getVariables(String, Collection) for better performance.

        Specified by:
        getVariables in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case execution, cannot be null
        Returns:
        the variables or an empty map if no such variables are found
      • getVariablesTyped

        public VariableMap getVariablesTyped​(java.lang.String caseExecutionId)
        Description copied from interface: CaseService

        All variables visible from the given execution scope (including parent scopes).

        If you have many local variables and you only need a few, consider using CaseService.getVariables(String, Collection) for better performance.

        Specified by:
        getVariablesTyped in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case execution, cannot be null
        Returns:
        the variables or an empty map if no such variables are found
      • getVariablesTyped

        public VariableMap getVariablesTyped​(java.lang.String caseExecutionId,
                                             boolean deserializeValues)
        Description copied from interface: CaseService

        All variables visible from the given execution scope (including parent scopes).

        If you have many local variables and you only need a few, consider using CaseService.getVariables(String, Collection) for better performance.

        Specified by:
        getVariablesTyped in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case execution, cannot be null
        deserializeValues - if false, the process engine will not attempt to deserialize SerializableValues.
        Returns:
        the variables or an empty map if no such variables are found
      • getVariablesLocal

        public VariableMap getVariablesLocal​(java.lang.String caseExecutionId)
        Description copied from interface: CaseService

        All variable values that are defined in the case execution scope, without taking outer scopes into account.

        If you have many local variables and you only need a few, consider using CaseService.getVariablesLocal(String, Collection) for better performance.

        Specified by:
        getVariablesLocal in interface CaseService
        Parameters:
        caseExecutionId - the id of a case execution, cannot be null
        Returns:
        the variables or an empty map if no such variables are found
      • getVariablesLocalTyped

        public VariableMap getVariablesLocalTyped​(java.lang.String caseExecutionId)
        Description copied from interface: CaseService

        All variable values that are defined in the case execution scope, without taking outer scopes into account.

        If you have many local variables and you only need a few, consider using CaseService.getVariablesLocal(String, Collection) for better performance.

        Specified by:
        getVariablesLocalTyped in interface CaseService
        Parameters:
        caseExecutionId - the id of a case execution, cannot be null
        Returns:
        the variables or an empty map if no such variables are found
      • getVariablesLocalTyped

        public VariableMap getVariablesLocalTyped​(java.lang.String caseExecutionId,
                                                  boolean deserializeValues)
        Description copied from interface: CaseService

        All variable values that are defined in the case execution scope, without taking outer scopes into account.

        If you have many local variables and you only need a few, consider using CaseService.getVariablesLocal(String, Collection) for better performance.

        Specified by:
        getVariablesLocalTyped in interface CaseService
        Parameters:
        caseExecutionId - the id of a case execution, cannot be null
        deserializeValues - if false, the process engine will not attempt to deserialize SerializableValues.
        Returns:
        the variables or an empty map if no such variables are found
      • getVariables

        public VariableMap getVariables​(java.lang.String caseExecutionId,
                                        java.util.Collection<java.lang.String> variableNames)
        Description copied from interface: CaseService

        The variable values for all given variableNames, takes all variables into account which are visible from the given case execution scope (including parent scopes).

        Specified by:
        getVariables in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case 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
      • getVariablesTyped

        public VariableMap getVariablesTyped​(java.lang.String caseExecutionId,
                                             java.util.Collection<java.lang.String> variableNames,
                                             boolean deserializeValues)
        Description copied from interface: CaseService

        The variable values for all given variableNames, takes all variables into account which are visible from the given case execution scope (including parent scopes).

        Specified by:
        getVariablesTyped in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case execution, cannot be null
        variableNames - the collection of variable names that should be retrieved
        deserializeValues - if false, SerializableValues will not be deserialized
        Returns:
        the variables or an empty map if no such variables are found
      • getVariablesLocal

        public VariableMap getVariablesLocal​(java.lang.String caseExecutionId,
                                             java.util.Collection<java.lang.String> variableNames)
        Description copied from interface: CaseService

        The variable values for the given variableNames only taking the given case execution scope into account, not looking in outer scopes.

        Specified by:
        getVariablesLocal in interface CaseService
        Parameters:
        caseExecutionId - the id of a case 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
      • getVariablesLocalTyped

        public VariableMap getVariablesLocalTyped​(java.lang.String caseExecutionId,
                                                  java.util.Collection<java.lang.String> variableNames,
                                                  boolean deserializeValues)
        Description copied from interface: CaseService

        The variable values for the given variableNames only taking the given case execution scope into account, not looking in outer scopes.

        Specified by:
        getVariablesLocalTyped in interface CaseService
        Parameters:
        caseExecutionId - the id of a case execution, cannot be null
        variableNames - the collection of variable names that should be retrieved
        deserializeValues - if false, the process engine will not attempt to deserialize SerializableValues.
        Returns:
        the variables or an empty map if no such variables are found
      • getCaseExecutionVariables

        protected VariableMap getCaseExecutionVariables​(java.lang.String caseExecutionId,
                                                        java.util.Collection<java.lang.String> variableNames,
                                                        boolean isLocal,
                                                        boolean deserializeValues)
      • getVariable

        public java.lang.Object getVariable​(java.lang.String caseExecutionId,
                                            java.lang.String variableName)
        Description copied from interface: CaseService

        Searching for the variable is done in all scopes that are visible to the given case execution (including parent scopes).

        Returns null when no variable value is found with the given name or when the value is set to null.

        Specified by:
        getVariable in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case execution, cannot be null
        variableName - the name of a variable, cannot be null
        Returns:
        the variable value or null if the variable is undefined or the value of the variable is null
      • getVariableLocal

        public java.lang.Object getVariableLocal​(java.lang.String caseExecutionId,
                                                 java.lang.String variableName)
        Description copied from interface: CaseService

        The variable value for an case execution. Returns the value when the variable is set for the case execution (and not searching parent scopes).

        Returns null when no variable value is found with the given name or when the value is set to null.

        Specified by:
        getVariableLocal in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case execution, cannot be null
        variableName - the name of a variable, cannot be null
        Returns:
        the variable value or null if the variable is undefined or the value of the variable is null
      • getCaseExecutionVariable

        protected java.lang.Object getCaseExecutionVariable​(java.lang.String caseExecutionId,
                                                            java.lang.String variableName,
                                                            boolean isLocal)
      • getVariableTyped

        public <T extends TypedValue> T getVariableTyped​(java.lang.String caseExecutionId,
                                                         java.lang.String variableName)
        Description copied from interface: CaseService

        Searching for the variable is done in all scopes that are visible to the given case execution (including parent scopes).

        Returns null when no variable value is found with the given name or when the value is set to null.

        Specified by:
        getVariableTyped in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case execution, cannot be null
        variableName - the name of a variable, cannot be null
        Returns:
        the variable value or null if the variable is undefined or the value of the variable is null
      • getVariableTyped

        public <T extends TypedValue> T getVariableTyped​(java.lang.String caseExecutionId,
                                                         java.lang.String variableName,
                                                         boolean deserializeValue)
        Description copied from interface: CaseService

        Searching for the variable is done in all scopes that are visible to the given case execution (including parent scopes).

        Returns null when no variable value is found with the given name or when the value is set to null.

        Specified by:
        getVariableTyped in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case execution, cannot be null
        variableName - the name of a variable, cannot be null
        deserializeValue - if false, SerializableValues will not be deserialized
        Returns:
        the variable value or null if the variable is undefined or the value of the variable is null
      • getVariableLocalTyped

        public <T extends TypedValue> T getVariableLocalTyped​(java.lang.String caseExecutionId,
                                                              java.lang.String variableName)
        Description copied from interface: CaseService

        The variable value for an case execution. Returns the value when the variable is set for the case execution (and not searching parent scopes).

        Returns null when no variable value is found with the given name or when the value is set to null.

        Specified by:
        getVariableLocalTyped in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case execution, cannot be null
        variableName - the name of a variable, cannot be null
        Returns:
        the variable value or null if the variable is undefined or the value of the variable is null
      • getVariableLocalTyped

        public <T extends TypedValue> T getVariableLocalTyped​(java.lang.String caseExecutionId,
                                                              java.lang.String variableName,
                                                              boolean deserializeValue)
        Description copied from interface: CaseService

        The variable value for an case execution. Returns the value when the variable is set for the case execution (and not searching parent scopes).

        Returns null when no variable value is found with the given name or when the value is set to null.

        Specified by:
        getVariableLocalTyped in interface CaseService
        Parameters:
        caseExecutionId - the id of a case instance or case execution, cannot be null
        variableName - the name of a variable, cannot be null
        deserializeValue - if false, SerializableValues will not be deserialized
        Returns:
        the variable value or null if the variable is undefined or the value of the variable is null
      • getCaseExecutionVariableTyped

        protected <T extends TypedValue> T getCaseExecutionVariableTyped​(java.lang.String caseExecutionId,
                                                                         java.lang.String variableName,
                                                                         boolean isLocal,
                                                                         boolean deserializeValue)
      • setVariables

        public void setVariables​(java.lang.String caseExecutionId,
                                 java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Pass a map of variables to the case execution. If the variables do not already exist, they are created in the case instance (which is the root execution). Otherwise existing variables are updated.

        Specified by:
        setVariables in interface CaseService
        Parameters:
        caseExecutionId - the case execution to set the variables for
        variables - the map of variables
      • setVariablesLocal

        public void setVariablesLocal​(java.lang.String caseExecutionId,
                                      java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Pass a map of variables to the case execution (not considering parent scopes).

        Specified by:
        setVariablesLocal in interface CaseService
        Parameters:
        caseExecutionId - the case execution to set the variables for
        variables - the map of variables
      • setVariable

        public void setVariable​(java.lang.String caseExecutionId,
                                java.lang.String variableName,
                                java.lang.Object value)
        Description copied from interface: CaseService

        Pass a variable to the case execution. If the variable does not already exist, it is created in the case instance (which is the root execution). Otherwise, the existing variable is updated.

        Specified by:
        setVariable in interface CaseService
        Parameters:
        caseExecutionId - the case execution to set the variable for
        variableName - the name of the variable to set
        value - the value of the variable to set
      • setVariableLocal

        public void setVariableLocal​(java.lang.String caseExecutionId,
                                     java.lang.String variableName,
                                     java.lang.Object value)
        Description copied from interface: CaseService

        Pass a local variable to the case execution (not considering parent scopes).

        Specified by:
        setVariableLocal in interface CaseService
        Parameters:
        caseExecutionId - the case execution to set the variable for
        variableName - the name of the variable to set
        value - the value of the variable to set
      • removeVariables

        public void removeVariables​(java.lang.String caseExecutionId,
                                    java.util.Collection<java.lang.String> variableNames)
        Description copied from interface: CaseService

        Pass a collection of names identifying variables to be removed from a case execution.

        Specified by:
        removeVariables in interface CaseService
        Parameters:
        caseExecutionId - the case execution to remove the variables from
        variableNames - a collection of names of variables to remove
      • removeVariablesLocal

        public void removeVariablesLocal​(java.lang.String caseExecutionId,
                                         java.util.Collection<java.lang.String> variableNames)
        Description copied from interface: CaseService

        Pass a collection of names identifying local variables to be removed from a case execution (not considering parent scopes).

        Specified by:
        removeVariablesLocal in interface CaseService
        Parameters:
        caseExecutionId - the case execution to remove the variables from
        variableNames - a collection of names of variables to remove
      • removeVariable

        public void removeVariable​(java.lang.String caseExecutionId,
                                   java.lang.String variableName)
        Description copied from interface: CaseService

        Pass a name of a variable to be removed from a case execution.

        Specified by:
        removeVariable in interface CaseService
        Parameters:
        caseExecutionId - the case execution to remove the variable from
        variableName - the name of the variable to remove
      • removeVariableLocal

        public void removeVariableLocal​(java.lang.String caseExecutionId,
                                        java.lang.String variableName)
        Description copied from interface: CaseService

        Pass a variable name of a local variable to be removed from a case execution (not considering parent scopes).

        Specified by:
        removeVariableLocal in interface CaseService
        Parameters:
        caseExecutionId - the case execution to remove the variable from
        variableName - the name of a variable to remove
      • createCaseInstanceByKey

        public CaseInstance createCaseInstanceByKey​(java.lang.String caseDefinitionKey)
        Description copied from interface: CaseService

        Creates a new CaseInstance of the latest version of the case definition with the given key. The new case instance will be in the ACTIVE state.

        Specified by:
        createCaseInstanceByKey in interface CaseService
        Parameters:
        caseDefinitionKey - the key of the case definition to instantiate
      • createCaseInstanceByKey

        public CaseInstance createCaseInstanceByKey​(java.lang.String caseDefinitionKey,
                                                    java.lang.String businessKey)
        Description copied from interface: CaseService

        Creates a new CaseInstance of the latest version of the case definition with the given key. The new case instance will be in the ACTIVE state.

        A business key can be provided to associate the case instance with a certain identifier that has a clear business meaning. This business key can then be used to easily look up that case instance, see CaseInstanceQuery.caseInstanceBusinessKey(String). Providing such a business key is definitely a best practice.

        Note that a business key MUST be unique for the given case definition WHEN you have added a database constraint for it. In this case, only case instance from different case definition are allowed to have the same business key and the combination of caseDefinitionKey-businessKey must be unique.

        Specified by:
        createCaseInstanceByKey in interface CaseService
        Parameters:
        caseDefinitionKey - the key of the case definition to instantiate
        businessKey - a key that uniquely identifies the case instance in the context of the given case definition.
      • createCaseInstanceByKey

        public CaseInstance createCaseInstanceByKey​(java.lang.String caseDefinitionKey,
                                                    java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Creates a new CaseInstance of the latest version of the case definition with the given key. The new case instance will be in the ACTIVE state.

        Specified by:
        createCaseInstanceByKey in interface CaseService
        Parameters:
        caseDefinitionKey - the key of the case definition to instantiate
        variables - variables to be set on the new case instance
      • createCaseInstanceByKey

        public CaseInstance createCaseInstanceByKey​(java.lang.String caseDefinitionKey,
                                                    java.lang.String businessKey,
                                                    java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Creates a new CaseInstance of the latest version of the case definition with the given key. The new case instance will be in the ACTIVE state.

        A business key can be provided to associate the case instance with a certain identifier that has a clear business meaning. This business key can then be used to easily look up that case instance, see CaseInstanceQuery.caseInstanceBusinessKey(String). Providing such a business key is definitely a best practice.

        Note that a business key MUST be unique for the given case definition WHEN you have added a database constraint for it. In this case, only case instance from different case definition are allowed to have the same business key and the combination of caseDefinitionKey-businessKey must be unique.

        Specified by:
        createCaseInstanceByKey in interface CaseService
        Parameters:
        caseDefinitionKey - the key of the case definition to instantiate.
        businessKey - a key that uniquely identifies the case instance in the context of the given case definition.
        variables - variables to be set on the new case instance.
      • createCaseInstanceById

        public CaseInstance createCaseInstanceById​(java.lang.String caseDefinitionId)
        Description copied from interface: CaseService

        Creates a new CaseInstance in the exactly specified version identify by the provided process definition id. The new case instance will be in the ACTIVE state.

        Specified by:
        createCaseInstanceById in interface CaseService
        Parameters:
        caseDefinitionId - the id of the case definition to instantiate
      • createCaseInstanceById

        public CaseInstance createCaseInstanceById​(java.lang.String caseDefinitionId,
                                                   java.lang.String businessKey)
        Description copied from interface: CaseService

        Creates a new CaseInstance in the exactly specified version identify by the provided process definition id. The new case instance will be in the ACTIVE state.

        A business key can be provided to associate the case instance with a certain identifier that has a clear business meaning. This business key can then be used to easily look up that case instance, see CaseInstanceQuery.caseInstanceBusinessKey(String). Providing such a business key is definitely a best practice.

        Note that a business key MUST be unique for the given case definition WHEN you have added a database constraint for it. In this case, only case instance from different case definition are allowed to have the same business key and the combination of caseDefinitionKey-businessKey must be unique.

        Specified by:
        createCaseInstanceById in interface CaseService
        Parameters:
        caseDefinitionId - the id of the case definition to instantiate
        businessKey - a key that uniquely identifies the case instance in the context of the given case definition.
      • createCaseInstanceById

        public CaseInstance createCaseInstanceById​(java.lang.String caseDefinitionId,
                                                   java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Creates a new CaseInstance in the exactly specified version identify by the provided process definition id. The new case instance will be in the ACTIVE state.

        Specified by:
        createCaseInstanceById in interface CaseService
        Parameters:
        caseDefinitionId - the id of the case definition to instantiate
        variables - variables to be set on the new case instance.
      • createCaseInstanceById

        public CaseInstance createCaseInstanceById​(java.lang.String caseDefinitionId,
                                                   java.lang.String businessKey,
                                                   java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Creates a new CaseInstance in the exactly specified version identify by the provided process definition id. The new case instance will be in the ACTIVE state.

        A business key can be provided to associate the case instance with a certain identifier that has a clear business meaning. This business key can then be used to easily look up that case instance, see CaseInstanceQuery.caseInstanceBusinessKey(String). Providing such a business key is definitely a best practice.

        Note that a business key MUST be unique for the given case definition WHEN you have added a database constraint for it. In this case, only case instance from different case definition are allowed to have the same business key and the combination of caseDefinitionKey-businessKey must be unique.

        Specified by:
        createCaseInstanceById in interface CaseService
        Parameters:
        caseDefinitionId - the id of the case definition to instantiate
        businessKey - a key that uniquely identifies the case instance in the context of the given case definition.
        variables - variables to be set on the new case instance.
      • manuallyStartCaseExecution

        public void manuallyStartCaseExecution​(java.lang.String caseExecutionId)
        Description copied from interface: CaseService

        Starts the case execution identified by the given id manually. Performs the transition from state ENABLED to state ACTIVE.

        According to CMMN 1.0 specification, the state ACTIVE means that the Stage or Task related to the case execution does the following:

        Specified by:
        manuallyStartCaseExecution in interface CaseService
        Parameters:
        caseExecutionId - the id of the case execution to manually start
      • manuallyStartCaseExecution

        public void manuallyStartCaseExecution​(java.lang.String caseExecutionId,
                                               java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Starts the case execution identified by the given id manually. Performs a transition from state ENABLED to state ACTIVE.

        According to CMMN 1.0 specification, the state ACTIVE means that the Stage or Task related to the case execution does the following:

        Specified by:
        manuallyStartCaseExecution in interface CaseService
        Parameters:
        caseExecutionId - the id of the case execution to manually start
        variables - variables to be set on the case execution
      • disableCaseExecution

        public void disableCaseExecution​(java.lang.String caseExecutionId)
        Description copied from interface: CaseService

        Disables the case execution identified by the given id. Performs a transition from state ENABLED to state DISABLED.

        According to CMMN 1.0 specification, the state DISABLED means that the Stage or Task related to the case execution should not be executed in this case instance.

        If the given case execution has a parent case execution, that parent case execution will be notified that the given case execution has been disabled. This can lead to a completion of the parent case execution if the completion criteria are fulfilled.

        Specified by:
        disableCaseExecution in interface CaseService
        Parameters:
        caseExecutionId - the id of the case execution to disable
      • disableCaseExecution

        public void disableCaseExecution​(java.lang.String caseExecutionId,
                                         java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Disables the case execution identified by the given id. Performs a transition from state ENABLED to state DISABLED.

        According to CMMN 1.0 specification, the state DISABLED means that the Stage or Task related to the case execution should not be executed in this case instance.

        If the given case execution has a parent case execution, that parent case execution will be notified that the given case execution has been disabled. This can lead to a completion of the parent case execution if the completion criteria are fulfilled.

        Specified by:
        disableCaseExecution in interface CaseService
        Parameters:
        caseExecutionId - the id of the case execution to disable
        variables - variables to be set on the case execution
      • reenableCaseExecution

        public void reenableCaseExecution​(java.lang.String caseExecutionId)
        Description copied from interface: CaseService

        Re-enables the case execution identified by the given id. Performs a transition from state DISABLED to state ENABLED.

        According to CMMN 1.0 specification, the state DISABLED means that the Stage or Task related to the case execution pends for a decision to become ACTIVE or DISABLED.

        Specified by:
        reenableCaseExecution in interface CaseService
        Parameters:
        caseExecutionId - the id of the case execution to re-enable
      • reenableCaseExecution

        public void reenableCaseExecution​(java.lang.String caseExecutionId,
                                          java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Re-enables the case execution identified by the given id. Performs a transition from state DISABLED to state ENABLED.

        According to CMMN 1.0 specification, the state DISABLED means that the Stage or Task related to the case execution pends for a decision to become ACTIVE or DISABLED.

        Specified by:
        reenableCaseExecution in interface CaseService
        Parameters:
        caseExecutionId - the id of the case execution to re-enable
        variables - variables to be set on the case execution
      • completeCaseExecution

        public void completeCaseExecution​(java.lang.String caseExecutionId)
        Description copied from interface: CaseService

        Completes the case execution identified by the given id. Performs a transition from state ACTIVE to state COMPLETED.

        It is only possible to complete a case execution which is associated with a Stage or Task.

        In case of a Stage, the completion can only be performed when the following criteria are fulfilled:

        • there are no children in the state ACTIVE

        For a Task instance, this means its purpose has been accomplished:

        • HumanTask has been completed by human.

        If the given case execution has a parent case execution, that parent case execution will be notified that the given case execution has been completed. This can lead to a completion of the parent case execution if the completion criteria are fulfilled.

        Specified by:
        completeCaseExecution in interface CaseService
        Parameters:
        caseExecutionId - the id of the case execution to complete
      • completeCaseExecution

        public void completeCaseExecution​(java.lang.String caseExecutionId,
                                          java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Completes the case execution identified by the given id. Performs a transition from state ACTIVE to state COMPLETED.

        It is only possible to complete a case execution which is associated with a Stage or Task.

        In case of a Stage, the completion can only be performed when the following criteria are fulfilled:

        • there are no children in the state ACTIVE

        For a Task instance, this means its purpose has been accomplished:

        • HumanTask has been completed by human.

        If the given case execution has a parent case execution, that parent case execution will be notified that the given case execution has been completed. This can lead to a completion of the parent case execution if the completion criteria are fulfilled.

        Specified by:
        completeCaseExecution in interface CaseService
        Parameters:
        caseExecutionId - the id of the case execution to complete
        variables - variables to be set on the case execution
      • closeCaseInstance

        public void closeCaseInstance​(java.lang.String caseInstanceId)
        Description copied from interface: CaseService

        Closes the case instance the execution identified by the given id belongs to. Once closed, no further work or modifications are allowed for the case instance. Performs a transition from state COMPLETED to state CLOSED.

        Specified by:
        closeCaseInstance in interface CaseService
        Parameters:
        caseInstanceId - the id of the case execution to close the case instance for
      • terminateCaseExecution

        public void terminateCaseExecution​(java.lang.String caseExecutionId)
        Description copied from interface: CaseService

        Terminates the case execution identified by the given id. Performs the transition from ACTIVE to state TERMINATED if the case execution belongs to a case model or a task or a stage. Performs the transition from AVAILABLE to state TERMINATED if the case execution belongs to a milestone.

        Specified by:
        terminateCaseExecution in interface CaseService
        Parameters:
        caseExecutionId - the id of the case execution to be terminated
      • terminateCaseExecution

        public void terminateCaseExecution​(java.lang.String caseExecutionId,
                                           java.util.Map<java.lang.String,​java.lang.Object> variables)
        Description copied from interface: CaseService

        Terminates the case execution identified by the given id. Performs the transition from ACTIVE to state TERMINATED if the case execution belongs to either a case model or a task or a stage. Performs the transition from AVAILABLE to state TERMINATED if the case execution belongs to a milestone.

        Specified by:
        terminateCaseExecution in interface CaseService
        Parameters:
        caseExecutionId - the id of the case execution to terminate
        variables - variables to be set on the case execution