[rules-users] eval

Edson Tirelli tirelli at post.com
Mon Oct 8 12:12:14 EDT 2007


   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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071008/c2ed17e7/attachment.html 


More information about the rules-users mailing list