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

srinivasasanda srinivasasanda at gmail.com
Mon Jan 16 06:40:54 EST 2012


Thank you Manstis for quick response.I've a small doubt in this Manstis.

Actually My Main class PERSON source code is
	RuleAgent agent = RuleAgent.newRuleAgent("/Guvnor.properties");
		RuleBase rb = agent.getRuleBase();
FactType appType = rb.getFactType("details.Personn");
	Object application = appType.newInstance();
	appType.set(application, "age", 40);
		rb.newStatelessSession().execute(new Object[] {application});
WorkingMemory wm=rb.newStatefulSession();
wm.fireAllRules(); 
		
And my POJO class PersonDetails code is
package com.sample;

public class PersonDetails {
public int age=40;
public String name="drools";
public int getAge() {
	return age;
}
public void setAge(int age) {
	this.age = age;
}
public String getName() {
	return name;
}
public void setName(String name) {
	this.name = name;
}
}
 
Now my BRL in guvnor is(As per your instructions)
rule "brl1"
	    dialect "mvel"
3.	|	    when
4.	|	        PersonDetails( a : age > 0 )
5.	|	        Personn( age == a )
6.	|	    then
7.	|	        System.out.println("Welcome Drools");
8.	|	end


Even it is equal to 40,Im unable to see WELCOME drools message in guvnor
5.3.I uploaded PersonDetails POJO class in that package,it is uploaded and
I'm able to see that model in that package,But one error I'm always seeing
one message when I'm saving changes in uploaded model.."Unable to save,it
was recently updated by guest".Does this error affects my source code of
BRL..I didnt get what is the wrong in my BRL.

Could you please suggest me what the wrong thing i coded here..Please

Thanks

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



More information about the rules-users mailing list