[rules-users] Using a global list in a rule

Mauricio Salatino salaboy at gmail.com
Mon Jan 11 07:49:58 EST 2010


eval will execute a java or mvel expression and it will return the result.
In common situations rules evaluate facts and not globals.

On Mon, Jan 11, 2010 at 10:20 AM, orchid <maya.pollack at gmail.com> wrote:

>
> Thank you. It worked. Should I always use 'eval' to get a method result?
>
>
>
>
> salaboy wrote:
> >
> > did you try with:
> > eval(list.contains("rule1")) ?
> >
> >
> > On Sun, Jan 10, 2010 at 6:37 AM, orchid <maya.pollack at gmail.com> wrote:
> >
> >>
> >> Hi All,
> >>
> >> I have a question regarding using a global list. I have the following
> >> rule:
> >>
> >> global java.util.List list List;
> >>
> >> Rule "rule1"
> >>  when
> >>   A
> >>  then
> >>   list.add("rule1");
> >>
> >> When I'm trying to check the list content in LHS of another rule I get a
> >> compilation error: "mismatch input ...":
> >>
> >> Rule "rule2"
> >>  when
> >>   list.contains("rule1") /*or: list contains "rule1"*/
> >>  then
> >>   ...
> >> How do I check the list content from LHS?
> >>
> >> Thanks you in advance.
> >> Any help would be appreciated :-)
> >> --
> >> View this message in context:
> >> http://n3.nabble.com/Using-a-global-list-in-a-rule-tp115746p115746.html
> >> Sent from the Drools - User mailing list archive at Nabble.com.
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
> >
> >
> > --
> > - http://salaboy.wordpress.com
> > - http://www.jbug.com.ar
> > - Salatino "Salaboy" Mauricio -
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> --
> View this message in context:
> http://n3.nabble.com/Using-a-global-list-in-a-rule-tp115746p116700.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
- http://salaboy.wordpress.com
- http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100111/ba0965b8/attachment.html 


More information about the rules-users mailing list