[rules-users] Ordering rules execution: ruleflow-group or salience?

Wolfgang Laun wolfgang.laun at gmail.com
Wed Dec 29 10:32:42 EST 2010


I have used agenda-group for simple processing step sequences, and
it was quite sufficient. You can switch groups from the Java
application (between fireAllRules()) or even from a consequence.

In any case, I think of salience as a "small-grained" sequencing
technique, akin to the "goto considered harmful" if used for
overall flow control.

-W


On 29 December 2010 15:13, AleBu <aleboo at gmail.com> wrote:

>
> Hi all,
> I have some complex rule execution scenario which consists of several steps
> where different groups of rules must be executed. These steps are: 'Init
> Data', 'Validate Integrity', 'Stop Execution if any integrity errors found'
> and 'Validate Business Logic'. Originally I implemented it by assigning
> specific salience to specify an order of rules, like 'Init Data' rules has
> biggest salience, and 'Validate Business Logic' rules has the smallest.
> I am wondering, is designing separate rule flow (very simple) is a valid
> approach and wouldyoy recomend it? It should look like:
> 'Start' -> 'Init Data' -> 'Validate Integrity' -> 'Stop Execution if any
> integrity errors found' -> 'Validate Business Logic' -> 'End'.
> Also, I tried to do it by specifing 'ruleflow-group' for each rule and
> creating rule-flow, but got an error 'Unknown process ID' while executing.
> The code was very simple - 1st I added rule-flow file as resource to
> KnowledgeBuilders DRF resource with:
>                Resource flowFileRes = ResourceFactory.newFileResource(
> flowFile );
>                knowledgeBuilder.add( flowFileRes, ResourceType.DRF );
> knowledgeBuilder.hasErrors() is false at this point, so I assume that
> process was added sucessfully.
> Then I am executed:
> session.startProcess( MAIN_FLOW_ID );
> session.fireAllRules();
> MAIN_FLOW_ID constist of package defined in rule-flow file and rule-flow-ID
> from the same file (<package>.<flow-ID>).
> But fireAllRules() claims that no such process can be found (Unknown
> process
> ID).
> Documentation is very weak and it is the only information I found about
> executing processes, so perhaps I miss something, but mailing list seems
> like the only place to find more info.
>
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Ordering-rules-execution-ruleflow-group-or-salience-tp2162935p2162935.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101229/8f8f303e/attachment.html 


More information about the rules-users mailing list