3 Replies Latest reply on Sep 15, 2005 3:59 AM by rankorn

    Variables copy?

    rankorn

      I have 3 actions that work with variables:
      The first one will create a List and store it in the ExecutionContext.
      The second one will get it using getVariable() and add items.
      The third will get it and print the List.

      When I try to print the List, the items that are put in the second action are not visible. I must use setVariable() after the change to make them appear!

      This behavior looks as if when I call getVariable() I get a copy of the variable.

      It this the case or am I doing something wrong here?

      Ran.

        • 1. Re: Variables copy?
          patka

          I can't help you just want to say that I've noticed the same. The variable obtained via getVariable seems to be only a copy.

          patka

          • 2. Re: Variables copy?
            rankorn

            I guess this is intended...
            I wonder how I can use the real references, my concerns is that those copies take time and influence performance.

            • 3. Re: Variables copy?
              rankorn

              Ok.

              One sulotion is to use transient variables instead of normal variables that I guess, because of the persistency nature of jBPM, hold a copy.
              Transient variables will always get the object reference.

              If you don't need the DB, transient variables can work.

              Ran.