This is true, but be aware that if a cell value in the Template data is empty the whole Fact Pattern is omitted.<br><br>For example:-<br><br><span style="font-family:courier new,monospace">rule &quot;Discount @{row.rowNumber}&quot;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">  when</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    Account( $v : @{field} != null )</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">    $c : Customer( @{field} == $v , accno == @{accno} )</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">  then</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">    $c.setDiscount(1);</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">end</span><br style="font-family:courier new,monospace">

<br>If &quot;field&quot; is empty neither &quot;Account&quot; or &quot;Customer&quot; will be included in the generated DRL.<br><br>If &quot;accno&quot; is empty &quot;Customer&quot; will not be included in the generated DRL.<br>
<br>This may have an impact on what you want to achieve.<br><br>With kind regards,<br><br>Mike<br><br><div class="gmail_quote">On 19 March 2012 21:29, Vincent LEGENDRE <span dir="ltr">&lt;<a href="mailto:vincent.legendre@eurodecision.com">vincent.legendre@eurodecision.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
Instead of using a workaround, did you have a look to rule templates ?<br>
  - under guvnor : <a href="http://docs.jboss.org/drools/release/5.4.0.Beta2/drools-guvnor-docs/html_single/index.html#d0e1143" target="_blank">http://docs.jboss.org/drools/release/5.4.0.Beta2/drools-guvnor-docs/html_single/index.html#d0e1143</a><br>

  - drl : <a href="http://docs.jboss.org/drools/release/5.4.0.Beta2/drools-expert-docs/html_single/index.html#d0e7501" target="_blank">http://docs.jboss.org/drools/release/5.4.0.Beta2/drools-expert-docs/html_single/index.html#d0e7501</a><br>

<br>
You should be able to do exactly what you are trying to do, but properly, like that :<br>
<br>
template header<br>
field<br>
accno<br>
<br>
package range;<br>
<br>
template &quot;Discount&quot;<br>
  rule &quot;Discount @{row.rowNumber}&quot;<br>
  when<br>
    Account( $v : @{field} != null )<br>
    $c : Customer( @{field} == $v , accno == @{accno} )<br>
  then<br>
    $c.setDiscount(1);<br>
  end<br>
end template<br>
<br>
<br>
----- Mail original -----<br>
De: &quot;Sumeet Karawal&quot; &lt;<a href="mailto:sumeet.karawal@tcs.com">sumeet.karawal@tcs.com</a>&gt;<br>
À: &quot;Rules Users List&quot; &lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
Envoyé: Jeudi 15 Mars 2012 14:20:01<br>
Objet: Re: [rules-users] Data comparing in CONDITION column decision table<br>
<div class="HOEnZb"><div class="h5"><br>
I inserted Account column with values that are always true.<br>
<br>
Works fine. :)<br>
<br>
Will try the same with 5.3 .<br>
<br>
Thanks &amp; Regards,<br>
Sumeet<br>
<br>
<br>
<br>
<br>
  From:       Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;<br>
<br>
  To:         Rules Users List &lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
<br>
  Date:       03/15/2012 05:30 PM<br>
<br>
  Subject:    Re: [rules-users] Data comparing in CONDITION column decision table<br>
<br>
  Sent by:    <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
