[rules-users] Calling POJO class get Method in BRL

Michael Anstis michael.anstis at gmail.com
Mon Jan 16 03:19:00 EST 2012


In your rule do the following:-

   - Add PersonDetails fact
   - Add Person fact
   - Add a constraint for PersonDetails.age (> 0 would be a good choice).
   - Bind age field to a variable (click on field name in the constraint
   and you're given the choice to set it to a variable)
   - Add a constraint for Person.age (set equal to a bound variable).

This is based upon 5.3.0.Final.

With kind regards,

Mike

On 16 January 2012 07:22, srinivasasanda <srinivasasanda at gmail.com> wrote:

> Hi,
>
> I've a BRL with Person as a fact containing field name age(in sample
> package).
>
> Now,I've a POJO class named PersonDetails with fields age,name with its
> getters,setters methods.Now I uploaded that POJO model in that sample
> package.
>
> Now,I need to check in When condition of brl whether age in Person fact is
> equal to the value obtained from getAge() method of PersonDetails POJO
> class.
>
> When I used guided editor it is giving as age is equal to 1.Literal
> Value,2.Expression editor,3.Formulae.
>
> How can i achieve that ??I should create new instance of PersonDetails p in
> When condition and i should call p.getAge() and that value must be compared
> to age in Person Fact.
> Can you please suggest me how to achieve this..
>
> Thanks
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Calling-POJO-class-get-Method-in-BRL-tp3662420p3662420.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120116/070c9292/attachment.html 


More information about the rules-users mailing list