1 Reply Latest reply on Mar 6, 2010 4:40 AM by tonylopes

    Bug in VariableContainer.getVariables()?

    matthiasbraeuer

      Below is the implementation of VariableContainer.getVariables():

       public Map getVariables() {
       Map variables = getVariablesLocally();
       VariableContainer parent = getParentVariableContainer();
       if (parent!=null) {
       Map parentVariables = parent.getVariablesLocally();
       parentVariables.putAll(variables);
       variables = parentVariables;
       }
       return variables;
       }
      


      I might be wrong but the line with "Map parentVariables = parent.getVariablesLocally();" looks a bit odd. Shouldn't the variable container collect ALL variables of ALL parents by calling parent.getVariables()?


        • 1. Re: Bug in VariableContainer.getVariables()?

          Same doubt here.

          If I create a new execution context then a new task inside it won't be able to access the process variables, right? I would have to copy all the variables, but the addVariables checks if there is a parent token (same logic as the getVariables). In the end, I'd have to create the variables inside the new execution context just to be able to read some values. It can get really troublesome if those process variables change.