Your question shows that you have misunderstood the Concept of Rule, or that<br>you have tricked yourself into thinking that *all* action in a rules file must be<br>structured in rules.<br><br>If, as a consequence of rule 1 you need to execute the consequence of some<br>
other rule, you might write that as a function or Java method and call it from<br>both rules.<br><br>Also, reconsider the if statement in the then part of your 1st rule. Isn't it<br>possible to add this condition to the left hand side? Or, considering the<br>
conditions that ought to trigger the consequence of your second rule,<br>isn't it possible to write them all in that rule's left hand side?<br><br>Anyway, rules are not methods or procedures, and "navigating between<br>
rules" is not something you should envisage as a paradigm while using<br>rules. (There are mechanisms controlling the firing of rules, such as<br>salience or agenda groups, but I don't think that this is what you need<br>
in the posted scenario.)<br><br>-W<br><br><br><div class="gmail_quote">2009/3/25 yash kapoor <span dir="ltr"><<a href="mailto:yash.rocksolid@gmail.com">yash.rocksolid@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All,<div> How can I navigate among rules like call from rule 1 to rule 2</div><div><br></div><div>rule "Memory reader_{row.rowNumber}"<br></div><div><br></div><div><div>when</div><div> <span style="white-space: pre;">        </span>memory:BenchMarkRulesModel()</div>
<div><span style="white-space: pre;">        </span>then</div><div><span style="white-space: pre;">        </span> </div><div><span style="white-space: pre;">        </span> if(@{workload}==memory.getWorkload())</div>
<div><br></div><div> //something</div><div> </div><div> else </div><div><br></div><div> <span style="color: rgb(51, 51, 255);"> jump to rule Memory writer_{row.rowNumber}</span></div>
<div><br></div><div><br></div><div>end</div><div><br></div><div><br></div><div>rule "Memory writer_{row.rowNumber}"</div><div><br></div><div> when</div><div><br></div><div> then</div><div><br></div>
<div>end</div><div><br></div><div> </div></div>
<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></blockquote></div><br>