Class CaseExecutionCommandBuilderImpl
- All Implemented Interfaces:
CaseExecutionCommandBuilder
- Author:
- Roman Smirnov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected CommandContextprotected CommandExecutorprotected Collection<String>protected Collection<String>protected VariableMapImplprotected VariableMapImpl -
Constructor Summary
ConstructorsConstructorDescriptionCaseExecutionCommandBuilderImpl(CommandContext commandContext, String caseExecutionId) CaseExecutionCommandBuilderImpl(CommandExecutor commandExecutor, String caseExecutionId) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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 voidprotected voidprotected voidensureVariableShouldNotBeRemoved(String variableName) protected voidensureVariableShouldNotBeSet(String variableName) protected voidprotected voidprotected 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) voidAdditionally toCaseExecutionCommandBuilder.execute()the associated case execution will be started manually.voidreenable()Additionally toCaseExecutionCommandBuilder.execute()the associated case execution will be re-enabled.removeVariable(String variableName) Pass a variable name of a variable to be removed for a case execution.removeVariableLocal(String variableName) Pass a variable name of a local variable to be removed for a case execution (not considering parent scopes).removeVariables(Collection<String> variableNames) Pass a collection of variable names of variables to be removed for a case execution.removeVariablesLocal(Collection<String> variableNames) Pass a collection of variable names of local variables to be removed for a case execution (not considering parent scopes).setVariable(String variableName, Object variableValue) Pass a variable to the case execution.setVariableLocal(String localVariableName, Object localVariableValue) Pass a local variable to the case execution (not considering parent scopes).setVariables(Map<String, Object> variables) Pass a map of variables to the case execution.setVariablesLocal(Map<String, Object> variablesLocal) Pass a map of variables to the case execution (not considering parent scopes).voidAdditionally toCaseExecutionCommandBuilder.execute()the associated case execution will be terminated.
-
Field Details
-
commandExecutor
-
commandContext
-
caseExecutionId
-
variables
-
variablesLocal
-
variableDeletions
-
variableLocalDeletions
-
-
Constructor Details
-
CaseExecutionCommandBuilderImpl
-
CaseExecutionCommandBuilderImpl
-
-
Method Details
-
setVariable
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 interfaceCaseExecutionCommandBuilder- Parameters:
variableName- the name of the variable to setvariableValue- the value of the variable to set- Returns:
- the builder
-
setVariables
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 interfaceCaseExecutionCommandBuilder- Parameters:
variables- the map of variables- Returns:
- the builder
-
setVariableLocal
public 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 interfaceCaseExecutionCommandBuilder- Parameters:
localVariableName- the name of the variable to setlocalVariableValue- the value of the variable to set- Returns:
- the builder
-
setVariablesLocal
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 interfaceCaseExecutionCommandBuilder- Parameters:
variablesLocal- the map of variables- Returns:
- the builder
-
removeVariable
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 interfaceCaseExecutionCommandBuilder- Parameters:
variableName- the name of a variable to remove- Returns:
- the builder
-
removeVariables
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 interfaceCaseExecutionCommandBuilder- Parameters:
variableNames- a collection of names of variables to remove- Returns:
- the builder
-
removeVariableLocal
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 interfaceCaseExecutionCommandBuilder- Parameters:
variableName- the name of a variable to remove- Returns:
- the builder
-
removeVariablesLocal
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 interfaceCaseExecutionCommandBuilder- Parameters:
variableNames- a collection of names of variables to remove- Returns:
- the builder
-
ensureVariablesShouldNotBeRemoved
-
ensureVariableShouldNotBeRemoved
-
ensureVariablesShouldNotBeSet
-
ensureVariableShouldNotBeSet
-
ensureVariablesInitialized
protected void ensureVariablesInitialized() -
ensureVariablesLocalInitialized
protected void ensureVariablesLocalInitialized() -
ensureVariableDeletionsInitialized
protected void ensureVariableDeletionsInitialized() -
ensureVariableDeletionsLocalInitialized
protected void ensureVariableDeletionsLocalInitialized() -
execute
public 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 interfaceCaseExecutionCommandBuilder
-
manualStart
public 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: thetaskwill be completed immediatelyHumanTask: a newuser taskwill be instantiatedProcessTask: a newprocess instancewill be instantiatedCaseTask: a newcase instancewill be instantiated
- Specified by:
manualStartin interfaceCaseExecutionCommandBuilder
-
disable
public 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 interfaceCaseExecutionCommandBuilder
-
reenable
public 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 interfaceCaseExecutionCommandBuilder
-
complete
public 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 interfaceCaseExecutionCommandBuilder
- there are no children in the state
-
close
public 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 interfaceCaseExecutionCommandBuilder
-
terminate
public 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 interfaceCaseExecutionCommandBuilder
-
executeCommand
-
getCaseExecutionId
-
getVariables
-
getVariablesLocal
-
getVariableDeletions
-
getVariableLocalDeletions
-