[jboss-user] [jBPM] - Re: Accessing process variables in rule-task

leon_ do-not-reply at jboss.com
Wed Jun 1 04:52:16 EDT 2011

leon_ [http://community.jboss.org/people/leon_] created the discussion

"Re: Accessing process variables in rule-task"

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

Thanks very much for your reply Esteban.
I am sorry for being a bit unclear. It is my writing style, and I am working on it to define problems in a more clear way :-)

So, if I have a variable "monkey" in my BPMN process (which is added to the map btw), where the user has given a value to in an .ftl form, let's say "chimp". And I want a rule to fire based on the value "chimp" I would write something like:

rule A

          ruleflow-group "chimps_are_nice"


                              (Map)((WorkflowProcessInstance) kcontext.getKnowledgeRuntime().getProcessInstance(WorkflowProcessInstance(.getId())).getVariable("monkey") ==  "chimp";


                             (Map) (WorkflowProcessInstance (kcontext.getKnowledgeRuntime().getProcessInstance(WorkflowProcessInstance().getId()).setVariable("character") =  "nice";

I realise I can store the path into a variable to shorten the code. But this is what it would come down to I guess?
I am retrieving the variable from the map, is this neccesary or can it be ommitted?
I assum to set variables I use *setVariable*, am I right?

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110601/22f038d9/attachment.html 

More information about the jboss-user mailing list