This content has been marked as final.
Show 3 replies
-
1. Re: Process variables rules template relationship
swiderski.maciej Mar 20, 2012 3:34 AM (in response to subbass00)You can access process variables from rules so I believe that would work for your case. Just make sure you insert process instance as a fact into the session so you can then access it and its variables.
import org.drools.runtime.process.WorkflowProcessInstance rule "your rule" when p: WorkflowProcessInstance() then System.out.println("Variable is " + p.getVariable("yourVar")); end
HTH
-
2. Re: Process variables rules template relationship
subbass00 Mar 20, 2012 7:51 AM (in response to swiderski.maciej)Thank you very much Maciej Swiderski it works fine now .
-
3. Re: Process variables rules template relationship
salaboy21 Mar 20, 2012 8:06 AM (in response to subbass00)You can also do something like:
import org.drools.runtime.process.WorkflowProcessInstance
rule "your rule"
when
p: WorkflowProcessInstance($myVar: variables["yourVar"] == "something")
then
System.out.println("My Variable is equals to something");
end