<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:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri","sans-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;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        text-indent:21.0pt;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1341355428;
        mso-list-type:hybrid;
        mso-list-template-ids:1389685892 1610018152 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:18.0pt;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</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=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>
<div class=WordSection1>
<p class=MsoNormal><span lang=EN-US>Hi, team,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>I have some quick questions here regarding
performance best practices of rule writing. See below two pieces of rules:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Rule “1”<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Salience
100<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> No-loop
true<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> When
$txn : data(sourceid == 5&&txnjustify==”995”&&eval(creditOption($txn)==1)&&eval(isGCSwitch($txn))&&isCurrencyEquals($txn)==0&&compareToPostThreshold($txn)==2);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Then<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> …<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> End<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Rule “2”<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Salience
100<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> No-loop
true<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> When
$txn : data(sourceid == 5&&txnjustify==”995”&&eval(creditOption($txn)==1)&&eval(isGCSwitch($txn))&&isCurrencyEquals($txn)==0&&compareToPostThreshold($txn)==1);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Then<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> …<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> End<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Questions:<o:p></o:p></span></p>
<p class=MsoListParagraph style='margin-left:18.0pt;text-indent:-18.0pt;
mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span
style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span lang=EN-US>Will I gain better performance
if I put the rule differentiator condition “compareToPostThreshold($txn)==2”
at the beginning of both rule 1 and 2? <o:p></o:p></span></p>
<p class=MsoListParagraph style='margin-left:18.0pt;text-indent:-18.0pt;
mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span
style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span lang=EN-US>I saw salaboy’s video
claiming that to avoid using eval() in the rule. Do we have any alternative way
to do that from a performance consideration or I’d better collect/
prepare all the data before I send them into the session?<o:p></o:p></span></p>
<p class=MsoListParagraph style='margin-left:18.0pt;text-indent:-18.0pt;
mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span
style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span lang=EN-US>What’s you guys’
naming convention for rule’s salience?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>PS: my Drools version is 5.2.0.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Best regards<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Abe<o:p></o:p></span></p>
</div>
</body>
</html>