[rules-users] Ruleflow loop until condition

Kris Verlaenen Kris.Verlaenen at cs.kuleuven.be
Thu Apr 9 08:51:49 EDT 2009


Alessandro,

Not sure what the XOR constraint looks like exactly, but if you are
using a rule constraint and it is referencing the NumeroRound object in
working memory, are you notifying the engine when this number is changed
(as I didn't see any update statements in your rules).

To figure out what is going on exactly, I recommend adding an audit log
listener to your session (either to console or to file which can then be
visualized in eclipse as a tree).  This will give you a clear idea on
which nodes have been triggered and why.  For more information see the
docs here:
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-flow/html/ch10.html
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/ch05.html#d0e2988

Kris

Quoting Alessandro Terrinoni <aleterrinoni at hotmail.com>:

> 
> Hello
> 
> I created a ruleflow like this one:
> http://i41.tinypic.com/2efmctx.jpg
> 
> And this is the rule package (rules are demonstrative only and one
> per group, but later on more will be added in each group.
> 
> package package1
> 
> #list any import classes here.
> ...
> 
> 
> #declare any global variables here
> ...
> 
> 
> rule "start workflow"
>     salience 1000
>     when
>         eval (true)
>     then 
>         System.out.println("matchata regola start");
>         drools.getWorkingMemory().startProcess("rf_main");
> 
> end    
> 
> rule "Preferenza"
>     ruleflow-group "modParams"
>     when
>         nRound : NumeroRound( n : numeroRound)
>         pw : PreferenceWrapper(round == n ,pref : preference)
>         
>     then 
>         pw.setRound(n+1);
>         System.out.println("matchata regola pref");
>         System.out.println("preferenza: "+ pref.getName());
>         
> end
> 
> rule "query for results"
>     
>     ruleflow-group "queryResult"
>     when
>         #conditions
>         nRound : NumeroRound(n : numeroRound)
>     then 
>         #actions
>         System.out.println("matchata regola query");
> ...
> end
> 
> rule "fasulla"
>     
>     ruleflow-group "fasullo"
>     when
>         eval (true)
>     then 
>         #actions
>         System.out.println("sei fasullo1");
>         
> end
> 
> 
> 
> In the ruleflow, the join node is XOR type.
> Split node is XOR type and checks with the object NumeroRound and the
> variable numeroRound which is an int. If it is big enough it exits,
> else continue to "fasullo" group
> 
> the issue is that the matching goes through "modParams" group, then
> "queryResult" group, then "fasullo" group, but after that it freezes,
> instead of going angain in group "modParams". Note that it doesnt
> finish the execution, it waits something.
> 
> What is wrong with this ruleflow?
> 
> thanks in advance,
> Alessandro Terrinoni
> 
> _________________________________________________________________
> Chiama gratis dal tuo PC! Parla su Messenger
> http://clk.atdmt.com/GBL/go/140630369/direct/01/






More information about the rules-users mailing list