public class NoExecutionVariableScope extends Object implements VariableScope
| Constructor and Description |
|---|
NoExecutionVariableScope() |
| Modifier and Type | Method and Description |
|---|---|
void |
createVariableLocal(String variableName,
Object value) |
void |
createVariablesLocal(Map<String,? extends Object> variables) |
static NoExecutionVariableScope |
getSharedInstance()
Since a
NoExecutionVariableScope has no state, it's safe to use the same instance to prevent too many useless instances created. |
Object |
getTransientVariable(String variableName)
Similar to
VariableScope.getVariable(String), including the searching via the parent scopes, but
for transient variables only. |
Object |
getTransientVariableLocal(String variableName)
Similar to
VariableScope.getVariableLocal(String), but for a transient variable. |
Map<String,Object> |
getTransientVariables()
Similar to
VariableScope.getVariables(), but for transient variables only. |
Map<String,Object> |
getTransientVariablesLocal()
Similar to
VariableScope.getVariableLocal(String), but for transient variables only. |
Object |
getVariable(String variableName)
Returns the variable value for one specific variable.
|
Object |
getVariable(String variableName,
boolean fetchAllVariables)
Similar to
VariableScope.getVariable(String), but has an extra flag that indicates whether or not
all variables need to be fetched when getting one variable. |
<T> T |
getVariable(String variableName,
Class<T> variableClass)
Typed version of the
VariableScope.getVariable(String) method. |
VariableInstance |
getVariableInstance(String variableName)
Similar to
VariableScope.getVariable(String), but returns a VariableInstance instance,
which contains more information than just the value. |
VariableInstance |
getVariableInstance(String variableName,
boolean fetchAllVariables)
Similar to
VariableScope.getVariable(String, boolean), but returns an instance of VariableInstance,
which has some additional information beyond the value. |
VariableInstance |
getVariableInstanceLocal(String variableName)
Similar to
VariableScope.getVariableLocal(String), but returns an instance of VariableInstance,
which has some additional information beyond the value. |
VariableInstance |
getVariableInstanceLocal(String variableName,
boolean fetchAllVariables)
Similar to
VariableScope.getVariableLocal(String, boolean), but returns an instance of VariableInstance,
which has some additional information beyond the value. |
Map<String,VariableInstance> |
getVariableInstances()
Returns all variables, as instances of the
VariableInstance interface,
which gives more information than only the the value (type, execution id, etc.) |
Map<String,VariableInstance> |
getVariableInstances(Collection<String> variableNames)
Similar to
VariableScope.getVariableInstances(), but limited to only the variables with the provided names. |
Map<String,VariableInstance> |
getVariableInstances(Collection<String> variableNames,
boolean fetchAllVariables)
Similar to
VariableScope.getVariables(Collection, boolean) but returns the variables
as instances of the VariableInstance interface,
which gives more information than only the the value (type, execution id, etc.) |
Map<String,VariableInstance> |
getVariableInstancesLocal()
Returns the variables local to this scope as instances of the
VariableInstance interface,
which provided additional information about the variable. |
Map<String,VariableInstance> |
getVariableInstancesLocal(Collection<String> variableNames)
Similar to
VariableScope.getVariableInstances(Collection), but only for variables local to this scope. |
Map<String,VariableInstance> |
getVariableInstancesLocal(Collection<String> variableNames,
boolean fetchAllVariables)
Similar to
VariableScope.getVariableInstances(Collection, boolean), but only for variables local to this scope. |
Object |
getVariableLocal(String variableName)
Returns the value for the specific variable and only checks this scope and not any parent scope.
|
Object |
getVariableLocal(String variableName,
boolean fetchAllVariables)
Similar to
VariableScope.getVariableLocal(String), but has an extra flag that indicates whether or not
all variables need to be fetched when getting one variable. |
<T> T |
getVariableLocal(String variableName,
Class<T> variableClass)
Typed version of the
VariableScope.getVariableLocal(String) method. |
Set<String> |
getVariableNames()
Returns all the names of the variables for this scope and all parent scopes.
|
Set<String> |
getVariableNamesLocal()
Returns all the names of the variables for this scope (no parent scopes).
|
Map<String,Object> |
getVariables()
Returns all variables.
|
Map<String,Object> |
getVariables(Collection<String> variableNames)
Similar to
VariableScope.getVariables(), but limited to only the variables with the provided names. |
Map<String,Object> |
getVariables(Collection<String> variableNames,
boolean fetchAllVariables)
Similar to
#getVariables(Collection)), but with a flag that indicates that all
variables should be fetched when fetching the specific variables. |
Map<String,Object> |
getVariablesLocal()
Returns the variable local to this scope only.
|
Map<String,Object> |
getVariablesLocal(Collection<String> variableNames)
Similar to
VariableScope.getVariables(Collection), but only for variables local to this scope. |
Map<String,Object> |
getVariablesLocal(Collection<String> variableNames,
boolean fetchAllVariables)
Similar to
VariableScope.getVariables(Collection, boolean), but only for variables local to this scope. |
boolean |
hasVariable(String variableName)
Returns whether this scope or any parent scope has a specific variable.
|
boolean |
hasVariableLocal(String variableName)
Returns whether this scope has a specific variable.
|
boolean |
hasVariables()
Returns whether this scope or any parent scope has variables.
|
boolean |
hasVariablesLocal()
Returns whether this scope has variables.
|
void |
removeTransientVariable(String variableName)
Removes a specific transient variable.
|
void |
removeTransientVariableLocal(String variableName)
Removes a specific transient variable (also searching parent scopes).
|
void |
removeTransientVariables()
Remove all transient variable of this scope and its parent scopes.
|
void |
removeTransientVariablesLocal()
Removes all local transient variables.
|
void |
removeVariable(String variableName)
Removes the variable and creates a new;@link HistoricVariableUpdateEntity}
|
void |
removeVariableLocal(String variableName)
Removes the local variable and creates a new
HistoricVariableUpdate. |
void |
removeVariables()
Removes the (local) variables and creates a new
HistoricVariableUpdate for each of them. |
void |
removeVariables(Collection<String> variableNames)
Removes the variables and creates a new
HistoricVariableUpdate for each of them. |
void |
removeVariablesLocal()
Removes the (local) variables and creates a new
HistoricVariableUpdate for each of them. |
void |
removeVariablesLocal(Collection<String> variableNames)
Removes the local variables and creates a new
HistoricVariableUpdate for each of them. |
void |
setTransientVariable(String variableName,
Object variableValue)
Similar to
VariableScope.setVariable(String, Object), but the variable is transient:
- no history is kept for the variable
- the variable is only available until a waitstate is reached in the process
- transient variables 'shadow' persistent variable (when getVariable('abc')
where 'abc' is both persistent and transient, the transient value is returned. |
void |
setTransientVariableLocal(String variableName,
Object variableValue)
Similar to
VariableScope.setVariableLocal(String, Object), but for a transient variable. |
void |
setTransientVariables(Map<String,Object> transientVariables)
Similar to
VariableScope.setVariables(Map), but for transient variables. |
void |
setTransientVariablesLocal(Map<String,Object> transientVariables)
Similar to
VariableScope.setVariablesLocal(Map), but for transient variables. |
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)
Similar to
VariableScope.setVariable(String, Object), but with an extra flag to indicate whether
all variables should be fetched while doing this or not. |
Object |
setVariableLocal(String variableName,
Object value)
Similar to
VariableScope.setVariable(String, Object), but the variable is set to this scope specifically. |
Object |
setVariableLocal(String variableName,
Object value,
boolean fetchAllVariables)
Similar to
VariableScope.setVariableLocal(String, Object, boolean), but the variable is set to this scope specifically. |
void |
setVariables(Map<String,? extends Object> variables)
Sets the provided variables to the variable scope.
|
void |
setVariablesLocal(Map<String,? extends Object> variables)
Similar to
VariableScope.setVariables(Map), but the variable are set on this scope specifically. |
public static NoExecutionVariableScope getSharedInstance()
NoExecutionVariableScope has no state, it's safe to use the same instance to prevent too many useless instances created.public Map<String,Object> getVariables()
VariableScopegetVariables in interface VariableScopepublic Map<String,Object> getVariablesLocal()
VariableScopeVariableScope.getVariables(), the variables from the parent scope won't be returned.getVariablesLocal in interface VariableScopepublic Map<String,Object> getVariables(Collection<String> variableNames)
VariableScopeVariableScope.getVariables(), but limited to only the variables with the provided names.getVariables in interface VariableScopepublic Map<String,Object> getVariables(Collection<String> variableNames, boolean fetchAllVariables)
VariableScope#getVariables(Collection)), but with a flag that indicates that all
variables should be fetched when fetching the specific variables.
If set to false, only the specific variables will be fetched.
Dependening on the use case, this can be better for performance, as it avoids fetching and processing
the other variables. However, if the other variables are needed further on, getting them in
one go is probably better (and the variables are cached during one Command execution).getVariables in interface VariableScopepublic Map<String,Object> getVariablesLocal(Collection<String> variableNames)
VariableScopeVariableScope.getVariables(Collection), but only for variables local to this scope.getVariablesLocal in interface VariableScopepublic Map<String,Object> getVariablesLocal(Collection<String> variableNames, boolean fetchAllVariables)
VariableScopeVariableScope.getVariables(Collection, boolean), but only for variables local to this scope.getVariablesLocal in interface VariableScopepublic Object getVariable(String variableName)
VariableScopegetVariable in interface VariableScopepublic Object getVariable(String variableName, boolean fetchAllVariables)
VariableScopeVariableScope.getVariable(String), but has an extra flag that indicates whether or not
all variables need to be fetched when getting one variable.
By default true (for backwards compatibility reasons), which means that calling VariableScope.getVariable(String)
will fetch all variables, of the current scope and all parent scopes.
Setting this flag to false can thus be better for performance. However, variables are cached, and
if other variables are used later on, setting this true might actually be better for performance.getVariable in interface VariableScopepublic Object getVariableLocal(String variableName)
VariableScopegetVariableLocal in interface VariableScopepublic Object getVariableLocal(String variableName, boolean fetchAllVariables)
VariableScopeVariableScope.getVariableLocal(String), but has an extra flag that indicates whether or not
all variables need to be fetched when getting one variable.
By default true (for backwards compatibility reasons), which means that calling VariableScope.getVariableLocal(String)
will fetch all variables, of the current scope.
Setting this flag to false can thus be better for performance. However, variables are cached, and
if other variables are used later on, setting this true might actually be better for performance.getVariableLocal in interface VariableScopepublic <T> T getVariable(String variableName, Class<T> variableClass)
VariableScopeVariableScope.getVariable(String) method.getVariable in interface VariableScopepublic <T> T getVariableLocal(String variableName, Class<T> variableClass)
VariableScopeVariableScope.getVariableLocal(String) method.getVariableLocal in interface VariableScopepublic Map<String,VariableInstance> getVariableInstances()
VariableScopeVariableInstance interface,
which gives more information than only the the value (type, execution id, etc.)getVariableInstances in interface VariableScopepublic Map<String,VariableInstance> getVariableInstances(Collection<String> variableNames)
VariableScopeVariableScope.getVariableInstances(), but limited to only the variables with the provided names.getVariableInstances in interface VariableScopepublic Map<String,VariableInstance> getVariableInstances(Collection<String> variableNames, boolean fetchAllVariables)
VariableScopeVariableScope.getVariables(Collection, boolean) but returns the variables
as instances of the VariableInstance interface,
which gives more information than only the the value (type, execution id, etc.)getVariableInstances in interface VariableScopepublic Map<String,VariableInstance> getVariableInstancesLocal()
VariableScopeVariableInstance interface,
which provided additional information about the variable.getVariableInstancesLocal in interface VariableScopepublic Map<String,VariableInstance> getVariableInstancesLocal(Collection<String> variableNames)
VariableScopeVariableScope.getVariableInstances(Collection), but only for variables local to this scope.getVariableInstancesLocal in interface VariableScopepublic Map<String,VariableInstance> getVariableInstancesLocal(Collection<String> variableNames, boolean fetchAllVariables)
VariableScopeVariableScope.getVariableInstances(Collection, boolean), but only for variables local to this scope.getVariableInstancesLocal in interface VariableScopepublic VariableInstance getVariableInstance(String variableName)
VariableScopeVariableScope.getVariable(String), but returns a VariableInstance instance,
which contains more information than just the value.getVariableInstance in interface VariableScopepublic VariableInstance getVariableInstance(String variableName, boolean fetchAllVariables)
VariableScopeVariableScope.getVariable(String, boolean), but returns an instance of VariableInstance,
which has some additional information beyond the value.getVariableInstance in interface VariableScopepublic VariableInstance getVariableInstanceLocal(String variableName)
VariableScopeVariableScope.getVariableLocal(String), but returns an instance of VariableInstance,
which has some additional information beyond the value.getVariableInstanceLocal in interface VariableScopepublic VariableInstance getVariableInstanceLocal(String variableName, boolean fetchAllVariables)
VariableScopeVariableScope.getVariableLocal(String, boolean), but returns an instance of VariableInstance,
which has some additional information beyond the value.getVariableInstanceLocal in interface VariableScopepublic Set<String> getVariableNames()
VariableScopegetVariableNames in interface VariableScopepublic Set<String> getVariableNamesLocal()
VariableScopegetVariableNamesLocal in interface VariableScopepublic void setVariable(String variableName, Object value)
VariableScopeA variable is set according to the following algorithm:
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.
setVariable in interface VariableScopevariableName - the name of the variable to be setvalue - the value of the variable to be setpublic void setVariable(String variableName, Object value, boolean fetchAllVariables)
VariableScopeVariableScope.setVariable(String, Object), but with an extra flag to indicate whether
all variables should be fetched while doing this or not.
The variable will be put on the highest possible scope. For an execution this is the process instance execution.
If this is not wanted, use the VariableScope.setVariableLocal(String, Object) method instead.
The default (e.g. when calling VariableScope.setVariable(String, Object)), is true, for backwards
compatibility reasons. However, in some use cases, it might make sense not to fetch any other variables
when setting one variable (for example when doing nothing more than just setting one variable).setVariable in interface VariableScopepublic Object setVariableLocal(String variableName, Object value)
VariableScopeVariableScope.setVariable(String, Object), but the variable is set to this scope specifically.setVariableLocal in interface VariableScopepublic Object setVariableLocal(String variableName, Object value, boolean fetchAllVariables)
VariableScopeVariableScope.setVariableLocal(String, Object, boolean), but the variable is set to this scope specifically.setVariableLocal in interface VariableScopepublic void setVariables(Map<String,? extends Object> variables)
VariableScope
Variables are set according algorithm for VariableScope.setVariable(String, Object), applied separately to each variable.
setVariables in interface VariableScopevariables - a map of keys and values for the variables to be setpublic void setVariablesLocal(Map<String,? extends Object> variables)
VariableScopeVariableScope.setVariables(Map), but the variable are set on this scope specifically.setVariablesLocal in interface VariableScopepublic boolean hasVariables()
VariableScopehasVariables in interface VariableScopepublic boolean hasVariablesLocal()
VariableScopehasVariablesLocal in interface VariableScopepublic boolean hasVariable(String variableName)
VariableScopehasVariable in interface VariableScopepublic boolean hasVariableLocal(String variableName)
VariableScopehasVariableLocal in interface VariableScopepublic void removeVariable(String variableName)
VariableScoperemoveVariable in interface VariableScopepublic void removeVariableLocal(String variableName)
VariableScopeHistoricVariableUpdate.removeVariableLocal in interface VariableScopepublic void removeVariables()
VariableScopeHistoricVariableUpdate for each of them.removeVariables in interface VariableScopepublic void removeVariablesLocal()
VariableScopeHistoricVariableUpdate for each of them.removeVariablesLocal in interface VariableScopepublic void removeVariables(Collection<String> variableNames)
VariableScopeHistoricVariableUpdate for each of them.removeVariables in interface VariableScopepublic void removeVariablesLocal(Collection<String> variableNames)
VariableScopeHistoricVariableUpdate for each of them.removeVariablesLocal in interface VariableScopepublic void setTransientVariablesLocal(Map<String,Object> transientVariables)
VariableScopeVariableScope.setVariablesLocal(Map), but for transient variables.
See VariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.setTransientVariablesLocal in interface VariableScopepublic void setTransientVariableLocal(String variableName, Object variableValue)
VariableScopeVariableScope.setVariableLocal(String, Object), but for a transient variable.
See VariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.setTransientVariableLocal in interface VariableScopepublic void setTransientVariables(Map<String,Object> transientVariables)
VariableScopeVariableScope.setVariables(Map), but for transient variables.
See VariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.setTransientVariables in interface VariableScopepublic void setTransientVariable(String variableName, Object variableValue)
VariableScopeVariableScope.setVariable(String, Object), but the variable is transient:
- no history is kept for the variable
- the variable is only available until a waitstate is reached in the process
- transient variables 'shadow' persistent variable (when getVariable('abc')
where 'abc' is both persistent and transient, the transient value is returned.setTransientVariable in interface VariableScopepublic Object getTransientVariableLocal(String variableName)
VariableScopeVariableScope.getVariableLocal(String), but for a transient variable.
See VariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.getTransientVariableLocal in interface VariableScopepublic Map<String,Object> getTransientVariablesLocal()
VariableScopeVariableScope.getVariableLocal(String), but for transient variables only.
See VariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.getTransientVariablesLocal in interface VariableScopepublic Object getTransientVariable(String variableName)
VariableScopeVariableScope.getVariable(String), including the searching via the parent scopes, but
for transient variables only.
See VariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.getTransientVariable in interface VariableScopepublic Map<String,Object> getTransientVariables()
VariableScopeVariableScope.getVariables(), but for transient variables only.
See VariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.getTransientVariables in interface VariableScopepublic void removeTransientVariableLocal(String variableName)
VariableScopeVariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.removeTransientVariableLocal in interface VariableScopepublic void removeTransientVariablesLocal()
VariableScopeVariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.removeTransientVariablesLocal in interface VariableScopepublic void removeTransientVariable(String variableName)
VariableScopeVariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.removeTransientVariable in interface VariableScopepublic void removeTransientVariables()
VariableScopeVariableScope.setTransientVariable(String, Object) for the rules on 'transient' variables.removeTransientVariables in interface VariableScopeCopyright © 2016 Alfresco. All rights reserved.