[rules-users] Drools Flow: Problem with constraint in (Wait) State node

Mauricio Salatino salaboy at gmail.com
Thu Apr 15 09:23:50 EDT 2010


Hi Alan,
Share with us the simple project, I can take a look on it and get back with
some suggestions.


2010/4/15 <Alan.Gairey at tessella.com>

>
> I have a simple rule flow of the form: Start -> Work Item -> Wait State ->
> Action -> End.
>
> 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.
>
> 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:
>
> forall(SimpleFact(complete == true))
>
> With this constraint, the Action node executes straight after the
> completion of the Work Item. My next attempt for the constraint was:
>
> exists(SimpleFact()) and forall(SimpleFact(complete == true))
>
> With this constraint, the Action node executes as soon as the first
> instance of SimpleFact is inserted into the working memory.
>
> 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?
>
> (I have a simple project to demonstrate the problem if required.)
>
> Many thanks,
>
> Alan
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
- http://salaboy.wordpress.com
- http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100415/875095e6/attachment.html 


More information about the rules-users mailing list