<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> no-loop true<br> ruleflow-group "queryResult"<br> when<br> #conditions<br> nRound : NumeroRound(n : numeroRound)<br> then <br> #actions<br> risultati.addAll(queryManager.getEnititesFromRequest(request));<br> nRound.setNumeroRound(n+1);<br> 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>> Date: Thu, 9 Apr 2009 14:51:49 +0200<br>> From: Kris.Verlaenen@cs.kuleuven.be<br>> To: rules-users@lists.jboss.org<br>> Subject: Re: [rules-users] Ruleflow loop until condition<br>> <br>> Alessandro,<br>> <br>> Not sure what the XOR constraint looks like exactly, but if you are<br>> using a rule constraint and it is referencing the NumeroRound object in<br>> working memory, are you notifying the engine when this number is changed<br>> (as I didn't see any update statements in your rules).<br>> <br>> To figure out what is going on exactly, I recommend adding an audit log<br>> listener to your session (either to console or to file which can then be<br>> visualized in eclipse as a tree). This will give you a clear idea on<br>> which nodes have been triggered and why. For more information see the<br>> docs here:<br>> https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-flow/html/ch10.html<br>> https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/ch05.html#d0e2988<br>> <br>> Kris<br>> <br>> Quoting Alessandro Terrinoni <aleterrinoni@hotmail.com>:<br>> <br>> > <br>> > Hello<br>> > <br>> > I created a ruleflow like this one:<br>> > http://i41.tinypic.com/2efmctx.jpg<br>> > <br>> > And this is the rule package (rules are demonstrative only and one<br>> > per group, but later on more will be added in each group.<br>> > <br>> > package package1<br>> > <br>> > #list any import classes here.<br>> > ...<br>> > <br>> > <br>> > #declare any global variables here<br>> > ...<br>> > <br>> > <br>> > rule "start workflow"<br>> > salience 1000<br>> > when<br>> > eval (true)<br>> > then <br>> > System.out.println("matchata regola start");<br>> > drools.getWorkingMemory().startProcess("rf_main");<br>> > <br>> > end <br>> > <br>> > rule "Preferenza"<br>> > ruleflow-group "modParams"<br>> > when<br>> > nRound : NumeroRound( n : numeroRound)<br>> > pw : PreferenceWrapper(round == n ,pref : preference)<br>> > <br>> > then <br>> > pw.setRound(n+1);<br>> > System.out.println("matchata regola pref");<br>> > System.out.println("preferenza: "+ pref.getName());<br>> > <br>> > end<br>> > <br>> > rule "query for results"<br>> > <br>> > ruleflow-group "queryResult"<br>> > when<br>> > #conditions<br>> > nRound : NumeroRound(n : numeroRound)<br>> > then <br>> > #actions<br>> > System.out.println("matchata regola query");<br>> > ...<br>> > end<br>> > <br>> > rule "fasulla"<br>> > <br>> > ruleflow-group "fasullo"<br>> > when<br>> > eval (true)<br>> > then <br>> > #actions<br>> > System.out.println("sei fasullo1");<br>> > <br>> > end<br>> > <br>> > <br>> > <br>> > In the ruleflow, the join node is XOR type.<br>> > Split node is XOR type and checks with the object NumeroRound and the<br>> > variable numeroRound which is an int. If it is big enough it exits,<br>> > else continue to "fasullo" group<br>> > <br>> > the issue is that the matching goes through "modParams" group, then<br>> > "queryResult" group, then "fasullo" group, but after that it freezes,<br>> > instead of going angain in group "modParams". Note that it doesnt<br>> > finish the execution, it waits something.<br>> > <br>> > What is wrong with this ruleflow?<br>> > <br>> > thanks in advance,<br>> > Alessandro Terrinoni<br>> > <br>> > _________________________________________________________________<br>> > Chiama gratis dal tuo PC! Parla su Messenger<br>> > http://clk.atdmt.com/GBL/go/140630369/direct/01/<br>> <br>> <br>> <br>> _______________________________________________<br>> rules-users mailing list<br>> rules-users@lists.jboss.org<br>> 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>