[rules-users] Drools Decision Table, multiple actions accumulation

Vincent LEGENDRE vincent.legendre at eurodecision.com
Fri Jun 1 15:35:43 EDT 2012


>> ... which would mean I should be able to pass the value present in both the columns in one method call.

Or create a Pojo for your keys (you should have already one as java maps only have one key ...),
instanciate it in the first column in a local (to RHS) variable, 
use setters to set internal keys,
then use this KeyPojo to add your value in the last column.

In DRL  this could be :
...
then
   KeyPojo keys = new KeyPojo();
   keys.setKey1(...);
   ...
   keys.setKeyk(...);
   ...
   keys.setKeyN(...);
   $myMap.put(keys, value);
end

basically, the fist action column will contains the 2 first DRL statements. 
The last action column will contains the 2 last DRL statement.
Intermediate columns only use the setters.

Of course, this works only if you are sure that your first and last action columns are always set ...
Otherwise, hope this help !


More information about the rules-users mailing list