[rules-users] Validation in Guvnor fails due to unrecognized method of implemented interface

Edson Tirelli tirelli at post.com
Thu Jun 25 10:59:59 EDT 2009


   Hi Brody,

   What versions of Drools and MVEL you are using?

   []s
   Edson

2009/6/25 Brody bach <brodybach at yahoo.com>

>
> Hi,
>
> I have a class which implementes several interfaces
>
> class MyClass implements interA, interB, interC {
>      private String nameA;
>      private String nameB;
>      private String ownString;
>
>      public String getNameA(){ ---impl of method from interface interA
>           return nameA;
>      }
>
>      public String getNameB(){  ---- impl method from interface interB
>           return nameB;
>      }
>
>      public String getOwnString{  ---- own method
>           return ownString;
>      }
> }
>
> Another class, MyBiggerClass has MyClass as its attribute:
>
> class MyBiggerClass {
>  private MyClass myClass;
>
>  public MyClass getMyClass(){
>       return myClass;
>  }
> }
>
> In a rule, I use MyBiggerClass as follows:
> $mybig : MyBiggerClass()
> eval($mybig.getMyClass().getNameB().equals("HelloWorld"))
>
> The evaluation fails, and it said
> unable to resolve method using strict-mode: interA.getNameB()
>
> As you can see, the validator checks as if the getNameB was a method of
> interA (the first interface).
> I'm wondering whether this is a bug, or do I have to somehow change the
> structure of my class.
> But the question is, why does it check the interfaces not the class itself?
>
> Thanks for advices
>
> Regard
> bb
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Validation-in-Guvnor-fails-due-to-unrecognized-method-of-implemented-interface-tp24203665p24203665.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090625/dc7c4e7c/attachment.html 


More information about the rules-users mailing list