[rules-users] Re: query on "modify"

Prem Kumar L Prem.Kumar at Sun.COM
Wed Jun 25 00:19:56 EDT 2008


Thanks Alex. Your suggestion worked.
Prem
Alexander Claus wrote:
>> package com.sample
>>
>> import org.domain.CreditCard;
>>
>> rule "Credit Eligibility"
>>    no-loop true
>>    when
>>        cc : CreditCard( age > 18, annualIncome > 50000, asset> 500000  )
>>    then
>>        cc.setEligibilityStatus( "Eligible for credit card" );
>>        System.out.println("Valid Credit Score ");
>>        modify( cc );
>> end
>>
>> I was successfully  able to run the rule against my CreditCard object.
>> However, when I tried running it from withing my applicaiton by 
>> embedding drools(latest, the following error occurs:
>>
>> org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule 
>> name=Credit Eligibility, agendaGroup=MAIN, salience=0, no-loop=true]
>>    com/sample/Rule_Credit_Eligibility_0.java (13:652) : The method 
>> modify(CreditCard) is undefined for the type Rule_Credit_Eligibility_0
>
> Obviously your "modify(cc);" is considered as a method...
> Try change this line to "modify(cc) {}" or better, put the 
> modification of the cc (setElig...) inside the curly brackets: 
> "modify(cc) { setElig... };
>
> Alexander
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users




More information about the rules-users mailing list