<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>Am trying to model some rules using drools templates.</div><div>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 <i>fact</i> attribute is present in a list. (see sample below).&nbsp;</div><div><br></div><div>e.g.&nbsp;</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(173, 17, 11); ">template<span style="color: #000000"> header</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">dealers</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-style-span" style="color: rgb(0, 143, 40); "><span style="color: #ad110b">template</span><span style="color: #000000"> </span>"my-template"</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 143, 40); "><span style="color: #ad110b">rule</span><span style="color: #000000"> </span>"my-rule"</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(173, 17, 11); ">when</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">&nbsp; &nbsp; $order : Order(dealer <span style="color: #ad110b">in</span> (@{dealers}))</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">then&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">&nbsp; &nbsp; System.out.println("Order is present in dealer"</div><div>end</div><div>end template</div><div><br></div><div><br></div><div>I am trying to compile this template by passing it an Object which has a dealers attribute which is essentially a List&lt;String&gt;. Short of creating a function which sends back a comma separated representation of the list, &nbsp;does the drools compiler provide any option to send a list.</div><div><br><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="font-weight: normal; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">~ Barry</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><b><br></b><div style="font-weight: normal; "><b><br></b></div><div style="font-weight: normal; "><br><br></div></div></span></div>
</div>
<br></div></body></html>