org.activiti.engine.delegate

## Interface VariableScope

- All Known Subinterfaces:
    DelegateExecution, DelegateTask

      public interface VariableScope

  Author:
    Tom Baeyens, Joram Barrez

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `createVariableLocal(String variableName, Object value)`
    `Object` | `getVariable(String variableName)`
    `Object` | `getVariable(String variableName, boolean fetchAllVariables)`
    `<T> T` | `getVariable(String variableName, Class<T> variableClass)`
    `org.activiti.engine.impl.persistence.entity.VariableInstance` | `getVariableInstance(String variableName)`
    `org.activiti.engine.impl.persistence.entity.VariableInstance` | `getVariableInstance(String variableName, boolean fetchAllVariables)`
    `org.activiti.engine.impl.persistence.entity.VariableInstance` | `getVariableInstanceLocal(String variableName)`
    `org.activiti.engine.impl.persistence.entity.VariableInstance` | `getVariableInstanceLocal(String variableName, boolean fetchAllVariables)`
    `Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance>` | `getVariableInstances()`
    `Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance>` | `getVariableInstances(Collection<String> variableNames)`
    `Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance>` | `getVariableInstances(Collection<String> variableNames, boolean fetchAllVariables)`
    `Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance>` | `getVariableInstancesLocal()`
    `Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance>` | `getVariableInstancesLocal(Collection<String> variableNames)`
    `Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance>` | `getVariableInstancesLocal(Collection<String> variableNames, boolean fetchAllVariables)`
    `Object` | `getVariableLocal(String variableName)`
    `Object` | `getVariableLocal(String variableName, boolean fetchAllVariables)`
    `<T> T` | `getVariableLocal(String variableName, Class<T> variableClass)`
    `Set<String>` | `getVariableNames()`
    `Set<String>` | `getVariableNamesLocal()`
    `Map<String,Object>` | `getVariables()`
    `Map<String,Object>` | `getVariables(Collection<String> variableNames)`
    `Map<String,Object>` | `getVariables(Collection<String> variableNames, boolean fetchAllVariables)`
    `Map<String,Object>` | `getVariablesLocal()`
    `Map<String,Object>` | `getVariablesLocal(Collection<String> variableNames)`
    `Map<String,Object>` | `getVariablesLocal(Collection<String> variableNames, boolean fetchAllVariables)`
    `boolean` | `hasVariable(String variableName)`
    `boolean` | `hasVariableLocal(String variableName)`
    `boolean` | `hasVariables()`
    `boolean` | `hasVariablesLocal()`
    `void` | `removeVariable(String variableName)` Removes the variable and creates a new `HistoricVariableUpdateEntity` .
    `void` | `removeVariableLocal(String variableName)` Removes the local variable and creates a new `HistoricVariableUpdateEntity`.
    `void` | `removeVariables()` Removes the (local) variables and creates a new `HistoricVariableUpdateEntity` for each of them.
    `void` | `removeVariables(Collection<String> variableNames)` Removes the variables and creates a new `HistoricVariableUpdateEntity` for each of them.
    `void` | `removeVariablesLocal()` Removes the (local) variables and creates a new `HistoricVariableUpdateEntity` for each of them.
    `void` | `removeVariablesLocal(Collection<String> variableNames)` Removes the local variables and creates a new `HistoricVariableUpdateEntity` for each of them.
    `void` | `setVariable(String variableName, Object value)` Sets the variable with the provided name to the provided value.
    `void` | `setVariable(String variableName, Object value, boolean fetchAllVariables)`
    `Object` | `setVariableLocal(String variableName, Object value)`
    `Object` | `setVariableLocal(String variableName, Object value, boolean fetchAllVariables)`
    `void` | `setVariables(Map<String,? extends Object> variables)` Sets the provided variables to the variable scope.
    `void` | `setVariablesLocal(Map<String,? extends Object> variables)`

