Hello.

Thanks for this advice.

I've tried it with a small test case, and it actually works fine : the collecting rule seems to be fired at the end.

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.

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.

Another alternative ?

Thanks again.

Regards


 
Ephemeris Lappis
Le 21/04/2014 13:11, laune [via Drools] a écrit :
This is one of the (rare) cases where I'd advocate salience.

rule "Collect results when complete"
salience -999999
    when
                $all : List from collect(Result())
    then
            ...do something with $all...
end

-W


On 21/04/2014, Ephemeris Lappis <[hidden email]> wrote:

> Hello.
>
> I'm looking for the better way to write a rule that collects data only when
> they have been all processed.
>
> For example, two input objects classes as facts : *Data* and *Category*.
>
> I declare a local type to memorize the result of the evaluation for each
> pair of fact.
>
>
>
> Some rule evaluates the Cartesian product of all *Data* by all *Category* :
>
>
>
> Now I want to collect all the results, but only when the previous rule has
> been fired for all the data.
> Something like :
>
>
>
> Any advice ?
>
> Thanks in advance for your help.
>
> Regards.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Collect-all-occurrences-of-resulting-data-tp4029296.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/Collect-all-occurrences-of-resulting-data-tp4029296p4029298.html
To unsubscribe from Collect all occurrences of resulting data., click here.
NAML



View this message in context: Re: [rules-users] Collect all occurrences of resulting data.
Sent from the Drools: User forum mailing list archive at Nabble.com.