<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">Hello.<br>
<br>
Thanks for this advice.<br>
<br>
I've tried it with a small test case, and it actually works fine :
the collecting rule seems to be fired at the end.<br>
<br>
Nonetheless, I'm not confident at all with salience, since in my
real use case I have many rules before and after that, and I worry
that salience might move the problem elsewhere, and values must be
set to all of them to ensure they're all executed according to the
expected order.<br>
<br>
At this moment, the rules before the collecting rule also produce
facts that are expected by the rules that follow it, and, I
suppose, it's for that reason that all the ending part of the job
is executed after the correct collection of the intermediary
results.<br>
<br>
Another alternative ?<br>
<br>
Thanks again.<br>
<br>
Regards<br>
<br>
<br>
<br>
<pre class="moz-signature" cols="72">Ephemeris Lappis</pre>
Le 21/04/2014 13:11, laune [via Drools] a écrit :<br>
</div>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em'
cite="mid:CANaj1LcS6d825P3nbEkvh691FpOy2y+WMCWSTYwiiS=UsBqghQ@mail.gmail.com"
type="cite"> This is one of the (rare) cases where I'd advocate
salience.
<br>
<br>
rule "Collect results when complete"
<br>
salience -999999
<br>
when
<br>
$all : List from collect(Result())
<br>
then
<br>
...do something with $all...
<br>
end
<br>
<br>
-W
<br>
<br>
<br>
On 21/04/2014, Ephemeris Lappis <<a moz-do-not-send="true"
href="/user/SendEmail.jtp?type=node&node=4029298&i=0"
target="_top" rel="nofollow" link="external">[hidden email]</a>>
wrote:
<div class="shrinkable-quote"><br>
> Hello.
<br>
>
<br>
> I'm looking for the better way to write a rule that
collects data only when
<br>
> they have been all processed.
<br>
>
<br>
> For example, two input objects classes as facts : *Data*
and *Category*.
<br>
>
<br>
> I declare a local type to memorize the result of the
evaluation for each
<br>
> pair of fact.
<br>
>
<br>
>
<br>
>
<br>
> Some rule evaluates the Cartesian product of all *Data* by
all *Category* :
<br>
>
<br>
>
<br>
>
<br>
> Now I want to collect all the results, but only when the
previous rule has
<br>
> been fired for all the data.
<br>
> Something like :
<br>
>
<br>
>
<br>
>
<br>
> Any advice ?
<br>
>
<br>
> Thanks in advance for your help.
<br>
>
<br>
> Regards.
<br>
>
<br>
>
<br>
>
<br>
> --
<br>
> View this message in context:
<br>
> <a moz-do-not-send="true"
href="http://drools.46999.n3.nabble.com/Collect-all-occurrences-of-resulting-data-tp4029296.html"
target="_top" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Collect-all-occurrences-of-resulting-data-tp4029296.html</a><br>
> Sent from the Drools: User forum mailing list archive at
Nabble.com.
<br>
> _______________________________________________
<br>
> rules-users mailing list
<br>
> <a moz-do-not-send="true"
href="/user/SendEmail.jtp?type=node&node=4029298&i=1"
target="_top" rel="nofollow" link="external">[hidden email]</a>
<br>
> <a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>
</div>
_______________________________________________
<br>
rules-users mailing list
<br>
<a moz-do-not-send="true"
href="/user/SendEmail.jtp?type=node&node=4029298&i=2"
target="_top" rel="nofollow" link="external">[hidden email]</a>
<br>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
<hr noshade="noshade" size="1" color="#cccccc">
<div style="color:#444; font: 12px
tahoma,geneva,helvetica,arial,sans-serif;">
<div style="font-weight:bold">If you reply to this email, your
message will be added to the discussion below:</div>
<a moz-do-not-send="true"
href="http://drools.46999.n3.nabble.com/Collect-all-occurrences-of-resulting-data-tp4029296p4029298.html" target="_top" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Collect-all-occurrences-of-resulting-data-tp4029296p4029298.html</a>
</div>
<div style="color:#666; font: 11px
tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
To unsubscribe from Collect all occurrences of resulting data.,
<a moz-do-not-send="true"
href="" target="_top" rel="nofollow" link="external">click
here</a>.<br>
<a moz-do-not-send="true"
href="http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_top" link="external">NAML</a> </div>
</blockquote>
<br>
        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://drools.46999.n3.nabble.com/Collect-all-occurrences-of-resulting-data-tp4029296p4029300.html">Re: [rules-users] Collect all occurrences of resulting data.</a><br/>
Sent from the <a href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html">Drools: User forum mailing list archive</a> at Nabble.com.<br/>