[rules-users] Minor Issue in writing DSL

Edson Tirelli tirelli at post.com
Tue Aug 21 09:49:03 EDT 2007


   Drools respects encapsulation, so it works with javabean method name
conventions. If you have a method isApplication() that returns a boolean,
does not matter how your class calculates the return value. Same for any
other method. In 4.0, you can write:

ObjectA( application == true || banker == true )

   To map that as a DSL, just follow your usual procedure and syntax.

   []s
   Edson

2007/8/21, Saleem Lakhani <Saleem.Lakhani at citizensfla.com>:
>
>  Hi,
>
>
>
> If I had a rule written in DSL using Drools 3.0 like;
>
>
>
>    1. [when] when1=r : ObjectA( )
>    2. [when] when2=eval(r.isApplication() || r.isBanker())
>
>
>
> There are no attributes in class Object with name application and banker
> but there are methods in ObjectA with names isApplication() & isBanker()
> which does some work and return Boolean based on some facts.
>
>
>
> What is the correct way of writing the same rule using Drools 4.0 ?
>
>
>
> Also, if the above attributes were present in ObjectA what would have been
> the best way to write it in DSL using Drools 4.0
>
>
>
> Thanks,
>
>
>
>
>
> _______________________________________________
> 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/20070821/108e4651/attachment.html 


More information about the rules-users mailing list