Class CaseExecutionCommandBuilderImpl
- java.lang.Object
- 
- org.camunda.bpm.engine.impl.cmmn.CaseExecutionCommandBuilderImpl
 
- 
- All Implemented Interfaces:
- CaseExecutionCommandBuilder
 
 public class CaseExecutionCommandBuilderImpl extends Object implements CaseExecutionCommandBuilder - Author:
- Roman Smirnov
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected StringcaseExecutionIdprotected CommandContextcommandContextprotected CommandExecutorcommandExecutorprotected Collection<String>variableDeletionsprotected Collection<String>variableLocalDeletionsprotected VariableMapImplvariablesprotected VariableMapImplvariablesLocal
 - 
Constructor SummaryConstructors Constructor Description CaseExecutionCommandBuilderImpl(CommandContext commandContext, String caseExecutionId)CaseExecutionCommandBuilderImpl(CommandExecutor commandExecutor, String caseExecutionId)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Additionally toCaseExecutionCommandBuilder.execute()the associated case instance will be closed, so that no further work or modifications is allowed for the associated case instance.voidcomplete()Additionally toCaseExecutionCommandBuilder.execute()the associated case execution will be completed.voiddisable()Additionally toCaseExecutionCommandBuilder.execute()the associated case execution will be disabled.protected voidensureVariableDeletionsInitialized()protected voidensureVariableDeletionsLocalInitialized()protected voidensureVariableShouldNotBeRemoved(String variableName)protected voidensureVariableShouldNotBeSet(String variableName)protected voidensureVariablesInitialized()protected voidensureVariablesLocalInitialized()protected voidensureVariablesShouldNotBeRemoved(Collection<String> variableNames)protected voidensureVariablesShouldNotBeSet(Collection<String> variableNames)voidexecute()Invoking this method will remove and/or set the passed variables.protected voidexecuteCommand(Command<?> command)StringgetCaseExecutionId()Collection<String>getVariableDeletions()Collection<String>getVariableLocalDeletions()VariableMapgetVariables()VariableMapgetVariablesLocal()voidmanualStart()Additionally toCaseExecutionCommandBuilder.execute()the associated case execution will be started manually.voidreenable()Additionally toCaseExecutionCommandBuilder.execute()the associated case execution will be re-enabled.CaseExecutionCommandBuilderremoveVariable(String variableName)Pass a variable name of a variable to be removed for a case execution.CaseExecutionCommandBuilderremoveVariableLocal(String variableName)Pass a variable name of a local variable to be removed for a case execution (not considering parent scopes).CaseExecutionCommandBuilderremoveVariables(Collection<String> variableNames)Pass a collection of variable names of variables to be removed for a case execution.CaseExecutionCommandBuilderremoveVariablesLocal(Collection<String> variableNames)Pass a collection of variable names of local variables to be removed for a case execution (not considering parent scopes).CaseExecutionCommandBuildersetVariable(String variableName, Object variableValue)Pass a variable to the case execution.CaseExecutionCommandBuildersetVariableLocal(String localVariableName, Object localVariableValue)Pass a local variable to the case execution (not considering parent scopes).CaseExecutionCommandBuildersetVariables(Map<String,Object> variables)Pass a map of variables to the case execution.CaseExecutionCommandBuildersetVariablesLocal(Map<String,Object> variablesLocal)Pass a map of variables to the case execution (not considering parent scopes).voidterminate()Additionally toCaseExecutionCommandBuilder.execute()the associated case execution will be terminated.
 
- 
- 
- 
Field Detail- 
commandExecutorprotected CommandExecutor commandExecutor 
 - 
commandContextprotected CommandContext commandContext 
 - 
caseExecutionIdprotected String caseExecutionId 
 - 
variablesprotected VariableMapImpl variables 
 - 
variablesLocalprotected VariableMapImpl variablesLocal 
 - 
variableDeletionsprotected Collection<String> variableDeletions 
 - 
variableLocalDeletionsprotected Collection<String> variableLocalDeletions 
 
- 
 - 
Constructor Detail- 
CaseExecutionCommandBuilderImplpublic CaseExecutionCommandBuilderImpl(CommandExecutor commandExecutor, String caseExecutionId) 
 - 
CaseExecutionCommandBuilderImplpublic CaseExecutionCommandBuilderImpl(CommandContext commandContext, String caseExecutionId) 
 
