Class CaseExecutionCommandBuilderImpl

    • Field Detail

      • caseExecutionId

        protected java.lang.String caseExecutionId
      • variableDeletions

        protected java.util.Collection<java.lang.String> variableDeletions
      • variableLocalDeletions

        protected java.util.Collection<java.lang.String> variableLocalDeletions
    • Constructor Detail

      • CaseExecutionCommandBuilderImpl

        public CaseExecutionCommandBuilderImpl​(CommandExecutor commandExecutor,
                                               java.lang.String caseExecutionId)
      • CaseExecutionCommandBuilderImpl

        public CaseExecutionCommandBuilderImpl​(CommandContext commandContext,
                                               java.lang.String caseExecutionId)
    • Method Detail

      • setVariable

        public CaseExecutionCommandBuilder setVariable​(java.lang.String variableName,
                                                       java.lang.Object variableValue)
        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 interface CaseExecutionCommandBuilder
        Parameters:
        variableName - the name of the variable to set
        variableValue - the value of the variable to set
        Returns:
        the builder
      • setVariables

        public CaseExecutionCommandBuilder setVariables​(java.util.Map<java.lang.String,​java.lang.Object> variables)
        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 interface CaseExecutionCommandBuilder
        Parameters:
        variables - the map of variables
        Returns:
        the builder
      • setVariableLocal

        public CaseExecutionCommandBuilder setVariableLocal​(java.lang.String localVariableName,
                                                            java.lang.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 interface CaseExecutionCommandBuilder
        Parameters:
        localVariableName - the name of the variable to set
        localVariableValue - the value of the variable to set
        Returns:
        the builder
      • setVariablesLocal

        public CaseExecutionCommandBuilder setVariablesLocal​(java.util.Map<java.lang.String,​java.lang.Object> variablesLocal)
        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 interface CaseExecutionCommandBuilder
        Parameters:
        variablesLocal - the map of variables
        Returns:
        the builder
      • removeVariables

        public CaseExecutionCommandBuilder removeVariables​(java.util.Collection<java.lang.String> variableNames)
        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 interface CaseExecutionCommandBuilder
        Parameters:
        variableNames - a collection of names of variables to remove
        Returns:
        the builder
      • removeVariableLocal

        public CaseExecutionCommandBuilder removeVariableLocal​(java.lang.String variableName)
        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 interface CaseExecutionCommandBuilder
        Parameters:
        variableName - the name of a variable to remove
        Returns:
        the builder
      • removeVariablesLocal

        public CaseExecutionCommandBuilder removeVariablesLocal​(java.util.Collection<java.lang.String> variableNames)
        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 interface CaseExecutionCommandBuilder
        Parameters:
        variableNames - a collection of names of variables to remove
        Returns:
        the builder
      • ensureVariablesShouldNotBeRemoved

        protected void ensureVariablesShouldNotBeRemoved​(java.util.Collection<java.lang.String> variableNames)
      • ensureVariableShouldNotBeRemoved

        protected void ensureVariableShouldNotBeRemoved​(java.lang.String variableName)
      • ensureVariablesShouldNotBeSet

        protected void ensureVariablesShouldNotBeSet​(java.util.Collection<java.lang.String> variableNames)
      • ensureVariableShouldNotBeSet

        protected void ensureVariableShouldNotBeSet​(java.lang.String variableName)
      • 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:

        1. if at least one variable name of a variable to remove is passed, those variables will be removed.
        2. if at least one local variable name of a local variable to remove is passed, those local variables will be removed.
        3. if at least one variable to add or update is passed, those variables will be set for a case execution.
        4. 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 interface CaseExecutionCommandBuilder
      • 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 state ENABLED to state DISABLED.

        According to CMMN 1.0 specification the state DISABLED means, that the with the case execution related Stage or Task 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 interface CaseExecutionCommandBuilder
      • 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 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:

        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 interface CaseExecutionCommandBuilder
      • executeCommand

        protected void executeCommand​(Command<?> command)
      • getCaseExecutionId

        public java.lang.String getCaseExecutionId()
      • getVariablesLocal

        public VariableMap getVariablesLocal()
      • getVariableDeletions

        public java.util.Collection<java.lang.String> getVariableDeletions()
      • getVariableLocalDeletions

        public java.util.Collection<java.lang.String> getVariableLocalDeletions()