[rules-users] Process variables in split/action nodes

Kris Verlaenen kris.verlaenen at cs.kuleuven.be
Thu Oct 1 11:32:55 EDT 2009


You should use a code constraint, that allows you to access the variable
directly (if you define them as variables of your process at least,
click the background of your process and edit the "variables" property).
 For example, if you have a variable "count", you can have a code
constraint (MVEL or Java dialect) like:

  return count > 10;

Also, inside your actions, you also have direct access to your process
variables, so your action could be written like this:

  kcontext.setVariable("count", count++);

Kris

Quoting Renato Herebia <renato.herebia at dextra-sw.com>:

> Hi!
> 
> How can I access process variables inside split nodes, in fact, in
> split
> contraints?
> 
> I accessed a process variable named "count" in an action node like
> that:
> 
> Integer c = (Integer) kcontext.getVariable("count");
> kcontext.setVariable("count", ++c);
> 
> But, in a split constraint doesn't work. So, my doubts are:
> - How is the way in split constraints?
> - Is there a simpler way to access process variables in action node?
> 
> Thanks!
> 
> -- 
> Renato Herebia
> 




Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



More information about the rules-users mailing list