The documentation for 5.3.0 says<br>
&lt;quote&gt;<br>
To include a pattern without constraints, you can write the pattern in<br>
front of the text for another pattern.<br>
&lt;/quote&gt;<br>
but it does not work with 5.2.0 and (likely) later versions.<br>
<br>
As a workaround, re-insert the Account column and use a redundant<br>
condition that is certainly true for all facts.<br>
<br>
I&#39;ll have to look into this.<br>
<br>
-W<br>
<br>
<br>
On 15/03/2012, Sumeet Karawal &lt;<a href="mailto:sumeet.karawal@tcs.com">sumeet.karawal@tcs.com</a>&gt; wrote:<br>
&gt; Hi Wolfgang<br>
&gt;<br>
&gt; any other way to achieve this. I have tried many times, but no success<br>
till<br>
&gt; now :(<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Sumeet<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;   From:       Sumeet Karawal &lt;<a href="mailto:sumeet.karawal@tcs.com">sumeet.karawal@tcs.com</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt;   To:         Rules Users List &lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt;   Date:       03/15/2012 04:24 PM<br>
&gt;<br>
&gt;<br>
&gt;   Subject:    Re: [rules-users] Data comparing in CONDITION column<br>
decision<br>
&gt; table<br>
&gt;<br>
&gt;   Sent by:    <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; After doing the changes, its taking the rules as:<br>
&gt;<br>
&gt; rule &quot;Discount_10&quot;<br>
&gt;                                 when<br>
&gt;                                                                 $a:Account(type ==<br>
$a.getType(), accno == 1001)<br>
&gt; $c:Customer<br>
&gt;                                 then<br>
&gt;                                                                 $c.setDiscount(1);<br>
&gt; end<br>
&gt;<br>
&gt;<br>
&gt; and if I put it as $a: Account() $c: Customer(), it takes the rules as:<br>
&gt;<br>
&gt; rule &quot;Discount_10&quot;<br>
&gt;                                 when<br>
&gt;                                                                 $a:Account(type ==<br>
$a.getType(), accno == 1001)<br>
&gt; $c:Customer()<br>
&gt;                                 then<br>
&gt;                                                                 $c.setDiscount(1);<br>
&gt; end<br>
&gt;<br>
&gt; Both these throw error..<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; neither putting the $c:Customer before $a:Account is getting executed.<br>
&gt;<br>
&gt;<br>
&gt; Thanks &amp; Regards,<br>
&gt; Sumeet<br>
&gt; Mailto: <a href="mailto:sumeet.karawal@tcs.com">sumeet.karawal@tcs.com</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;   From:       Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt;   To:         Rules Users List &lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt;   Date:       03/15/2012 04:06 PM<br>
&gt;<br>
&gt;<br>
&gt;   Subject:    Re: [rules-users] Data comparing in CONDITION column<br>
decision<br>
&gt; table<br>
&gt;<br>
&gt;   Sent by:    <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On 15/03/2012, Sumeet Karawal &lt;<a href="mailto:sumeet.karawal@tcs.com">sumeet.karawal@tcs.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; How to make changes to the decision table entries to get a drl of this<br>
&gt;&gt; kind:<br>
&gt;&gt;<br>
&gt;<br>
&gt; Put<br>
&gt;    $a: Account() $c: Customer<br>
&gt; into the cell where you now have $c : Customer and delete the Account<br>
&gt; column.<br>
&gt; -W<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; rule &quot;Discount_10&quot;<br>
&gt;&gt;                                                                 when<br>
&gt;&gt;<br>
                           $a : Account()<br>
&gt;&gt;<br>
                           $c : Customer(type ==<br>
&gt; $a.getType(), accno == 1001)<br>
&gt;&gt;                                                                 then<br>
&gt;&gt;<br>
                           $c.setDiscount(1);<br>
&gt;&gt; end<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Sumeet<br>
&gt;&gt; Mailto: <a href="mailto:sumeet.karawal@tcs.com">sumeet.karawal@tcs.com</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;   From:       Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;   To:         Rules Users List &lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;   Date:       03/15/2012 02:47 PM<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;   Subject:    Re: [rules-users] Data comparing in CONDITION column<br>
&gt; decision<br>
&gt;&gt; table<br>
&gt;&gt;<br>
&gt;&gt;   Sent by:    <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Line breaks were lost in transit, but I think that you should remove<br>
&gt;&gt; the quotes from<br>
&gt;&gt;<br>
&gt;&gt;    type == &quot;$param&quot;<br>
&gt;&gt;<br>
&gt;&gt; if you insert an expression $a.getType().<br>
&gt;&gt;<br>
&gt;&gt; -W<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 15/03/2012, Sumeet Karawal &lt;<a href="mailto:sumeet.karawal@tcs.com">sumeet.karawal@tcs.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Can we use a data value of another object in the condition column of a<br>
&gt;&gt;&gt; Spreadsheet.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; For example: I have two data types(POJOs) one com.bank.Customer and<br>
&gt; other<br>
&gt;&gt;&gt; com.bank.Account<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; in the rules I want to check whether the value entered for a particular<br>
&gt;&gt;&gt; field in Customer class is equal to the value entered for the<br>
&gt;&gt; corresponding<br>
&gt;&gt;&gt; field in the Account class. eg Customer.accType = Account.accType()<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; How can we achieve this using Decision table (CONDITION Column). I have<br>
&gt;&gt;&gt; tried this:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;             --------------------------------------------<br>
&gt;&gt;&gt;            |RuleTable<br>
&gt;&gt;&gt;            |Discount<br>
&gt;&gt;&gt;             --------------------------------------------<br>
&gt;&gt;&gt;            |CONDITION      |CONDITION                   |<br>
&gt;&gt;&gt;             ---------------+----------------------------|<br>
&gt;&gt;&gt;            |$a : Account   |$c : Customer               |<br>
&gt;&gt;&gt;             ---------------+----------------------------|<br>
&gt;&gt;&gt;            |               |type == &quot;$param&quot;<br>
&gt;&gt;&gt;  ----------+---------------+----------------------------<br>
&gt;&gt;&gt; | Discount |    Account    |            Type            |<br>
&gt;&gt;&gt; |  Rules   |               |                            |<br>
&gt;&gt;&gt; |----------+---------------+----------------------------|<br>
&gt;&gt;&gt; |    1     |               |        $a.getType()        |<br>
&gt;&gt;&gt; |----------+---------------+----------------------------|<br>
&gt;&gt;&gt; |    2     |               |        $a.getType()        |<br>
&gt;&gt;&gt; |----------+---------------+----------------------------|<br>
&gt;&gt;&gt; |    3     |               |        $a.getType()        |<br>
&gt;&gt;&gt; |----------+---------------+----------------------------|<br>
&gt;&gt;&gt; |    4     |               |        $a.getType()        |<br>
&gt;&gt;&gt; |----------+---------------+----------------------------|<br>
&gt;&gt;&gt; |    5     |               |        $a.getType()        |<br>
&gt;&gt;&gt; |----------+---------------+----------------------------|<br>
&gt;&gt;&gt; |    6     |               |        $a.getType()        |<br>
&gt;&gt;&gt; |----------+---------------+----------------------------|<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; But it won&#39;t work. It would be great if somebody could help me on this.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks &amp; Regards,<br>
&gt;&gt;&gt; Sumeet Karawal<br>
&gt;&gt;&gt; Mailto: <a href="mailto:sumeet.karawal@tcs.com">sumeet.karawal@tcs.com</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =====-----=====-----=====<br>
&gt;&gt;&gt; Notice: The information contained in this e-mail<br>
&gt;&gt;&gt; message and/or attachments to it may contain<br>
&gt;&gt;&gt; confidential or privileged information. If you are<br>
&gt;&gt;&gt; not the intended recipient, any dissemination, use,<br>
&gt;&gt;&gt; review, distribution, printing or copying of the<br>
&gt;&gt;&gt; information contained in this e-mail message<br>
&gt;&gt;&gt; and/or attachments to it are strictly prohibited. If<br>
&gt;&gt;&gt; you have received this communication in error,<br>
&gt;&gt;&gt; please notify us by reply e-mail or telephone and<br>
&gt;&gt;&gt; immediately and permanently delete the message<br>
&gt;&gt;&gt; and any attachments. Thank you<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<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>
<br>
<br>
<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>
_______________________________________________<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>
</div></div></blockquote></div><br>