0 Replies Latest reply on Aug 7, 2011 9:24 AM by Prageeth Jayasinghe

    Process variable resets to null

    Prageeth Jayasinghe Newbie

      Hi all;

           I have a problem with jbpm 3.2.8. My jpdl file is shown below.

      simple2.jpg

      I have a process varible named "amount". The type of which is Integer. I set the value of it to 200 at the 'start'.

      I print the value of it at the "node-entry" and "node-leave" events of the "Human1" human task node.

      For the first time it prints 200 and everything is ok.

      In my "node2" at node-leave event, I change the value of the variable as below.

      public void execute(ExecutionContext context) throws Exception {

          context.setVariable("amount", (Integer)context.getVariable("amount") - 60);

      }

       

      So the new value of the varible "amount" should be 140. It seems ok.

      (Forget about my decision node since it is used to end the process only if amount is less than zero.)

      I again print the value of amount in "node1" script task and "Human1" node-entry action.

      As usual it prints 140. So everything is ok up to now.

      But when I print the value at the "node-leave" event of "Human1" human task it prints null.

      I can't understand this behavior. Can't I use process variables in a loop?

      Please help me. I am ready to supply more info if needed.Thanks in advance.