I tried changing the name to anything but the same problem persists.

 

-Ade

 


From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: 15 April 2010 12:14
To: Rules Users List
Cc: Edson Tirelli
Subject: Re: [rules-users] Double Handling

 

It seems that Drools is confused by the usage of the class name "Decision"
(which is used in the core: java/org/drools/jpdl/core/node/Decision.java

I can reproduce a similar effect, simply by renaming a class in a working example
to "Decision".

-W

On Thu, Apr 15, 2010 at 12:49 PM, Ade Timi <adeyinka.timi@nathean.com> wrote:

I still haven't gotten any break through with my problem. The issue is my
LHS of the rule. I am using eclipse. For some reason when I refer to this
particular java class and its variables they can't be seen by the rule but
its setters and getters can be seen on the RHS of the rule. I get an error
saying:
BuildError: Unable to create Field Extractor for 'custPointer' of
'[ClassObjectType class=com.nathean.rules.Decision]' in rule 'Your First
Rule'

Anyone seen this before? It's basic drools but I just can't find a solution
to this. It works for my other classes, and I can't see whats been done
differently here! Help please! See code below:

DRL:
package com.nathean.rules
import com.nathean.rules.Decision
rule "Your First Rule"
       when
               $id : Decision(custPointer == 0)
       then
               $id.getCustPointer();
               System.out.println();

end

Java Class:
package com.nathean.rules;
public class Decision {
       private int custPointer;
       /**
        * @param customerPointer the customerPointer to set
        */
       public void setCustPointer(int custPointer) {
               this.custPointer = custPointer;
       }
       /**
        * @return the customerPointer
        */
       public int getCustPointer() {
               return custPointer;
       }
}

-Ade


-----Original Message-----
From: Wolfgang Laun [mailto:wolfgang.laun@gmail.com]
Sent: 14 April 2010 12:54
To: adeyinka.timi@nathean.com
Subject: Re: [rules-users] Double Handling

Any update on this? (My last guess - no update - seems to be the only
reasonable explanation, so I'm curious.)

-W



_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users