The rule seems ok. Of course you need to insert a PersonDetails object in your working memory if you want the rule to get activated. Please read Drools documentation to see rules' life-cycle: http://docs.jboss.org/drools/release/5.4.0.Beta1/drools-expert-docs/html_single/index.html

Best Regards,

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Mon, Jan 16, 2012 at 1:34 PM, srinivasasanda <srinivasasanda@gmail.com> wrote:
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.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users