<div dir="ltr">Hi Thomas,<br><br>A quick solution would be to use agenda groups as follows:<br><br>rule "Rule Init"<br> dialect "java"<br> when<br> ...<br> then<br> ...<br> drools.setFocus("calculate");<br>
end<br><br>rule "Rule 1"<br> dialect "java"<br> lock-on-active true<br> agenda-group "calculate"<br> when<br> ...<br> then<br> ...<br>end<br><br>rule "Rule 2"<br>
dialect "java"<br> lock-on-active true<br> agenda-group "calculate"<br> when<br> ...<br> then<br> ...<br>end<br><br>The result is:<br>Rule Init<br>Rule 2<br>Rule 1<br><br>You can also use ruleflow (ruleflow-group) to achieve this. I think it is the preferred way.<br>
Hope it helps.<br><br>Best Regards,<br><font color="#888888">Michal</font><br><br><div class="gmail_quote">On Wed, Sep 10, 2008 at 2:10 PM, thomas kukofka <span dir="ltr"><<a href="mailto:thomaskukofka@web.de">thomaskukofka@web.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">Hello,<br><br>thanks for your quick reply.<br>I understand your explanation, but adding the <i>lock-on-active rule attribute to rule 1 and 2 only results that none of these rules is executed.<br>
What I want to be excuted for the values below:<br>
</i> TestObject io = new TestObject(TestObject.Type.INPUT);<br>
io.setDoublePropertyValue(TestObject.PARAMETER1, <span style="background-color: rgb(255, 255, 0);">0.2</span>);<br>
<br>
TestObject io2 = new TestObject(TestObject.Type.INPUT);<br>
io2.setDoublePropertyValue(TestObject.PARAMETER1, <span style="background-color: rgb(255, 255, 102);">7.3</span>);<br><br> insert(io);<br> insert(io2);<br> fireallrules();<br>
<br>is:<br><b>Rule Init<br>Rule 1<br>Rule 2<br></b><br>Best Regards<br>Thomas<br><br><blockquote><i>Hi,<br><br>Looking at the .drl file, rules 1,2 are updating objects that are part of<br>their conditions. That will loop even with no-loop set to true.<br>
<br>Look at lock-on-active rule attribute, which may solve your issue.<br><br>Best Regards,<br>Michal</i><br></blockquote></div>
</blockquote></div><br></div>