use of org.activiti.engine.delegate.VariableScope in project Activiti by Activiti.
the class VariableScopeImpl method getVariableInstance.
public VariableInstance getVariableInstance(String variableName, boolean fetchAllVariables) {
if (fetchAllVariables == true) {
// Check the local single-fetch cache
if (usedVariablesCache.containsKey(variableName)) {
return usedVariablesCache.get(variableName);
}
ensureVariableInstancesInitialized();
VariableInstanceEntity variableInstance = variableInstances.get(variableName);
if (variableInstance != null) {
return variableInstance;
}
// Go up the hierarchy
VariableScope parentScope = getParentVariableScope();
if (parentScope != null) {
return parentScope.getVariableInstance(variableName, true);
}
return null;
} else {
if (usedVariablesCache.containsKey(variableName)) {
return usedVariablesCache.get(variableName);
}
if (variableInstances != null && variableInstances.containsKey(variableName)) {
return variableInstances.get(variableName);
}
VariableInstanceEntity variable = getSpecificVariable(variableName);
if (variable != null) {
usedVariablesCache.put(variableName, variable);
return variable;
}
// Go up the hierarchy
VariableScope parentScope = getParentVariableScope();
if (parentScope != null) {
return parentScope.getVariableInstance(variableName, false);
}
return null;
}
}
use of org.activiti.engine.delegate.VariableScope in project Activiti by Activiti.
the class VariableScopeImpl method hasVariables.
public boolean hasVariables() {
ensureVariableInstancesInitialized();
if (!variableInstances.isEmpty()) {
return true;
}
VariableScope parentScope = getParentVariableScope();
if (parentScope != null) {
return parentScope.hasVariables();
}
return false;
}
Aggregations