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

Hunor-Attila Kerekes do-not-reply at jboss.com
Mon Mar 19 20:37:53 EDT 2012


Hunor-Attila Kerekes [https://community.jboss.org/people/subbass00] created the discussion

"Re: Accessing process variables in rule-task"

To view the discussion, visit: https://community.jboss.org/message/724877#724877

--------------------------------------------------------------
Hello Esteban,

I have the same problem what leon has. I have added to my fisrt human task at the entry action the kcontext.getKnowledgeRuntime().insert(kcontext.getProcessInstance()); script. My rule currently look like this : 
import com.sample.User;
import org.drools.runtime.process.WorkflowProcessInstance



rule "AgeCheck3"
ruleflow-group "AgeCheck"


    when
        processInstance : WorkflowProcessInstance()
        age: Integer() from (Integer)((WorkflowProcessInstance)processInstance).getVariable("Age");
        eval(age < 18);
    then
        processInstance.setVariable("Name", new String("Denied"));
        System.out.println(age);

end


If I am removing the age declaration with eval(true) the rule is fired and the name is set to Denied. The compiler accept the declaration, no errors during te running phase, but the rule is not fired.
Can you help me plese? I am doing my master thesis and this is also a small part of it.

Thank you in advance.
Kind regards, Hunor
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://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/20120319/607a7e8c/attachment.html 


More information about the jboss-user mailing list