- 
 - 
Method Detail- 
setVariablepublic CaseExecutionCommandBuilder setVariable(String variableName, Object variableValue) Description copied from interface:CaseExecutionCommandBuilderPass a variable to the case execution. If the variable is not already existing, they will be created in the case instance (which is the root execution) otherwise the existing variable will be updated. Invoking this method multiple times allows passing multiple variables. - Specified by:
- setVariablein interface- CaseExecutionCommandBuilder
- Parameters:
- variableName- the name of the variable to set
- variableValue- the value of the variable to set
- Returns:
- the builder
 
 - 
setVariablespublic CaseExecutionCommandBuilder setVariables(Map<String,Object> variables) Description copied from interface:CaseExecutionCommandBuilderPass a map of variables to the case execution. If the variables are not already existing, they will be created in the case instance (which is the root execution) otherwise the existing variable will be updated. Invoking this method multiple times allows passing multiple variables. - Specified by:
- setVariablesin interface- CaseExecutionCommandBuilder
- Parameters:
- variables- the map of variables
- Returns:
- the builder
 
 - 
setVariableLocalpublic CaseExecutionCommandBuilder setVariableLocal(String localVariableName, Object localVariableValue) Description copied from interface:CaseExecutionCommandBuilderPass a local variable to the case execution (not considering parent scopes). Invoking this method multiple times allows passing multiple variables. - Specified by:
- setVariableLocalin interface- CaseExecutionCommandBuilder
- Parameters:
- localVariableName- the name of the variable to set
- localVariableValue- the value of the variable to set
- Returns:
- the builder
 
 - 
setVariablesLocalpublic CaseExecutionCommandBuilder setVariablesLocal(Map<String,Object> variablesLocal) Description copied from interface:CaseExecutionCommandBuilderPass a map of variables to the case execution (not considering parent scopes). Invoking this method multiple times allows passing multiple variables. - Specified by:
- setVariablesLocalin interface- CaseExecutionCommandBuilder
- Parameters:
- variablesLocal- the map of variables
- Returns:
- the builder
 
 - 
removeVariablepublic CaseExecutionCommandBuilder removeVariable(String variableName) Description copied from interface:CaseExecutionCommandBuilderPass a variable name of a variable to be removed for a case execution. Invoking this method multiple times allows passing multiple variable names. - Specified by:
- removeVariablein interface- CaseExecutionCommandBuilder
- Parameters:
- variableName- the name of a variable to remove
- Returns:
- the builder
 
 - 
removeVariablespublic CaseExecutionCommandBuilder removeVariables(Collection<String> variableNames) Description copied from interface:CaseExecutionCommandBuilderPass a collection of variable names of variables to be removed for a case execution. Invoking this method multiple times allows passing multiple variable names. - Specified by:
- removeVariablesin interface- CaseExecutionCommandBuilder
- Parameters:
- variableNames- a collection of names of variables to remove
- Returns:
- the builder
 
 - 
removeVariableLocalpublic CaseExecutionCommandBuilder removeVariableLocal(String variableName) Description copied from interface:CaseExecutionCommandBuilderPass a variable name of a local variable to be removed for a case execution (not considering parent scopes). Invoking this method multiple times allows passing multiple variable names. - Specified by:
- removeVariableLocalin interface- CaseExecutionCommandBuilder
- Parameters:
- variableName- the name of a variable to remove
- Returns:
- the builder
 
 - 
removeVariablesLocalpublic CaseExecutionCommandBuilder removeVariablesLocal(Collection<String> variableNames) Description copied from interface:CaseExecutionCommandBuilderPass a collection of variable names of local variables to be removed for a case execution (not considering parent scopes). Invoking this method multiple times allows passing multiple variable names. - Specified by:
- removeVariablesLocalin interface- CaseExecutionCommandBuilder
- Parameters:
- variableNames- a collection of names of variables to remove
- Returns:
- the builder
 
 - 
ensureVariablesShouldNotBeRemovedprotected void ensureVariablesShouldNotBeRemoved(Collection<String> variableNames) 
 - 
ensureVariableShouldNotBeRemovedprotected void ensureVariableShouldNotBeRemoved(String variableName) 
 - 
ensureVariablesShouldNotBeSetprotected void ensureVariablesShouldNotBeSet(Collection<String> variableNames) 
 - 
