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

srinivasasanda srinivasasanda at gmail.com
Mon Jan 16 07:34:56 EST 2012


Hi Manstis,

Where do you insert a PersonDetails fact?

Why do you set the age on Person when you state it'll be in PersonDetails?

You'll also need to have a relationship between Person and PersonDetails and
include this in your rule.

Manstis,Let me explain my requirement precisely.age is the field in my POJO
class which is set to 40.In the same way,I set the value of age which is in
Person fact to 40 in my main executable class.

Now,I need to compare age in POJO class(which is 40(hardcoded))and age in
Person fact(which is set to 40 in the main Java class
-appType.set(application, "age", 40);)

When these two ages are equal,I should print welcome drools.As both are
40,the output must be Welcome Drools.

Here is my BRL code.
when
4. |        PersonDetails( a : age > 0 )
5. |        Personn( age == a )
6. |    then
7. |        System.out.println("Welcome Drools");
8. | end 

Should i need to insert Model PersonDetails in the source code?I followed ur
instructions to create BRL.Please help me in achieving my requirement

--
View this message in context: http://drools.46999.n3.nabble.com/Calling-POJO-class-get-Method-in-BRL-tp3662420p3663046.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list