The RHS of rules contain semantic code based on the dialect you are
using. In your example, java. So, just cast it:

( (TypeA) p ).methodFromTypeA();

   []s
   Edson


2009/4/8 Alessandro Terrinoni <aleterrin...@hotmail.com>

>  Hello
>
> in my working memory I insert an object like this
>
> public class Foo{
>
> private IntType prop;
>
> ...
>
> }
>
> where IntType is a class, but in practice *prop* is either of type TypeA
> or TypeB, both extending the IntType class.
>
>
> then i have a rule like this:
>
> rule "abc"
>
>     when
>
>         Foo(p : prop, p.name == "propertyA")
>
>     then
>         // call some method defined only in the TypeA class
>
> end
>
>
> how do i explicitly cast p into a TypeA object to call the method defined
> only in that class?
>
> thanks in advance,
> Alessandro Terrinoni
> ------------------------------
> Scegli fra piĆ¹ di 30 stazioni! Ascolta la radio su 
> Messenger<http://clk.atdmt.com/GBL/go/140630364/direct/01/>
>
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to