- - ### Method Detail

    - #### getVariables

          Map<String,Object> getVariables()

    - #### getVariableInstances

          Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance> getVariableInstances()

    - #### getVariables

          Map<String,Object> getVariables(Collection<String> variableNames)

    - #### getVariableInstances

          Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance> getVariableInstances(Collection<String> variableNames)

    - #### getVariables

          Map<String,Object> getVariables(Collection<String> variableNames,
                                          boolean fetchAllVariables)

    - #### getVariableInstances

          Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance> getVariableInstances(Collection<String> variableNames,
                                                                                                        boolean fetchAllVariables)

    - #### getVariablesLocal

          Map<String,Object> getVariablesLocal()

    - #### getVariableInstancesLocal

          Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance> getVariableInstancesLocal()

    - #### getVariablesLocal

          Map<String,Object> getVariablesLocal(Collection<String> variableNames)

    - #### getVariableInstancesLocal

          Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance> getVariableInstancesLocal(Collection<String> variableNames)

    - #### getVariablesLocal

          Map<String,Object> getVariablesLocal(Collection<String> variableNames,
                                               boolean fetchAllVariables)

    - #### getVariableInstancesLocal

          Map<String,org.activiti.engine.impl.persistence.entity.VariableInstance> getVariableInstancesLocal(Collection<String> variableNames,
                                                                                                             boolean fetchAllVariables)

    - #### getVariable

          Object getVariable(String variableName)

    - #### getVariableInstance

          org.activiti.engine.impl.persistence.entity.VariableInstance getVariableInstance(String variableName)

    - #### getVariable

          Object getVariable(String variableName,
                             boolean fetchAllVariables)

    - #### getVariableInstance

          org.activiti.engine.impl.persistence.entity.VariableInstance getVariableInstance(String variableName,
                                                                                           boolean fetchAllVariables)

    - #### getVariableLocal

          Object getVariableLocal(String variableName)

    - #### getVariableInstanceLocal

          org.activiti.engine.impl.persistence.entity.VariableInstance getVariableInstanceLocal(String variableName)

    - #### getVariableLocal

          Object getVariableLocal(String variableName,
                                  boolean fetchAllVariables)

    - #### getVariableInstanceLocal

          org.activiti.engine.impl.persistence.entity.VariableInstance getVariableInstanceLocal(String variableName,
                                                                                                boolean fetchAllVariables)

    - #### getVariable

          <T> T getVariable(String variableName,
                            Class<T> variableClass)

    - #### getVariableLocal

          <T> T getVariableLocal(String variableName,
                                 Class<T> variableClass)

    - #### getVariableNames

          Set<String> getVariableNames()

    - #### getVariableNamesLocal

          Set<String> getVariableNamesLocal()

    - #### setVariable

          void setVariable(String variableName,
                           Object value)

      Sets the variable with the provided name to the provided value.

      A variable is set according to the following algorithm:

    - If this scope already contains a variable by the provided name as a local variable, its value is overwritten to the provided value.
    - If this scope does not contain a variable by the provided name as a local variable, the variable is set to this scope's parent scope, if there is one. If there is no parent scope (meaning this scope is the root scope of the hierarchy it belongs to), this scope is used. This applies recursively up the parent scope chain until, if no scope contains a local variable by the provided name, ultimately the root scope is reached and the variable value is set on that scope.

    In practice for most cases, this algorithm will set variables to the scope of the execution at the process instance’s root level, if there is no execution-local variable by the provided name.

Parameters:
  `variableName` - the name of the variable to be set
  `value` - the value of the variable to be set

- #### setVariable

      void setVariable(String variableName,
                       Object value,
                       boolean fetchAllVariables)

- #### setVariableLocal

      Object setVariableLocal(String variableName,
                              Object value)

- #### setVariableLocal

      Object setVariableLocal(String variableName,
                              Object value,
                              boolean fetchAllVariables)

- #### setVariables

      void setVariables(Map<String,? extends Object> variables)

  Sets the provided variables to the variable scope.

  Variables are set according algorithm for `setVariable(String, Object)`, applied separately to each variable.

  Parameters:
    `variables` - a map of keys and values for the variables to be set
  See Also:
    `{@link VariableScope#setVariable(String, Object)}`

- #### setVariablesLocal

      void setVariablesLocal(Map<String,? extends Object> variables)

- #### hasVariables

      boolean hasVariables()

- #### hasVariablesLocal

      boolean hasVariablesLocal()

- #### hasVariable

      boolean hasVariable(String variableName)

- #### hasVariableLocal

      boolean hasVariableLocal(String variableName)

- #### createVariableLocal

      void createVariableLocal(String variableName,
                               Object value)

- #### removeVariable

      void removeVariable(String variableName)

  Removes the variable and creates a new `HistoricVariableUpdateEntity` .

- #### removeVariableLocal

      void removeVariableLocal(String variableName)

  Removes the local variable and creates a new `HistoricVariableUpdateEntity`.

- #### removeVariables

      void removeVariables(Collection<String> variableNames)

  Removes the variables and creates a new `HistoricVariableUpdateEntity` for each of them.

- #### removeVariablesLocal

      void removeVariablesLocal(Collection<String> variableNames)

  Removes the local variables and creates a new `HistoricVariableUpdateEntity` for each of them.

- #### removeVariables

      void removeVariables()

  Removes the (local) variables and creates a new `HistoricVariableUpdateEntity` for each of them.

- #### removeVariablesLocal

      void removeVariablesLocal()

  Removes the (local) variables and creates a new `HistoricVariableUpdateEntity` for each of them.

Copyright © 2016 Alfresco. All rights reserved.