<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Raja,<br>
      it is not clear what you are trying to achieve.<br>
      <br>
      The rule might be well written or not, we don't know your
      requirements.<br>
      If "id" is what it should be - an identifier - your accumulate
      constraint<br>
      would match a single object for each Product (the original product
      itself),<br>
      which looks suspicious.<br>
      <br>
      I'll assume that you are doing a performance test and you are not
      satisfied<br>
      with the overall execution time.<br>
      The question, however, is: how many facts are you inserting? Are
      you firing<br>
      all rules after the insertion of each fact, or just once at the
      end?<br>
      Last, but not least, which version are you using?<br>
      <br>
      Accumulate should be used carefully in combination with
      insertLogical,<br>
      since the former updates its result every time its fact collection
      changes.<br>
      The latter will generate a new fact, keep track of its
      dependencies,<br>
      and replace it when the accumulation result itself changes.<br>
      <br>
      Of course, if you were inserting 100 facts, the numbers would
      raise<br>
      a warning, but could be reasonable for several thousands, if not<br>
      hundred thousands. Citing one of your previous emails:<br>
      "I want to test my rules with 10,000 facts to 20,000,000 facts"<br>
      <br>
      Best<br>
      Davide<br>
      <br>
      <br>
      On 03/03/2014 12:10 PM, Raja Sekhar wrote:<br>
    </div>
    <blockquote
cite="mid:CAJhvg682-wrZn-ydHL2+5bWHCtfvBwvRitNjuUC_En9yxdWL3g@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi,
        <div>I am using the following rule</div>
        <div>
          <div>package com.demo;</div>
          <div>import com.sample.model.Product;</div>
          <div>import com.sample.model.Products;</div>
          <div>import java.util.List;</div>
          <div>import java.util.Set;</div>
          <div>dialect "mvel"</div>
          <div><br>
          </div>
          <div>rule "Product_0"</div>
          <div>no-loop</div>
          <div>when</div>
          <div><span class="" style="white-space:pre"> </span>Product(id:
            hlId) <span class="" style="white-space:pre"> </span>accumulate
            (e :Product(hlId == id), <span class=""
              style="white-space:pre"> </span>$sum1 : sum(e.t1) )&nbsp;</div>
          <div>then</div>
          <div>&nbsp;insertLogical("hid=" + id +",T1=" + $sum1);</div>
          <div>end</div>
          <div><br>
          </div>
          <div>I am inserting facts (Product objects) into it and firing
            the rules.</div>
          <div>When i took performance stats from visual vm with JMX.
            got a time of 3832ms. I can you suggest if i am doing any
            thing wrong with this.</div>
          <div><br>
          </div>
          <div>Regards,</div>
          <div>Raja Sekhar&nbsp;</div>
          <div><br>
          </div>
          -- <br>
          <div dir="ltr">Raja Sekhar Amirapu<br>
            ------------------------------------------------------
            <div>"If any anyone can do it, i can do it. If no one else
              can do it, i must do it"<br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>