<br><font size=2 face="sans-serif">Thanks - the example project is attached.</font>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">The output I'd like to get in the Console
window is:</font>
<br>
<br><font size=2 face="Courier New">Hello World</font>
<br><font size=2 face="Courier New">Thread launched</font>
<br><font size=2 face="Courier New">Inserting SimpleFact</font>
<br><font size=2 face="Courier New">Inserting SimpleFact</font>
<br><font size=2 face="Courier New">Updating SimpleFact</font>
<br><font size=2 face="Courier New">Updating SimpleFact</font><font size=2 face="sans-serif"><br>
</font><font size=2 face="Courier New">All set</font>
<br>
<br><font size=2 face="sans-serif">However, what I currently get is:</font>
<br>
<br><font size=2 face="Courier New">Hello World</font>
<br><font size=2 face="Courier New">Thread launched</font>
<br><font size=2 face="Courier New">Inserting SimpleFact</font>
<br><font size=2 face="Courier New">All set</font>
<br><font size=2 face="Courier New">Inserting SimpleFact</font>
<br><font size=2 face="Courier New">Updating SimpleFact</font>
<br><font size=2 face="Courier New">Updating SimpleFact</font>
<br>
<br><font size=2 face="sans-serif">Many thanks for taking the time to look
at this.</font>
<br>
<br><font size=2 face="sans-serif">Regards,</font>
<br>
<br><font size=2 face="sans-serif">Alan</font>
<p>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Mauricio Salatino &lt;salaboy@gmail.com&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: rules-users-bounces@lists.jboss.org</font>
<p><font size=1 face="sans-serif">15/04/2010 14:36</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
Rules Users List &lt;rules-users@lists.jboss.org&gt;</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Rules Users List &lt;rules-users@lists.jboss.org&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [rules-users] Drools Flow: Problem
with constraint in (Wait) &nbsp; &nbsp; &nbsp; &nbsp;State node</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=3>Hi Alan,<br>
Share with us the simple project, I can take a look on it and get back
with some suggestions.<br>
<br>
</font>
<br><font size=3>2010/4/15 &lt;</font><a href=mailto:Alan.Gairey@tessella.com><font size=3 color=blue><u>Alan.Gairey@tessella.com</u></font></a><font size=3>&gt;</font>
<br><font size=2 face="sans-serif"><br>
I have a simple rule flow of the form: Start -&gt; Work Item -&gt; Wait
State -&gt; Action -&gt; End.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
The handler for the work item launches a separate thread, and then completes.
This thread inserts a number of facts into the (stateful) session's working
memory; each fact ('SimpleFact') has a boolean property ('complete') that
is initially set false. Later on in the thread, the facts in memory are
updated by setting their 'complete' properties to true.</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
I want the Wait State to hold execution of the rule flow until ALL the
facts in memory have the 'complete' property set to true. My first attempt
at setting the constraint was as follows:</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
forall(SimpleFact(complete == true))</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
With this constraint, the Action node executes straight after the completion
of the Work Item. My next attempt for the constraint was:</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
exists(SimpleFact()) and forall(SimpleFact(complete == true))</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
With this constraint, the Action node executes as soon as the first instance
of SimpleFact is inserted into the working memory.</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
So my question is: how do I specify the Wait State node constraint so that
the rule flow only resumes once all the SimpleFact instances in working
memory have their 'complete' property set to true?</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
(I have a simple project to demonstrate the problem if required.)</font><font size=3><br>
</font><font size=2 face="sans-serif"><br>
Many thanks,</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Alan</font><font size=3><br>
_______________________________________________<br>
rules-users mailing list</font><font size=3 color=blue><u><br>
</u></font><a href="mailto:rules-users@lists.jboss.org"><font size=3 color=blue><u>rules-users@lists.jboss.org</u></font></a><font size=3 color=blue><u><br>
</u></font><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target=_blank><font size=3 color=blue><u>https://lists.jboss.org/mailman/listinfo/rules-users</u></font></a><font size=3><br>
</font>
<br><font size=3><br>
<br>
<br>
-- <br>
- </font><a href=http://salaboy.wordpress.com/><font size=3 color=blue><u>http://salaboy.wordpress.com</u></font></a><font size=3><br>
- </font><a href=http://www.jbug.com.ar/><font size=3 color=blue><u>http://www.jbug.com.ar</u></font></a><font size=3><br>
- Salatino &quot;Salaboy&quot; Mauricio -</font><tt><font size=2>_______________________________________________<br>
rules-users mailing list<br>
rules-users@lists.jboss.org<br>
https://lists.jboss.org/mailman/listinfo/rules-users<br>
</font></tt>
<br>