<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>


<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.hmmessage P
{margin:0px;padding:0px;}
body.hmmessage
{font-size:10pt;font-family:Verdana;} </style>Kris,<br><br>thanks for the answer, i found that the problem were some missing updates.<br><br>But now there's another issue:<br>In a node of the flow should take place an action also on NumeroRound, everytime just once, incrementing its field by one.<br><br>The problem is: with the attribute "no-loop true", the flow freezes in that flow-group, even if the update statement is present.<br>Obviously, without the attribute "no-loop true" it goes loop on the rule.<br><br><br>rule "query for results"<br>&nbsp;&nbsp;&nbsp; no-loop true<br>&nbsp;&nbsp;&nbsp; ruleflow-group "queryResult"<br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #conditions<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nRound : NumeroRound(n : numeroRound)<br>&nbsp;&nbsp;&nbsp; then <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #actions<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; risultati.addAll(queryManager.getEnititesFromRequest(request));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nRound.setNumeroRound(n+1);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; update( nRound );<br>end<br><br><br>The split and the join works fine now, as the modParams group evaluates twice. The problem seems to be in the queryResult node that contains only the rule above. I will try to add the audit logger to provide more informations.<br><br><br>Maybe, since the node queryResult have to take everytime one and only one action, i could replace the node with an Action node. But if i do, i dont think i could be be able to modify the field in the NumeroRound fact, could I? (note i need it as a fact as i use it also in some LHS of other rules..)<br><br><br><br>&gt; Date: Thu, 9 Apr 2009 14:51:49 +0200<br>&gt; From: Kris.Verlaenen@cs.kuleuven.be<br>&gt; To: rules-users@lists.jboss.org<br>&gt; Subject: Re: [rules-users] Ruleflow loop until condition<br>&gt; <br>&gt; Alessandro,<br>&gt; <br>&gt; Not sure what the XOR constraint looks like exactly, but if you are<br>&gt; using a rule constraint and it is referencing the NumeroRound object in<br>&gt; working memory, are you notifying the engine when this number is changed<br>&gt; (as I didn't see any update statements in your rules).<br>&gt; <br>&gt; To figure out what is going on exactly, I recommend adding an audit log<br>&gt; listener to your session (either to console or to file which can then be<br>&gt; visualized in eclipse as a tree).  This will give you a clear idea on<br>&gt; which nodes have been triggered and why.  For more information see the<br>&gt; docs here:<br>&gt; https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-flow/html/ch10.html<br>&gt; https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/ch05.html#d0e2988<br>&gt; <br>&gt; Kris<br>&gt; <br>&gt; Quoting Alessandro Terrinoni &lt;aleterrinoni@hotmail.com&gt;:<br>&gt; <br>&gt; &gt; <br>&gt; &gt; Hello<br>&gt; &gt; <br>&gt; &gt; I created a ruleflow like this one:<br>&gt; &gt; http://i41.tinypic.com/2efmctx.jpg<br>&gt; &gt; <br>&gt; &gt; And this is the rule package (rules are demonstrative only and one<br>&gt; &gt; per group, but later on more will be added in each group.<br>&gt; &gt; <br>&gt; &gt; package package1<br>&gt; &gt; <br>&gt; &gt; #list any import classes here.<br>&gt; &gt; ...<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; #declare any global variables here<br>&gt; &gt; ...<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; rule "start workflow"<br>&gt; &gt;     salience 1000<br>&gt; &gt;     when<br>&gt; &gt;         eval (true)<br>&gt; &gt;     then <br>&gt; &gt;         System.out.println("matchata regola start");<br>&gt; &gt;         drools.getWorkingMemory().startProcess("rf_main");<br>&gt; &gt; <br>&gt; &gt; end    <br>&gt; &gt; <br>&gt; &gt; rule "Preferenza"<br>&gt; &gt;     ruleflow-group "modParams"<br>&gt; &gt;     when<br>&gt; &gt;         nRound : NumeroRound( n : numeroRound)<br>&gt; &gt;         pw : PreferenceWrapper(round == n ,pref : preference)<br>&gt; &gt;         <br>&gt; &gt;     then <br>&gt; &gt;         pw.setRound(n+1);<br>&gt; &gt;         System.out.println("matchata regola pref");<br>&gt; &gt;         System.out.println("preferenza: "+ pref.getName());<br>&gt; &gt;         <br>&gt; &gt; end<br>&gt; &gt; <br>&gt; &gt; rule "query for results"<br>&gt; &gt;     <br>&gt; &gt;     ruleflow-group "queryResult"<br>&gt; &gt;     when<br>&gt; &gt;         #conditions<br>&gt; &gt;         nRound : NumeroRound(n : numeroRound)<br>&gt; &gt;     then <br>&gt; &gt;         #actions<br>&gt; &gt;         System.out.println("matchata regola query");<br>&gt; &gt; ...<br>&gt; &gt; end<br>&gt; &gt; <br>&gt; &gt; rule "fasulla"<br>&gt; &gt;     <br>&gt; &gt;     ruleflow-group "fasullo"<br>&gt; &gt;     when<br>&gt; &gt;         eval (true)<br>&gt; &gt;     then <br>&gt; &gt;         #actions<br>&gt; &gt;         System.out.println("sei fasullo1");<br>&gt; &gt;         <br>&gt; &gt; end<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; In the ruleflow, the join node is XOR type.<br>&gt; &gt; Split node is XOR type and checks with the object NumeroRound and the<br>&gt; &gt; variable numeroRound which is an int. If it is big enough it exits,<br>&gt; &gt; else continue to "fasullo" group<br>&gt; &gt; <br>&gt; &gt; the issue is that the matching goes through "modParams" group, then<br>&gt; &gt; "queryResult" group, then "fasullo" group, but after that it freezes,<br>&gt; &gt; instead of going angain in group "modParams". Note that it doesnt<br>&gt; &gt; finish the execution, it waits something.<br>&gt; &gt; <br>&gt; &gt; What is wrong with this ruleflow?<br>&gt; &gt; <br>&gt; &gt; thanks in advance,<br>&gt; &gt; Alessandro Terrinoni<br>&gt; &gt; <br>&gt; &gt; _________________________________________________________________<br>&gt; &gt; Chiama gratis dal tuo PC! Parla su Messenger<br>&gt; &gt; http://clk.atdmt.com/GBL/go/140630369/direct/01/<br>&gt; <br>&gt; <br>&gt; <br>&gt; _______________________________________________<br>&gt; rules-users mailing list<br>&gt; rules-users@lists.jboss.org<br>&gt; https://lists.jboss.org/mailman/listinfo/rules-users<br><br /><hr />25 GB di spazio gratuito su Internet! <a href='http://clk.atdmt.com/GBL/go/140630366/direct/01/' target='_new'>Prova SkyDrive</a></body>
</html>