[rules-users] [rule-users]RunTime polypmorphic support in 3.0.6?

Edson Tirelli tirelli at post.com
Sun May 20 10:48:23 EDT 2007


   Hi,

   Sorry, I did not understood your question, but I guess you are asking
about facts matching ObjectTypeNodes of super classes. The answer is yes, it
works:

public class A {}
public class B extends A {}
public class C extends A {}

   If you have a rule saying

rule XXX
when
   A ()
then
  // do something
end

   The rule will fire for all facts of class A, B and C, as B and C are
subclasses of A. It is like if you did an "instanceof" to know what rules
will fire and what will not.

   Hope that is what you were asking.

   []s
   Edson


2007/5/20, Sikkandar Nawabjan <Sikkandar.Nawabjan at ustri.com>:
>
> Hi,
> I have a query. am using Drools 3.0.6.
> i have a ObjectA and ObjectB and ObjectC.
> ObjectB and OBjectC inherits Object A.
> am using seperate drl file for objectA, objectB and objectC.
> i need to use the DRL pertain to ObjectA when validate ObjectB and
> ObjectC.
> So when i check the object say ObjectB which i asserted in working memory,
> can i assume that ObjectA also available implitcitly?
> The rules associated with ObjectA will fire when I assert just OBjectB?
> Please clarify
> Thanks and Regs,
> Basha
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070520/2feae5af/attachment.html 


More information about the rules-users mailing list