[rules-users] fireAllRules() doesn't return back

2011-08-28 Thread Neel
Hi,I'm using drools-5.3.0.Beta1. I've following rule definition:

import java.util.*;


declare Student
   name : String @key
   subjectGradeMap : HashMap   
end
 
rule Subject grade points
dialect mvel
when
   $u : Student()
then
   $u.subjectGradeMap[CompSc] += 100;
   System.out.println(Marks added);
end
While executing RHS of above rule, fireAllRules() doesn't return, it 
hangs.Please help.Thanks,Neel
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] fireAllRules() doesn't return back

2011-08-28 Thread Esteban Aliverti
It hangs? Or the rule get executed once and again?
I don't see anything wrong with your rule. Are you sure you are not doing
any update() od modify() inside your rule?
Can you share with us how are you creating and interacting with the
knowledge base?

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


2011/8/28 Neel neelesh...@yahoo.co.in

 Hi,
 I'm using drools-5.3.0.Beta1. I've following rule definition:


 import java.util.*;


 declare Student

name : String @key

subjectGradeMap : HashMap

 end



 rule Subject grade points

 dialect mvel

 when

$u : Student()

 then

$u.subjectGradeMap[CompSc] += 100;

System.out.println(Marks added);

 end


 While executing RHS of above rule, fireAllRules() doesn't return, it hangs.

 Please help.

 Thanks,

 Neel



 ___
 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


Re: [rules-users] fireAllRules() doesn't return back

2011-08-28 Thread Wolfgang Laun
You are adding 100 to a non-existing Map entry. Doing this in Java code like
e.g.

   HashMapString,Integer m = $u.getSubjectGradeMap();
   m.put( CompSc, m.get( CompSc ) + 100 );

would have thrown a NullPointerException, and you would have seen the
problem.

MVEL, with its balmy-barmy way of hiding the realities of programming from
you, sinks you in an infinite loop...

Verified with current master, and I won't create a JIRA for this one either,
as moticated previously.

-W


2011/8/28 Neel neelesh...@yahoo.co.in

 Hi,
 I'm using drools-5.3.0.Beta1. I've following rule definition:


 import java.util.*;


 declare Student

name : String @key

subjectGradeMap : HashMap

 end



 rule Subject grade points

 dialect mvel

 when

$u : Student()

 then

$u.subjectGradeMap[CompSc] += 100;

System.out.println(Marks added);

 end


 While executing RHS of above rule, fireAllRules() doesn't return, it hangs.

 Please help.

 Thanks,

 Neel



 ___
 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