[jboss-user] [jBPM] - Process variable resets to null

Prageeth Jayasinghe do-not-reply at jboss.com
Sun Aug 7 09:24:49 EDT 2011


Prageeth Jayasinghe [http://community.jboss.org/people/pragiya] created the discussion

"Process variable resets to null"

To view the discussion, visit: http://community.jboss.org/message/619805#619805

--------------------------------------------------------------
Hi all;
     I have a problem with jbpm 3.2.8. My jpdl file is shown below.
 http://community.jboss.org/servlet/JiveServlet/showImage/2-619805-16840/simple2.jpg  http://community.jboss.org/servlet/JiveServlet/downloadImage/2-619805-16840/450-253/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.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/619805#619805]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110807/9fab85e4/attachment-0001.html 


More information about the jboss-user mailing list