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

Wolfgang Laun wolfgang.laun at gmail.com
Sun Aug 28 12:01:45 EDT 2011


You are adding 100 to a non-existing Map entry. Doing this in Java code like
e.g.

   HashMap<String,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 <neeleshdev at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110828/ed2e6d4f/attachment.html 


More information about the rules-users mailing list