[rules-users] Re: eval() not working as expected

Edson Tirelli tirelli at post.com
Tue Sep 25 17:46:53 EDT 2007


   Yes, but what is the preview of your DSL rule in DRL form? There is a tab
in the bottom of the code editor in the IDE...


2007/9/25, Brian Enderle <brianke at gmail.com>:
>
> >    Best way to know is preview your DRL rule in IDE and check what is
> wrong
> (or paste it here).   []s   Edson
>
>
> Here is the working rule:
>
> rule "LevelTwo: MEPS Processing cannot be blank if Projection exists"
>         agenda-group "LevelTwo"
>         when
> >               $i : MepsProcessing(eval(mepsProjTypCd != null) && eval
> (mepsProjTypCd != ' '), eval(StringUtils.isBlank(mepsId)))
>         then
> >               System.out.println("Meps Id cannot be blank");
> end
>
> When I replace the two conditions with a DSL entry, the rule works with
> the
> DSL conditions individually as in:
>
>                 There is a MepsProcessing
>                         - mepsProjTypCd is not a blank Character
>
> or
>
>                 There is a MepsProcessing
>                         - mepsId is a blank String
>
>
> But as soon as I put the two conditions together I get the error.
>
> rule "LevelTwo: MEPS Processing cannot be blank if Projection exists"
>         agenda-group "LevelTwo"
>         when
>                 There is a MepsProcessing
>                         - mepsProjTypCd is not a blank Character
>                         - mepsId is a blank String
>         then
> >               System.out.println("Meps Id cannot be blank");
> end
>
> Error:
> Caused by: org.drools.rule.InvalidRulePackage: Rule Compilation error :
> [Rule
> name=LevelTwo: MEPS Processing cannot be blank if Projection exists,
> agendaGroup=LevelTwo, salience=0, no-loop=false]
>
>         mil/army/usaac/ariss/dca/bp/Rule_LevelTwo__MEPS_Processing_cannot_be_bl
> ank_if_Projection_exists_0.java (33:1686) : Syntax error on token ",", .
> expected
>
>         mil/army/usaac/ariss/dca/bp/Rule_LevelTwo__MEPS_Processing_cannot_be_bl
> ank_if_Projection_exists_0.java (33:1713) : mepsId cannot be resolved
>
>
> Any ideas,
> Brian Enderle
>
>
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
>
>
>
> _______________________________________________
> 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/20070925/fa46faa9/attachment.html 


More information about the rules-users mailing list