<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>
      &nbsp;<br>
      <pre class="moz-signature" cols="72">Ephemeris Lappis</pre>
      Le 21/04/2014 13:11, laune [via Drools] a &eacute;crit&nbsp;:<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>
      &nbsp; &nbsp; when
      <br>
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $all : List from collect(Result())
      <br>
      &nbsp; &nbsp; then
      <br>
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...do something with $all...
      <br>
      end
      <br>
      <br>
      -W
      <br>
      <br>
      <br>
      On 21/04/2014, Ephemeris Lappis &lt;<a moz-do-not-send="true"
        href="/user/SendEmail.jtp?type=node&amp;node=4029298&amp;i=0"
        target="_top" rel="nofollow" link="external">[hidden email]</a>&gt;
      wrote:
      <div class="shrinkable-quote"><br>
        &gt; Hello.
        <br>
        &gt;
        <br>
        &gt; I'm looking for the better way to write a rule that
        collects data only when
        <br>
        &gt; they have been all processed.
        <br>
        &gt;
        <br>
        &gt; For example, two input objects classes as facts : *Data*
        and *Category*.
        <br>
        &gt;
        <br>
        &gt; I declare a local type to memorize the result of the
        evaluation for each
        <br>
        &gt; pair of fact.
        <br>
        &gt;
        <br>
        &gt;
        <br>
        &gt;
        <br>
        &gt; Some rule evaluates the Cartesian product of all *Data* by
        all *Category* :
        <br>
        &gt;
        <br>
        &gt;
        <br>
        &gt;
        <br>
        &gt; Now I want to collect all the results, but only when the
        previous rule has
        <br>
        &gt; been fired for all the data.
        <br>
        &gt; Something like :
        <br>
        &gt;
        <br>
        &gt;
        <br>
        &gt;
        <br>
        &gt; Any advice ?
        <br>
        &gt;
        <br>
        &gt; Thanks in advance for your help.
        <br>
        &gt;
        <br>
        &gt; Regards.
        <br>
        &gt;
        <br>
        &gt;
        <br>
        &gt;
        <br>
        &gt; --
        <br>
        &gt; View this message in context:
        <br>
        &gt; <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>
        &gt; Sent from the Drools: User forum mailing list archive at
        Nabble.com.
        <br>
        &gt; _______________________________________________
        <br>
        &gt; rules-users mailing list
        <br>
        &gt; <a moz-do-not-send="true"
          href="/user/SendEmail.jtp?type=node&amp;node=4029298&amp;i=1"
          target="_top" rel="nofollow" link="external">[hidden email]</a>
        <br>
        &gt; <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>
        &gt;
      </div>
      _______________________________________________
      <br>
      rules-users mailing list
      <br>
      <a moz-do-not-send="true"
        href="/user/SendEmail.jtp?type=node&amp;node=4029298&amp;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&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;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/>