[rules-users] How to Access Rule RHS (THEN Part) from JAVA?

Ravikiran ravikiran.kakarla at gmail.com
Fri Jul 13 06:03:54 EDT 2012


Hi Laune,

As i mentioned before, I have given some sample code only before. But i
actually meant that "percent" is an instance variable of type double from
class "LoanFormula", sorry for creating the confusion. Both Person & Loan
formula classes are like this,
declare Person
  age: Integer
  -------
end
declare LoanFormula
  percent: Double
end
If the above two classes are part of my Model and if my Rule 1 like below

rule "Rule 1"
    salience 10
    dialect "mvel"
    when
	a : LoanFormula( )
	exists (Person( age > "25" )) 
    then
	a.setPercent(2.5 );
end

>From the above Rule, When i fire "Rule 1" from my Java client and i pass age
of a Person greater than 25, then i should be able to retrieve the percent
value as 2.5. I hope this would have been much clearer for you now. 
Thanks in advance...

--
View this message in context: http://drools.46999.n3.nabble.com/How-to-Access-Rule-RHS-THEN-Part-from-JAVA-tp4018651p4018657.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list