Hi Davide,I am trying to group by Hild. Here first i will get the hlld into id and segregate the results by hild and sum the value t1If you take an sqlselect sum(t1),hlid from product group by hildso i will getif the data ishlid t11 101 102 102 10the result would behiid t11 202 20Hope you understand what i am trying to do here
Regards,Raja
Regards,Raja
On 3 March 2014 17:05, Davide Sottara <dsotty@gmail.com> wrote:
Raja,
it is not clear what you are trying to achieve.
The rule might be well written or not, we don't know your requirements.
If "id" is what it should be - an identifier - your accumulate constraint
would match a single object for each Product (the original product itself),
which looks suspicious.
I'll assume that you are doing a performance test and you are not satisfied
with the overall execution time.
The question, however, is: how many facts are you inserting? Are you firing
all rules after the insertion of each fact, or just once at the end?
Last, but not least, which version are you using?
Accumulate should be used carefully in combination with insertLogical,
since the former updates its result every time its fact collection changes.
The latter will generate a new fact, keep track of its dependencies,
and replace it when the accumulation result itself changes.
Of course, if you were inserting 100 facts, the numbers would raise
a warning, but could be reasonable for several thousands, if not
hundred thousands. Citing one of your previous emails:
"I want to test my rules with 10,000 facts to 20,000,000 facts"
Best
Davide
On 03/03/2014 12:10 PM, Raja Sekhar wrote:
Hi,I am using the following rulepackage com.demo;import com.sample.model.Product;import com.sample.model.Products;import java.util.List;import java.util.Set;dialect "mvel"
rule "Product_0"no-loopwhenProduct(id: hlId) accumulate (e :Product(hlId == id), $sum1 : sum(e.t1) )theninsertLogical("hid=" + id +",T1=" + $sum1);end
I am inserting facts (Product objects) into it and firing the rules.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.
Regards,Raja Sekhar--
Raja Sekhar Amirapu
------------------------------------------------------"If any anyone can do it, i can do it. If no one else can do it, i must do it"
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Raja Sekhar Amirapu
------------------------------------------------------"If any anyone can do it, i can do it. If no one else can do it, i must do it"
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users