Class CaseServiceImpl
- java.lang.Object
- 
- org.camunda.bpm.engine.impl.ServiceImpl
- 
- org.camunda.bpm.engine.impl.cmmn.CaseServiceImpl
 
 
- 
- All Implemented Interfaces:
- CaseService
 
 public class CaseServiceImpl extends ServiceImpl implements CaseService - Author:
- Roman Smirnov
 
- 
- 
Field Summary- 
Fields inherited from class org.camunda.bpm.engine.impl.ServiceImplcommandExecutor
 
- 
 - 
Constructor SummaryConstructors Constructor Description CaseServiceImpl()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseCaseInstance(java.lang.String caseInstanceId)Closes the case instance the execution identified by the given id belongs to.voidcompleteCaseExecution(java.lang.String caseExecutionId)Completes the case execution identified by the given id.voidcompleteCaseExecution(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Completes the case execution identified by the given id.CaseExecutionQuerycreateCaseExecutionQuery()Creates a newCaseExecutionQueryinstance, that can be used to query the executions and case instances.CaseInstancecreateCaseInstanceById(java.lang.String caseDefinitionId)Creates a newCaseInstancein the exactly specified version identify by the provided process definition id.CaseInstancecreateCaseInstanceById(java.lang.String caseDefinitionId, java.lang.String businessKey)Creates a newCaseInstancein the exactly specified version identify by the provided process definition id.CaseInstancecreateCaseInstanceById(java.lang.String caseDefinitionId, java.lang.String businessKey, java.util.Map<java.lang.String,java.lang.Object> variables)Creates a newCaseInstancein the exactly specified version identify by the provided process definition id.CaseInstancecreateCaseInstanceById(java.lang.String caseDefinitionId, java.util.Map<java.lang.String,java.lang.Object> variables)Creates a newCaseInstancein the exactly specified version identify by the provided process definition id.CaseInstancecreateCaseInstanceByKey(java.lang.String caseDefinitionKey)Creates a newCaseInstanceof the latest version of the case definition with the given key.CaseInstancecreateCaseInstanceByKey(java.lang.String caseDefinitionKey, java.lang.String businessKey)Creates a newCaseInstanceof the latest version of the case definition with the given key.CaseInstancecreateCaseInstanceByKey(java.lang.String caseDefinitionKey, java.lang.String businessKey, java.util.Map<java.lang.String,java.lang.Object> variables)Creates a newCaseInstanceof the latest version of the case definition with the given key.CaseInstancecreateCaseInstanceByKey(java.lang.String caseDefinitionKey, java.util.Map<java.lang.String,java.lang.Object> variables)Creates a newCaseInstanceof the latest version of the case definition with the given key.CaseInstanceQuerycreateCaseInstanceQuery()Creates a newCaseInstanceQueryinstance, that can be used to query case instances.voiddisableCaseExecution(java.lang.String caseExecutionId)Disables the case execution identified by the given id.voiddisableCaseExecution(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.ObjectgetCaseExecutionVariable(java.lang.String caseExecutionId, java.lang.String variableName, boolean isLocal)protected VariableMapgetCaseExecutionVariables(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames, boolean isLocal, boolean deserializeValues)protected <T extends TypedValue>
 TgetCaseExecutionVariableTyped(java.lang.String caseExecutionId, java.lang.String variableName, boolean isLocal, boolean deserializeValue)java.lang.ObjectgetVariable(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.ObjectgetVariableLocal(java.lang.String caseExecutionId, java.lang.String variableName)The variable value for an case execution.<T extends TypedValue>
 TgetVariableLocalTyped(java.lang.String caseExecutionId, java.lang.String variableName)The variable value for an case execution.<T extends TypedValue>
 TgetVariableLocalTyped(java.lang.String caseExecutionId, java.lang.String variableName, boolean deserializeValue)The variable value for an case execution.VariableMapgetVariables(java.lang.String caseExecutionId)All variables visible from the given execution scope (including parent scopes).VariableMapgetVariables(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).VariableMapgetVariablesLocal(java.lang.String caseExecutionId)All variable values that are defined in the case execution scope, without taking outer scopes into account.VariableMapgetVariablesLocal(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.VariableMapgetVariablesLocalTyped(java.lang.String caseExecutionId)All variable values that are defined in the case execution scope, without taking outer scopes into account.VariableMapgetVariablesLocalTyped(java.lang.String caseExecutionId, boolean deserializeValues)All variable values that are defined in the case execution scope, without taking outer scopes into account.VariableMapgetVariablesLocalTyped(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.VariableMapgetVariablesTyped(java.lang.String caseExecutionId)All variables visible from the given execution scope (including parent scopes).VariableMapgetVariablesTyped(java.lang.String caseExecutionId, boolean deserializeValues)All variables visible from the given execution scope (including parent scopes).VariableMapgetVariablesTyped(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>
 TgetVariableTyped(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>
 TgetVariableTyped(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).voidmanuallyStartCaseExecution(java.lang.String caseExecutionId)Starts the case execution identified by the given id manually.voidmanuallyStartCaseExecution(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Starts the case execution identified by the given id manually.voidreenableCaseExecution(java.lang.String caseExecutionId)Re-enables the case execution identified by the given id.voidreenableCaseExecution(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Re-enables the case execution identified by the given id.voidremoveVariable(java.lang.String caseExecutionId, java.lang.String variableName)Pass a name of a variable to be removed from a case execution.voidremoveVariableLocal(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).voidremoveVariables(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.voidremoveVariablesLocal(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).voidsetVariable(java.lang.String caseExecutionId, java.lang.String variableName, java.lang.Object value)Pass a variable to the case execution.voidsetVariableLocal(java.lang.String caseExecutionId, java.lang.String variableName, java.lang.Object value)Pass a local variable to the case execution (not considering parent scopes).voidsetVariables(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Pass a map of variables to the case execution.voidsetVariablesLocal(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).voidterminateCaseExecution(java.lang.String caseExecutionId)Terminates the case execution identified by the given id.voidterminateCaseExecution(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Terminates the case execution identified by the given id.CaseInstanceBuilderwithCaseDefinition(java.lang.String caseDefinitionId)Define aCaseInstanceusing a fluent builder.CaseInstanceBuilderwithCaseDefinitionByKey(java.lang.String caseDefinitionKey)Define aCaseInstanceusing a fluent builder.CaseExecutionCommandBuilderwithCaseExecution(java.lang.String caseExecutionId)Define a command to be executed for aCaseExecutionusing a fluent builder.- 
Methods inherited from class org.camunda.bpm.engine.impl.ServiceImplgetCommandExecutor, setCommandExecutor
 
- 
 
- 
- 
- 
Method Detail- 
withCaseDefinitionByKeypublic CaseInstanceBuilder withCaseDefinitionByKey(java.lang.String caseDefinitionKey) Description copied from interface:CaseServiceDefine a CaseInstanceusing a fluent builder.Starts a new case instance with the latest version of the corresponding case definition. - Specified by:
- withCaseDefinitionByKeyin interface- CaseService
- Parameters:
- caseDefinitionKey- the key of a case definition to create a new case instance of, cannot be null
- Returns:
- a fluent builderfor defining a new case instance
 
 - 
withCaseDefinitionpublic CaseInstanceBuilder withCaseDefinition(java.lang.String caseDefinitionId) Description copied from interface:CaseServiceDefine a CaseInstanceusing a fluent builder.Starts a new case instance with the case definition version corresponding to the given id. - Specified by:
- withCaseDefinitionin interface- CaseService
- Parameters:
- caseDefinitionId- the id of a case definition to create a new case instance, cannot be null
- Returns:
- a fluent builderfor defining a new case instance
 
 - 
createCaseInstanceQuerypublic CaseInstanceQuery createCaseInstanceQuery() Description copied from interface:CaseServiceCreates a new CaseInstanceQueryinstance, that can be used to query case instances.- Specified by:
- createCaseInstanceQueryin interface- CaseService
 
 - 
createCaseExecutionQuerypublic CaseExecutionQuery createCaseExecutionQuery() Description copied from interface:CaseServiceCreates a new CaseExecutionQueryinstance, that can be used to query the executions and case instances.- Specified by:
- createCaseExecutionQueryin interface- CaseService
 
 - 
withCaseExecutionpublic CaseExecutionCommandBuilder withCaseExecution(java.lang.String caseExecutionId) Description copied from interface:CaseServiceDefine a command to be executed for a CaseExecutionusing a fluent builder.- Specified by:
- withCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of a case execution to define a command for it
- Returns:
- a fluent builderfor defining a command for a case execution
 
 - 
getVariablespublic VariableMap getVariables(java.lang.String caseExecutionId) Description copied from interface:CaseServiceAll 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:
- getVariablesin 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
 
 - 
getVariablesTypedpublic VariableMap getVariablesTyped(java.lang.String caseExecutionId) Description copied from interface:CaseServiceAll 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:
- getVariablesTypedin 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
 
 - 
getVariablesTypedpublic VariableMap getVariablesTyped(java.lang.String caseExecutionId, boolean deserializeValues) Description copied from interface:CaseServiceAll 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:
- getVariablesTypedin 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
 
 - 
getVariablesLocalpublic VariableMap getVariablesLocal(java.lang.String caseExecutionId) Description copied from interface:CaseServiceAll 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:
- getVariablesLocalin 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
 
 - 
getVariablesLocalTypedpublic VariableMap getVariablesLocalTyped(java.lang.String caseExecutionId) Description copied from interface:CaseServiceAll 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:
- getVariablesLocalTypedin 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
 
 - 
getVariablesLocalTypedpublic VariableMap getVariablesLocalTyped(java.lang.String caseExecutionId, boolean deserializeValues) Description copied from interface:CaseServiceAll 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:
- getVariablesLocalTypedin 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
 
 - 
getVariablespublic VariableMap getVariables(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames) Description copied from interface:CaseServiceThe 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:
- getVariablesin 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
 
 - 
getVariablesTypedpublic VariableMap getVariablesTyped(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames, boolean deserializeValues) Description copied from interface:CaseServiceThe 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:
- getVariablesTypedin 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,- SerializableValueswill not be deserialized
- Returns:
- the variables or an empty map if no such variables are found
 
 - 
getVariablesLocalpublic VariableMap getVariablesLocal(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames) Description copied from interface:CaseServiceThe variable values for the given variableNames only taking the given case execution scope into account, not looking in outer scopes. - Specified by:
- getVariablesLocalin 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
 
 - 
getVariablesLocalTypedpublic VariableMap getVariablesLocalTyped(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames, boolean deserializeValues) Description copied from interface:CaseServiceThe variable values for the given variableNames only taking the given case execution scope into account, not looking in outer scopes. - Specified by:
- getVariablesLocalTypedin 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
 
 - 
getCaseExecutionVariablesprotected VariableMap getCaseExecutionVariables(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames, boolean isLocal, boolean deserializeValues) 
 - 
getVariablepublic java.lang.Object getVariable(java.lang.String caseExecutionId, java.lang.String variableName)Description copied from interface:CaseServiceSearching 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:
- getVariablein 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
 
 - 
getVariableLocalpublic java.lang.Object getVariableLocal(java.lang.String caseExecutionId, java.lang.String variableName)Description copied from interface:CaseServiceThe 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:
- getVariableLocalin 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
 
 - 
getCaseExecutionVariableprotected java.lang.Object getCaseExecutionVariable(java.lang.String caseExecutionId, java.lang.String variableName, boolean isLocal)
 - 
getVariableTypedpublic <T extends TypedValue> T getVariableTyped(java.lang.String caseExecutionId, java.lang.String variableName) Description copied from interface:CaseServiceSearching 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:
- getVariableTypedin 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
 
 - 
getVariableTypedpublic <T extends TypedValue> T getVariableTyped(java.lang.String caseExecutionId, java.lang.String variableName, boolean deserializeValue) Description copied from interface:CaseServiceSearching 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:
- getVariableTypedin 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,- SerializableValueswill not be deserialized
- Returns:
- the variable value or null if the variable is undefined or the value of the variable is null
 
 - 
getVariableLocalTypedpublic <T extends TypedValue> T getVariableLocalTyped(java.lang.String caseExecutionId, java.lang.String variableName) Description copied from interface:CaseServiceThe 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:
- getVariableLocalTypedin 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
 
 - 
getVariableLocalTypedpublic <T extends TypedValue> T getVariableLocalTyped(java.lang.String caseExecutionId, java.lang.String variableName, boolean deserializeValue) Description copied from interface:CaseServiceThe 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:
- getVariableLocalTypedin 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,- SerializableValueswill not be deserialized
- Returns:
- the variable value or null if the variable is undefined or the value of the variable is null
 
 - 
getCaseExecutionVariableTypedprotected <T extends TypedValue> T getCaseExecutionVariableTyped(java.lang.String caseExecutionId, java.lang.String variableName, boolean isLocal, boolean deserializeValue) 
 - 
setVariablespublic void setVariables(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Description copied from interface:CaseServicePass 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:
- setVariablesin interface- CaseService
- Parameters:
- caseExecutionId- the case execution to set the variables for
- variables- the map of variables
 
 - 
setVariablesLocalpublic void setVariablesLocal(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Description copied from interface:CaseServicePass a map of variables to the case execution (not considering parent scopes). - Specified by:
- setVariablesLocalin interface- CaseService
- Parameters:
- caseExecutionId- the case execution to set the variables for
- variables- the map of variables
 
 - 
setVariablepublic void setVariable(java.lang.String caseExecutionId, java.lang.String variableName, java.lang.Object value)Description copied from interface:CaseServicePass 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:
- setVariablein 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
 
 - 
setVariableLocalpublic void setVariableLocal(java.lang.String caseExecutionId, java.lang.String variableName, java.lang.Object value)Description copied from interface:CaseServicePass a local variable to the case execution (not considering parent scopes). - Specified by:
- setVariableLocalin 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
 
 - 
removeVariablespublic void removeVariables(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames)Description copied from interface:CaseServicePass a collection of names identifying variables to be removed from a case execution. - Specified by:
- removeVariablesin interface- CaseService
- Parameters:
- caseExecutionId- the case execution to remove the variables from
- variableNames- a collection of names of variables to remove
 
 - 
removeVariablesLocalpublic void removeVariablesLocal(java.lang.String caseExecutionId, java.util.Collection<java.lang.String> variableNames)Description copied from interface:CaseServicePass a collection of names identifying local variables to be removed from a case execution (not considering parent scopes). - Specified by:
- removeVariablesLocalin interface- CaseService
- Parameters:
- caseExecutionId- the case execution to remove the variables from
- variableNames- a collection of names of variables to remove
 
 - 
removeVariablepublic void removeVariable(java.lang.String caseExecutionId, java.lang.String variableName)Description copied from interface:CaseServicePass a name of a variable to be removed from a case execution. - Specified by:
- removeVariablein interface- CaseService
- Parameters:
- caseExecutionId- the case execution to remove the variable from
- variableName- the name of the variable to remove
 
 - 
removeVariableLocalpublic void removeVariableLocal(java.lang.String caseExecutionId, java.lang.String variableName)Description copied from interface:CaseServicePass a variable name of a local variable to be removed from a case execution (not considering parent scopes). - Specified by:
- removeVariableLocalin interface- CaseService
- Parameters:
- caseExecutionId- the case execution to remove the variable from
- variableName- the name of a variable to remove
 
 - 
createCaseInstanceByKeypublic CaseInstance createCaseInstanceByKey(java.lang.String caseDefinitionKey) Description copied from interface:CaseServiceCreates a new CaseInstanceof the latest version of the case definition with the given key. The new case instance will be in theACTIVEstate.- Specified by:
- createCaseInstanceByKeyin interface- CaseService
- Parameters:
- caseDefinitionKey- the key of the case definition to instantiate
 
 - 
createCaseInstanceByKeypublic CaseInstance createCaseInstanceByKey(java.lang.String caseDefinitionKey, java.lang.String businessKey) Description copied from interface:CaseServiceCreates a new CaseInstanceof the latest version of the case definition with the given key. The new case instance will be in theACTIVEstate.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:
- createCaseInstanceByKeyin 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.
 
 - 
createCaseInstanceByKeypublic CaseInstance createCaseInstanceByKey(java.lang.String caseDefinitionKey, java.util.Map<java.lang.String,java.lang.Object> variables) Description copied from interface:CaseServiceCreates a new CaseInstanceof the latest version of the case definition with the given key. The new case instance will be in theACTIVEstate.- Specified by:
- createCaseInstanceByKeyin interface- CaseService
- Parameters:
- caseDefinitionKey- the key of the case definition to instantiate
- variables- variables to be set on the new case instance
 
 - 
createCaseInstanceByKeypublic CaseInstance createCaseInstanceByKey(java.lang.String caseDefinitionKey, java.lang.String businessKey, java.util.Map<java.lang.String,java.lang.Object> variables) Description copied from interface:CaseServiceCreates a new CaseInstanceof the latest version of the case definition with the given key. The new case instance will be in theACTIVEstate.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:
- createCaseInstanceByKeyin 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.
 
 - 
createCaseInstanceByIdpublic CaseInstance createCaseInstanceById(java.lang.String caseDefinitionId) Description copied from interface:CaseServiceCreates a new CaseInstancein the exactly specified version identify by the provided process definition id. The new case instance will be in theACTIVEstate.- Specified by:
- createCaseInstanceByIdin interface- CaseService
- Parameters:
- caseDefinitionId- the id of the case definition to instantiate
 
 - 
createCaseInstanceByIdpublic CaseInstance createCaseInstanceById(java.lang.String caseDefinitionId, java.lang.String businessKey) Description copied from interface:CaseServiceCreates a new CaseInstancein the exactly specified version identify by the provided process definition id. The new case instance will be in theACTIVEstate.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:
- createCaseInstanceByIdin 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.
 
 - 
createCaseInstanceByIdpublic CaseInstance createCaseInstanceById(java.lang.String caseDefinitionId, java.util.Map<java.lang.String,java.lang.Object> variables) Description copied from interface:CaseServiceCreates a new CaseInstancein the exactly specified version identify by the provided process definition id. The new case instance will be in theACTIVEstate.- Specified by:
- createCaseInstanceByIdin interface- CaseService
- Parameters:
- caseDefinitionId- the id of the case definition to instantiate
- variables- variables to be set on the new case instance.
 
 - 
createCaseInstanceByIdpublic CaseInstance createCaseInstanceById(java.lang.String caseDefinitionId, java.lang.String businessKey, java.util.Map<java.lang.String,java.lang.Object> variables) Description copied from interface:CaseServiceCreates a new CaseInstancein the exactly specified version identify by the provided process definition id. The new case instance will be in theACTIVEstate.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:
- createCaseInstanceByIdin 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.
 
 - 
manuallyStartCaseExecutionpublic void manuallyStartCaseExecution(java.lang.String caseExecutionId) Description copied from interface:CaseServiceStarts the case execution identified by the given id manually. Performs the transition from state ENABLEDto stateACTIVE.According to CMMN 1.0 specification, the state ACTIVEmeans that theStageorTaskrelated to the case execution does the following:- Task: the- taskis completed immediately
- HumanTask: a new- user taskis instantiated
- ProcessTask: a new- process instanceis instantiated
- CaseTask: a new- case instanceis instantiated
 - Specified by:
- manuallyStartCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of the case execution to manually start
 
 - 
manuallyStartCaseExecutionpublic void manuallyStartCaseExecution(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Description copied from interface:CaseServiceStarts the case execution identified by the given id manually. Performs a transition from state ENABLEDto stateACTIVE.According to CMMN 1.0 specification, the state ACTIVEmeans that theStageorTaskrelated to the case execution does the following:- Task: the- taskis completed immediately
- HumanTask: a new- user taskis instantiated
- ProcessTask: a new- process instanceis instantiated
- CaseTask: a new- case instanceis instantiated
 - Specified by:
- manuallyStartCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of the case execution to manually start
- variables- variables to be set on the case execution
 
 - 
disableCaseExecutionpublic void disableCaseExecution(java.lang.String caseExecutionId) Description copied from interface:CaseServiceDisables the case execution identified by the given id. Performs a transition from state ENABLEDto stateDISABLED.According to CMMN 1.0 specification, the state DISABLEDmeans that theStageorTaskrelated 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:
- disableCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of the case execution to disable
 
 - 
disableCaseExecutionpublic void disableCaseExecution(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Description copied from interface:CaseServiceDisables the case execution identified by the given id. Performs a transition from state ENABLEDto stateDISABLED.According to CMMN 1.0 specification, the state DISABLEDmeans that theStageorTaskrelated 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:
- disableCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of the case execution to disable
- variables- variables to be set on the case execution
 
 - 
reenableCaseExecutionpublic void reenableCaseExecution(java.lang.String caseExecutionId) Description copied from interface:CaseServiceRe-enables the case execution identified by the given id. Performs a transition from state DISABLEDto stateENABLED.According to CMMN 1.0 specification, the state DISABLEDmeans that theStageorTaskrelated to the case execution pends for a decision to becomeACTIVEorDISABLED.- Specified by:
- reenableCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of the case execution to re-enable
 
 - 
reenableCaseExecutionpublic void reenableCaseExecution(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Description copied from interface:CaseServiceRe-enables the case execution identified by the given id. Performs a transition from state DISABLEDto stateENABLED.According to CMMN 1.0 specification, the state DISABLEDmeans that theStageorTaskrelated to the case execution pends for a decision to becomeACTIVEorDISABLED.- Specified by:
- reenableCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of the case execution to re-enable
- variables- variables to be set on the case execution
 
 - 
completeCaseExecutionpublic void completeCaseExecution(java.lang.String caseExecutionId) Description copied from interface:CaseServiceCompletes the case execution identified by the given id. Performs a transition from state ACTIVEto stateCOMPLETED.It is only possible to complete a case execution which is associated with a StageorTask.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 Taskinstance, this means its purpose has been accomplished:
 - HumanTaskhas 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:
- completeCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of the case execution to complete
 
- there are no children in the state 
 - 
completeCaseExecutionpublic void completeCaseExecution(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Description copied from interface:CaseServiceCompletes the case execution identified by the given id. Performs a transition from state ACTIVEto stateCOMPLETED.It is only possible to complete a case execution which is associated with a StageorTask.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 Taskinstance, this means its purpose has been accomplished:
 - HumanTaskhas 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:
- completeCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of the case execution to complete
- variables- variables to be set on the case execution
 
- there are no children in the state 
 - 
closeCaseInstancepublic void closeCaseInstance(java.lang.String caseInstanceId) Description copied from interface:CaseServiceCloses 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 COMPLETEDto stateCLOSED.- Specified by:
- closeCaseInstancein interface- CaseService
- Parameters:
- caseInstanceId- the id of the case execution to close the case instance for
 
 - 
terminateCaseExecutionpublic void terminateCaseExecution(java.lang.String caseExecutionId) Description copied from interface:CaseServiceTerminates the case execution identified by the given id. Performs the transition from ACTIVEto stateTERMINATEDif the case execution belongs to a case model or a task or a stage. Performs the transition fromAVAILABLEto stateTERMINATEDif the case execution belongs to a milestone.- Specified by:
- terminateCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of the case execution to be terminated
 
 - 
terminateCaseExecutionpublic void terminateCaseExecution(java.lang.String caseExecutionId, java.util.Map<java.lang.String,java.lang.Object> variables)Description copied from interface:CaseServiceTerminates the case execution identified by the given id. Performs the transition from ACTIVEto stateTERMINATEDif the case execution belongs to either a case model or a task or a stage. Performs the transition fromAVAILABLEto stateTERMINATEDif the case execution belongs to a milestone.- Specified by:
- terminateCaseExecutionin interface- CaseService
- Parameters:
- caseExecutionId- the id of the case execution to terminate
- variables- variables to be set on the case execution
 
 
- 
 
-