<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi all,<br><br>I am using Drools Guvnor 5.1. I created a rule that uses eval, and OR for conditions. When I tested the rule, I noticed in the log, that actually the rule fired twice. <br>The error seemed to be caused by eval and or combination. When I re-wrote the rule to not use eval, it fired only once. Also, I re-wrote the rule to use eval, but AND for conditions, again, the rule fired once as expected.<br>I wonder if there is any other rule attribute besides no-loop, and lock-on-active that I can use to not have the rule firing twice. Or if there is any way to make the rule not firing twice.The main problem for me, is that after the rule is executed, there are 2 objects created.<br><br>Below is the rule test scenario, and audit log:<br><br><br>Rule with eval and OR, rule fires twice<br>&nbsp;&nbsp;&nbsp; rule "test_rule_1"<br>&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; lock-on-active true<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; no-loop true<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dialect "mvel"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Asset(eval(StringUtils.isBlank(name)))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Asset(eval(StringUtils.isBlank(tag)))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assetfact0 = new Asset();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fact0.setStatus( "INVALID" );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert(fact0 );<br>&nbsp;&nbsp;&nbsp; end<br><br>Audit log:<br>OBJECT ASSERTED value:Asset( model=MODEL, status=null, tag=null, classification=null, name=null, serial=null ) factId: 1<br>FIRING
 rule: [test_rule_1] activationId:test_rule_1 [1] declarations:<br>OBJECT ASSERTED value:Asset( model=null, status=INVALID, tag=null, classification=null, name=null, serial=null ) factId: 2<br>FIRING rule: [test_rule_1] activationId:test_rule_1 [1] declarations:<br>OBJECT ASSERTED value:Asset( model=null, status=INVALID, tag=null, classification=null, name=null, serial=null ) factId: 3<br><br>Rule with eval and AND, rule fires only once:<br>&nbsp;&nbsp;&nbsp; rule "test_rule_2"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lock-on-active true<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; no-loop true<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dialect "mvel"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Asset(eval(StringUtils.isBlank(name)))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Asset(eval(StringUtils.isBlank(tag)))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assetfact0 = new Asset();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fact0.setStatus( "INVALID" );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert(fact0 );<br>&nbsp;&nbsp;&nbsp; end<br><br>Audit log:<br>OBJECT ASSERTED value:Asset( model=MODEL, status=null, tag=null, classification=null, name=null, serial=null ) factId: 1<br>FIRING rule: [test_rule_2] activationId:test_rule_2 [1] declarations:<br>OBJECT ASSERTED value:Asset( model=null, status=INVALID, tag=null, classification=null, name=null, serial=null ) factId: 2<br><br>Rule with simple string validation instead of eval. The rule fires only once. <br><br>&nbsp;&nbsp;&nbsp; rule "test_rule_3"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lock-on-active true<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; no-loop true<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dialect "mvel"<br>&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Asset(name=="''")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Asset(tag=="'''")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assetfact0 = new Asset();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fact0.setStatus( "INVALID" );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert(fact0 );<br>&nbsp;&nbsp;&nbsp; end<br><br><br>Audit log:<br>OBJECT ASSERTED value:Asset( model=MODEL, status=null, tag=null, classification=null, name='', serial=null ) factId: 1<br>FIRING rule: [test_rule_3] activationId: test_rule_3 [1] declarations:<br>OBJECT ASSERTED value:Asset( model=null, status=INVALID, tag=null, classification=null, name=null, serial=null ) factId:
 2<br><br><br>Thanks,<br>Patricia<br></td></tr></table><br>