AnsweredAssumed Answered


Question asked by etienne on Jul 10, 2011
Latest reply on Jul 11, 2011 by etienne

I've gone through the implementation of org.activiti.engine.delegate.VariableScope#getVariables and the following question came up: if the same name is used for a variable on different scopes in the scope hierarchy, why does the variable furthest up the tree have precedence? Intuitively, I would have imagined that a more 'local' scope has precedence.

This is the code I mean:

for (VariableInstanceEntity variableInstance: variableInstances.values()) {
      variables.put(variableInstance.getName(), variableInstance.getValue());
VariableScopeImpl parentScope = getParentVariableScope();
if (parentScope!=null) {
      return parentScope.collectVariables(variables);

Thanks for sharing the thoughts behind this implementation 'strategy'.
Regards, Etienne