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"

          when

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

          then

                             (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
[http://community.jboss.org/message/608065#608065]

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

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to