<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Wolfgang I use patterns like that for a data filtering problem and also for a preferential selection problem. Any time I have two sources of the same data and I prefer one over the other that pattern allows you to pick the secondary source when the preferred data doesn&#8217;t exist. Also used in cases where we want to execute a different action in the absence of the second source.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>It also occurs for us when dealing with a list of objects where we have two sources for the same type of data and we prefer one data source over the other, but we don&#8217;t always get data for the preferred source.. We use your pattern to make sure the preferred source doesn&#8217;t exist before using the secondary source<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Joe <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Here is an example from our code. $ebs is a List&lt;Map&gt;. Mapping to your example the Map is the fact and the combination of BnftInfoCdoe and BnftCvgeLevelCode would be the field.:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp; Map(</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>this</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>[BenefitsConsts.BenefitResponseEligibility.BnftInfoCode] == </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>'C'</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>,</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>this</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>[BenefitsConsts.BenefitResponseEligibility.BnftCvgeLevelCode] == </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>'IND'</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>,</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>this</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>[BenefitsConsts.BenefitResponseEligibility.SvcTypeCode] == </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;30&quot;</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>,</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:.5in;text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>this</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>[BenefitsConsts.BenefitResponseEligibility.CvgePeriodQlfr] == </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>'25'</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>, </span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>this</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>[BenefitsConsts.BenefitResponseEligibility.BnftAmt] </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>matches</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;0.*&quot;</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>) </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>from</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> $ebs</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>not</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> (Map(</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>this</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>[BenefitsConsts.BenefitResponseEligibility.BnftInfoCode] == </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>'C'</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>,</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>this</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>[BenefitsConsts.BenefitResponseEligibility.BnftCvgeLevelCode] == </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>'FAM'</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>) </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>from</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> $ebs)</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> rules-dev-bounces@lists.jboss.org [mailto:rules-dev-bounces@lists.jboss.org] <b>On Behalf Of </b>Wolfgang Laun<br><b>Sent:</b> Thursday, March 24, 2011 11:07 AM<br><b>To:</b> Rules Dev List<br><b>Subject:</b> [rules-dev] An odd couple of patterns<o:p></o:p></span></p></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Has anybody ever seen a situation where a couple of patterns such as<br><br>&nbsp;&nbsp; Fact( field &gt;= 10 )<br>&nbsp;&nbsp; not Fact( field &gt; 20 )<br><br>was appropriate? This does not match Facts where field isn't between 10 and 20, and so it would seem to be the same as<br><br>&nbsp;&nbsp; Fact( field &gt;= 10 &amp;&amp; &lt;= 20 )<br><br>but actually it doesn't match any such Fact whenever any <i>other</i> Fact with field &gt; 20 is around.<br><br>Cheers<br>Wolfgang<o:p></o:p></p></div></body></html>