I have used agenda-group for simple processing step sequences, and<br>it was quite sufficient. You can switch groups from the Java<br>application (between fireAllRules()) or even from a consequence.<br><br>In any case, I think of salience as a &quot;small-grained&quot; sequencing<br>
technique, akin to the &quot;goto considered harmful&quot; if used for<br>overall flow control.<br><br>-W<br><br><br><div class="gmail_quote">On 29 December 2010 15:13, AleBu <span dir="ltr">&lt;<a href="mailto:aleboo@gmail.com">aleboo@gmail.com</a>&gt;</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;"><br>
Hi all,<br>
I have some complex rule execution scenario which consists of several steps<br>
where different groups of rules must be executed. These steps are: &#39;Init<br>
Data&#39;, &#39;Validate Integrity&#39;, &#39;Stop Execution if any integrity errors found&#39;<br>
and &#39;Validate Business Logic&#39;. Originally I implemented it by assigning<br>
specific salience to specify an order of rules, like &#39;Init Data&#39; rules has<br>
biggest salience, and &#39;Validate Business Logic&#39; rules has the smallest.<br>
I am wondering, is designing separate rule flow (very simple) is a valid<br>
approach and wouldyoy recomend it? It should look like:<br>
&#39;Start&#39; -&gt; &#39;Init Data&#39; -&gt; &#39;Validate Integrity&#39; -&gt; &#39;Stop Execution if any<br>
integrity errors found&#39; -&gt; &#39;Validate Business Logic&#39; -&gt; &#39;End&#39;.<br>
Also, I tried to do it by specifing &#39;ruleflow-group&#39; for each rule and<br>
creating rule-flow, but got an error &#39;Unknown process ID&#39; while executing.<br>
The code was very simple - 1st I added rule-flow file as resource to<br>
KnowledgeBuilders DRF resource with:<br>
                Resource flowFileRes = ResourceFactory.newFileResource( flowFile );<br>
                knowledgeBuilder.add( flowFileRes, ResourceType.DRF );<br>
knowledgeBuilder.hasErrors() is false at this point, so I assume that<br>
process was added sucessfully.<br>
Then I am executed:<br>
session.startProcess( MAIN_FLOW_ID );<br>
session.fireAllRules();<br>
MAIN_FLOW_ID constist of package defined in rule-flow file and rule-flow-ID<br>
from the same file (&lt;package&gt;.&lt;flow-ID&gt;).<br>
But fireAllRules() claims that no such process can be found (Unknown process<br>
ID).<br>
Documentation is very weak and it is the only information I found about<br>
executing processes, so perhaps I miss something, but mailing list seems<br>
like the only place to find more info.<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Ordering-rules-execution-ruleflow-group-or-salience-tp2162935p2162935.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Ordering-rules-execution-ruleflow-group-or-salience-tp2162935p2162935.html</a><br>

Sent from the Drools - User mailing list archive at Nabble.com.<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>
</font></blockquote></div><br>