[rules-users] eval

Markus Helbig mhelbig81 at googlemail.com
Tue Oct 9 03:41:30 EDT 2007


you're right, but this was just an example for possible functions. In
reality i don't use equal methods here ...

Thanks

Markus


2007/10/8, Edson Tirelli <tirelli at post.com>:
>
>    This is a bug in the DSL engine. May I ask you please to submit a JIRA
> for it?
>
>    Meanwhile, I advise you to avoid eval, since it is more performant and
> more clear to use regular constraints. The following grammar entries are
> equivalent to yours, but much more performant:
>
> [when]- Title equals "{value}"=title == "{value}"
> [when]- Event equals "{value}"=id == "{value}"
>
>     []s
>     Edson
>
> 2007/10/8, Markus Helbig < mhelbig81 at googlemail.com>:
> >
> > Hi,
> > given the following DSL
> >
> >
> > [when]of type Item=Item()
> > [when]- Title equals "{value}"=eval(title.isEqual("{value}")
> > [when]- Event equals "{value}"=eval(id.isEqual("{value}")
> > [then]Log : "{message}"= System.out.println("{message}");
> >
> >
> >
> > the dslr File:
> >
> > expander Test.dsl
> >
> > rule "Your First Rule"
> >       when
> >              $p : of type Item
> >                 - Title equals "test"
> >                 - Event equals "test"
> >       then
> >             #actions
> > end
> >
> > resolves to (could be seen in the drl viewer)
> >
> > rule "Your First Rule"
> >
> >         when
> >                 $p :Item( eval( title.isEqual("test",
> eval(id.isEqual("test") ) )
> >         then
> >                 #actions
> >
> > end
> >
> >
> > so this of course does not work because of the brackets in "eval"
> >
> > How could i solve this problem? I need the two different eval
> > conditions, and sometimes they have to be combined.
> >
> > Thanks
> >
> > Markus
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
>
>
> --
>   Edson Tirelli
>   Software Engineer - JBoss Rules Core Developer
>   Office: +55 11 3529-6000
>   Mobile: +55 11 9287-5646
>   JBoss, a division of Red Hat @ www.jboss.com
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>



More information about the rules-users mailing list