ensureVariableShouldNotBeSetprotected void ensureVariableShouldNotBeSet(String variableName) 
 - 
ensureVariablesInitializedprotected void ensureVariablesInitialized() 
 - 
ensureVariablesLocalInitializedprotected void ensureVariablesLocalInitialized() 
 - 
ensureVariableDeletionsInitializedprotected void ensureVariableDeletionsInitialized() 
 - 
ensureVariableDeletionsLocalInitializedprotected void ensureVariableDeletionsLocalInitialized() 
 - 
executepublic void execute() Description copied from interface:CaseExecutionCommandBuilderInvoking this method will remove and/or set the passed variables. This behaves as follows: - if at least one variable name of a variable to remove is passed, those variables will be removed.
- if at least one local variable name of a local variable to remove is passed, those local variables will be removed.
- if at least one variable to add or update is passed, those variables will be set for a case execution.
- if at least one local variable to add or update is passed, those variables will be set for a case execution.
 - Specified by:
- executein interface- CaseExecutionCommandBuilder
 
 - 
manualStartpublic void manualStart() Description copied from interface:CaseExecutionCommandBuilderAdditionally to CaseExecutionCommandBuilder.execute()the associated case execution will be started manually. Therefore there happens a transition from the stateENABLEDto stateACTIVE.According to CMMN 1.0 specification the state ACTIVEmeans, that the with the case execution relatedStageorTaskis executing in this state:- Task: the- taskwill be completed immediately
- HumanTask: a new- user taskwill be instantiated
- ProcessTask: a new- process instancewill be instantiated
- CaseTask: a new- case instancewill be instantiated
 - Specified by:
- manualStartin interface- CaseExecutionCommandBuilder
 
 - 
disablepublic void disable() Description copied from interface:CaseExecutionCommandBuilderAdditionally to CaseExecutionCommandBuilder.execute()the associated case execution will be disabled. Therefore there happens a transition from the stateENABLEDto stateDISABLED.According to CMMN 1.0 specification the state DISABLEDmeans, that the with the case execution relatedStageorTaskshould not be executed in the 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:
- disablein interface- CaseExecutionCommandBuilder
 
 - 
reenablepublic void reenable() Description copied from interface:CaseExecutionCommandBuilderAdditionally to CaseExecutionCommandBuilder.execute()the associated case execution will be re-enabled. Therefore there happens a transition from the stateDISABLEDto stateENABLED.According to CMMN 1.0 specification the state DISABLEDmeans, that the with the case execution relatedStageorTaskis waiting for a decision to becomeACTIVEorDISABLEDonce again.- Specified by:
- reenablein interface- CaseExecutionCommandBuilder
 
 - 
completepublic void complete() Description copied from interface:CaseExecutionCommandBuilderAdditionally to CaseExecutionCommandBuilder.execute()the associated case execution will be completed. Therefore there happens a transition from the stateACTIVEto stateCOMPLETED.It is only possible to complete a case execution which is associated with a StageorTask.In case of a Stagethe 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:
- completein interface- CaseExecutionCommandBuilder
 
- there are no children in the state 
 - 
closepublic void close() Description copied from interface:CaseExecutionCommandBuilderAdditionally to CaseExecutionCommandBuilder.execute()the associated case instance will be closed, so that no further work or modifications is allowed for the associated case instance. Therefore there happens a transition from the stateCOMPLETEDto stateCLOSED.- Specified by:
- closein interface- CaseExecutionCommandBuilder
 
 - 
terminatepublic void terminate() Description copied from interface:CaseExecutionCommandBuilderAdditionally to CaseExecutionCommandBuilder.execute()the associated case execution will be terminated. Therefore there happens a transition to stateTERMINATED.- Specified by:
- terminatein interface- CaseExecutionCommandBuilder
 
 - 
executeCommandprotected void executeCommand(Command<?> command) 
 - 
getCaseExecutionIdpublic String getCaseExecutionId() 
 - 
getVariablespublic VariableMap getVariables() 
 - 
getVariablesLocalpublic VariableMap getVariablesLocal() 
 - 
getVariableDeletionspublic Collection<String> getVariableDeletions() 
 - 
getVariableLocalDeletionspublic Collection<String> getVariableLocalDeletions() 
 
- 
 
-