<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16544" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>Massi,</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Why do you want to use a ruleflow?&nbsp; 
</FONT><FONT face=Arial size=2>If you simply remove the ruleflow-group 
statements from your rule definitions, you will get your expected behaviour, as 
rule_ab will execute first, updating your user fact, which will then trigger 
rule_ba to execute, updating the user fact again, which will trigger rule_ba 
again, etc.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'm not sure where you see any parallelism here, as 
it is always the first rule, then the second, then the first one again, 
etc.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>But if you really want to know, you can create a 
loop in a ruleflow by putting whatever you would like to see repeated in between 
an XOR-join in front and an XOR-split at the end, and linking one of the 
outgoing connections of the XOR-split&nbsp;back to the first join 
:)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Kris</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=mmquelo@gmail.com href="mailto:mmquelo@gmail.com">mmquelo massi</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=rules-users@lists.jboss.org 
  href="mailto:rules-users@lists.jboss.org">Rules Users List</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, November 22, 2007 5:15 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [rules-users] How to make a 
  "Loop-Ruleflow"????</DIV>
  <DIV><BR></DIV>
  <DIV></DIV>
  <DIV>Hi everybody. </DIV>
  <DIV>&nbsp;</DIV>
  <DIV></DIV>
  <DIV>I am trying to make a ruleflow that, once processed, causes the rule 
  engine to infinitely loop. </DIV>
  <DIV>I have got a <EM>User</EM> Object in my object model. It has got a 
  <EM>getLogin()</EM> and <EM>setLogin(</EM>) methods. </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>The login field stands for the "User name", so it is a String. </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>First I insert an Object in the WM, with login==A.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV></DIV>
  <DIV>Then I generate the following rule-flow-groups: </DIV>
  <DIV>&nbsp;</DIV>
  <DIV><EM>rule "rule_ab" </EM></DIV>
  <DIV><EM>&nbsp;&nbsp; ruleflow-group "ab" </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp; when </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; u:User( login == "A" ) 
  </EM></DIV>
  <DIV><EM>&nbsp;&nbsp; then </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; u.setLogin("B"); </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("a - &gt; b"); 
  </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp;&nbsp; update(u); </EM></DIV>
  <DIV><EM>end </EM></DIV>
  <DIV><EM></EM>&nbsp;</DIV>
  <DIV><EM>rule "rule_ba" </EM></DIV>
  <DIV><EM>&nbsp;&nbsp; ruleflow-group "ba" </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp;&nbsp; when </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; u:User( login == "B" ) 
  </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp;&nbsp; then </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; u.setLogin("A"); 
  </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("b - 
  &gt; a"); </EM></DIV>
  <DIV><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; update(u); </EM></DIV>
  <DIV><EM>end </EM></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I'd like to define a ruleflow that gives me in output something like 
  this:</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>
  <DIV>a - &gt; b</DIV>
  <DIV>b - &gt; a</DIV>
  <DIV>a - &gt; b</DIV>
  <DIV>b - &gt; a 
  <DIV>a - &gt; b</DIV>
  <DIV>b - &gt; a</DIV>
  <DIV>a - &gt; b</DIV>
  <DIV>b - &gt; a 
  <DIV>a - &gt; b</DIV>
  <DIV>b - &gt; a</DIV>
  <DIV>a - &gt; b</DIV>
  <DIV>b - &gt; a</DIV>
  <DIV>.... looping...</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>How can I do it?</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>In other words I want those rules to be executed in parallel and I want 
  to define</DIV>
  <DIV>this "parallelism" using the ruleflow graph, Is It Possible???</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Thank You Again!</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Massi.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>P.S.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Ah.... I solved that matter with the 
  rule.package...</DIV></DIV></DIV></DIV>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>rules-users mailing 
  list<BR>rules-users@lists.jboss.org<BR>https://lists.jboss.org/mailman/listinfo/rules-users<BR></BLOCKQUOTE></BODY></HTML>