[rules-users] Double Handling

Ansgar Konermann ansgar.konermann at googlemail.com
Mon Apr 12 14:47:57 EDT 2010


Ade Timi wrote:
>
> Thanks guys for your responses. This should be as simple as it gets,
> which adds to my frustration. See the following code below:
>
> *Java classes:*
>
> *Individual* –
>
>             *public* *class* Individual {
>
> *private double assetCost;*
>
> * *
>
> *public* *void* setAssetCost(*double* assetCost) {
>
>             *this*.assetCost = assetCost;
>
>             }
>
>  
>
>             *public* *double* getAssetCost() {
>
>                   *return* assetCost;
>
> }
>
> }
>
> *IndividualDecision* –
>
>             *public* *class* IndividualDecision {
>
> *private double loanToValue;*
>
> * *
>
> *public* *void* setLoanToValue(*double* LoanToValue) {
>
>                   *this*.loanToValue = LoanToValue;
>
>             }
>
>             *public* *double* getLoanToValue() {
>
>                   *return* loanToValue;
>
>       }
>
>             *public* *void* calcValues(Individual ind){
>
>             *this*.loanToValue = ind.getAssetCost();
>
>       }
>
> }
>
>  
>
> *Rule Resourse – *
>
> *            **import* com...Individual
>
> *import* com...IndividualDecision
>
>  
>
> *rule* "G2 Equity in Asset"
>
>       *when*
>
>             $d : IndividualDecision(loanToValue() < 85.0)
>
>       *then*
>
>             System.out.println("loanToValue: " + ($d.getLoanToValue()));
>
> *End*
>
Hi,

you might want to try to replace "loanToValue()" with "loanToValue" and
report whether it works. I'm not sure whether the () are actually in
your rules code or a copy/paste error, but if they are, it'll be worth a
try.

This would at least somehow match the error message you reported. When
using the java dialect, you can simply use property names inside the
constraints sections. No need to add parentheses.

Kind regards

Ansgar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100412/2cbd95c9/attachment.html 


More information about the rules-users mailing list