Class CaseExecutionCommandBuilderImpl
- All Implemented Interfaces:
CaseExecutionCommandBuilder
- Author:
- Roman Smirnov
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected CommandContext
protected CommandExecutor
protected Collection<String>
protected Collection<String>
protected VariableMapImpl
protected VariableMapImpl
-
Constructor Summary
ConstructorDescriptionCaseExecutionCommandBuilderImpl
(CommandContext commandContext, String caseExecutionId) CaseExecutionCommandBuilderImpl
(CommandExecutor commandExecutor, String caseExecutionId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Additionally toCaseExecutionCommandBuilder.execute()
the associated case instance will be closed, so that no further work or modifications is allowed for the associated case instance.void
complete()
Additionally toCaseExecutionCommandBuilder.execute()
the associated case execution will be completed.void
disable()
Additionally toCaseExecutionCommandBuilder.execute()
the associated case execution will be disabled.protected void
protected void
protected void
ensureVariableShouldNotBeRemoved
(String variableName) protected void
ensureVariableShouldNotBeSet
(String variableName) protected void
protected void
protected void
ensureVariablesShouldNotBeRemoved
(Collection<String> variableNames) protected void
ensureVariablesShouldNotBeSet
(Collection<String> variableNames) void
execute()
Invoking this method will remove and/or set the passed variables.protected void
executeCommand
(Command<?> command) void
Additionally toCaseExecutionCommandBuilder.execute()
the associated case execution will be started manually.void
reenable()
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).void
Additionally 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:CaseExecutionCommandBuilder
Pass 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:
setVariable
in 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:CaseExecutionCommandBuilder
Pass 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:
setVariables
in interfaceCaseExecutionCommandBuilder
- Parameters:
variables
- the map of variables- Returns:
- the builder
-
setVariableLocal
public CaseExecutionCommandBuilder setVariableLocal(String localVariableName, Object localVariableValue) Description copied from interface:CaseExecutionCommandBuilder
Pass a local variable to the case execution (not considering parent scopes).
Invoking this method multiple times allows passing multiple variables.
- Specified by:
setVariableLocal
in 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:CaseExecutionCommandBuilder
Pass a map of variables to the case execution (not considering parent scopes).
Invoking this method multiple times allows passing multiple variables.
- Specified by:
setVariablesLocal
in interfaceCaseExecutionCommandBuilder
- Parameters:
variablesLocal
- the map of variables- Returns:
- the builder
-
removeVariable
Description copied from interface:CaseExecutionCommandBuilder
Pass 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:
removeVariable
in interfaceCaseExecutionCommandBuilder
- Parameters:
variableName
- the name of a variable to remove- Returns:
- the builder
-
removeVariables
Description copied from interface:CaseExecutionCommandBuilder
Pass 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:
removeVariables
in interfaceCaseExecutionCommandBuilder
- Parameters:
variableNames
- a collection of names of variables to remove- Returns:
- the builder
-
removeVariableLocal
Description copied from interface:CaseExecutionCommandBuilder
Pass 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:
removeVariableLocal
in interfaceCaseExecutionCommandBuilder
- Parameters:
variableName
- the name of a variable to remove- Returns:
- the builder
-
removeVariablesLocal
Description copied from interface:CaseExecutionCommandBuilder
Pass 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:
removeVariablesLocal
in 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:CaseExecutionCommandBuilder
Invoking 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:
execute
in interfaceCaseExecutionCommandBuilder
-
manualStart
public void manualStart()Description copied from interface:CaseExecutionCommandBuilder
Additionally to
CaseExecutionCommandBuilder.execute()
the associated case execution will be started manually. Therefore there happens a transition from the stateENABLED
to stateACTIVE
.According to CMMN 1.0 specification the state
ACTIVE
means, that the with the case execution relatedStage
orTask
is executing in this state:Task
: thetask
will be completed immediatelyHumanTask
: a newuser task
will be instantiatedProcessTask
: a newprocess instance
will be instantiatedCaseTask
: a newcase instance
will be instantiated
- Specified by:
manualStart
in interfaceCaseExecutionCommandBuilder
-
disable
public void disable()Description copied from interface:CaseExecutionCommandBuilder
Additionally to
CaseExecutionCommandBuilder.execute()
the associated case execution will be disabled. Therefore there happens a transition from the stateENABLED
to stateDISABLED
.According to CMMN 1.0 specification the state
DISABLED
means, that the with the case execution relatedStage
orTask
should 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:
disable
in interfaceCaseExecutionCommandBuilder
-
reenable
public void reenable()Description copied from interface:CaseExecutionCommandBuilder
Additionally to
CaseExecutionCommandBuilder.execute()
the associated case execution will be re-enabled. Therefore there happens a transition from the stateDISABLED
to stateENABLED
.According to CMMN 1.0 specification the state
DISABLED
means, that the with the case execution relatedStage
orTask
is waiting for a decision to becomeACTIVE
orDISABLED
once again.- Specified by:
reenable
in interfaceCaseExecutionCommandBuilder
-
complete
public void complete()Description copied from interface:CaseExecutionCommandBuilder
Additionally to
CaseExecutionCommandBuilder.execute()
the associated case execution will be completed. Therefore there happens a transition from the stateACTIVE
to stateCOMPLETED
.It is only possible to complete a case execution which is associated with a
Stage
orTask
.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:
complete
in interfaceCaseExecutionCommandBuilder
- there are no children in the state
-
close
public void close()Description copied from interface:CaseExecutionCommandBuilder
Additionally 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 stateCOMPLETED
to stateCLOSED
.- Specified by:
close
in interfaceCaseExecutionCommandBuilder
-
terminate
public void terminate()Description copied from interface:CaseExecutionCommandBuilder
Additionally to
CaseExecutionCommandBuilder.execute()
the associated case execution will be terminated. Therefore there happens a transition to stateTERMINATED
.- Specified by:
terminate
in interfaceCaseExecutionCommandBuilder
-
executeCommand
-
getCaseExecutionId
-
getVariables
-
getVariablesLocal
-
getVariableDeletions
-
getVariableLocalDeletions
-