[rules-users] Reg : Drools 5.5 Templates : CompoundValueRestrictions

Barada (Native5) barry at native5.com
Wed Sep 25 02:32:03 EDT 2013


Hi,

Am trying to model some rules using drools templates.
Currently the data inputs to rule templates are only strings, I need to be able to define a compound value restriction set for the rule i.e if fact attribute is present in a list. (see sample below). 

e.g. 
template header
dealers

template "my-template"
rule "my-rule"
when
    $order : Order(dealer in (@{dealers}))
then 
    System.out.println("Order is present in dealer"
end
end template


I am trying to compile this template by passing it an Object which has a dealers attribute which is essentially a List<String>. Short of creating a function which sends back a comma separated representation of the list,  does the drools compiler provide any option to send a list.

~ Barry





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130925/fd96c5bf/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20130925/fd96c5bf/attachment-0001.bin 


More information about the rules-users mailing list