This is straightforward: You use $param, as usual, in the code snippet, and the list in the cell below:<br><br>Data<br>coverType in ( $param )<br><br>&quot;A&quot;,&quot;B&quot;, &quot;C&quot;, &quot;D&quot;<br>&quot;X&quot;,&quot;Y&quot;,&quot;Z&quot;<br>
<br>To obtain the actual value from the fact, use a binding variable and refer to this in the action.<br><br>Data<br>$ct: coverType in ( $param )<br>--------------------<br>result<br>add( $ct )<br><br>and an &#39;x&#39; in the cells below, where required.<br>
<br>-W<br><br><br><div class="gmail_quote">2011/2/5 David Smith <span dir="ltr">&lt;<a href="mailto:mail@davesmith.me.uk">mail@davesmith.me.uk</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<div><br></div><div>I am pocing/learning drools and I am trying to implements Compound Value Restrictions using &#39;In&#39; in a decision table.</div><div><br></div><div>I can do this in a rule like</div><div><br></div>

<div><div>rule &quot;CoverType Example&quot;</div><div>when</div><div>    $risk : Data( coverType in (&quot;A&quot;,&quot;B&quot;, &quot;C&quot;, &quot;D&quot;))</div><div>then</div><div>    result.add(&quot;CoverType was one of A, B C or D&quot;);</div>

<div>end</div></div><div><br></div><div>I can also implement this in a decision table in a long winded fashion</div><div>Condition, Action</div><div>Data,        result</div><div>coverType, add(&quot;$param&quot;)</div><div>

<div>A,              CoverType was one of A, B C or D</div></div><div><div>B,              CoverType was one of A, B C or D</div></div><div><div>C,              CoverType was one of A, B C or D</div>
</div><div><div>D,              CoverType was one of A, B C or D</div></div><div><br></div><div>Is there a compact way to do this using a Compound Value Restriction using in?</div><div>Something like:</div>
<div><br></div><div><div>Condition, Action</div><div>Data,        result</div><div>coverType in, add(&quot;$param&quot;)</div><div><div>&quot;A,B,C,D&quot;,              CoverType was one of A, B C or D</div>
</div><div></div></div><div><br></div><div>What goes in the script part &quot;coverType in&quot;?</div><div><br></div><div>The number of items in the list can be variable, so don&#39;t want to write something that has $1, $2, $3, $4</div>

<div><br></div><div>Thanks</div><div>David</div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>