I was following almost literally the example given in the &quot;Drools Introduction&quot;, Section 2.1.1.4., Type Declaration &#39;extends&#39;.<br><br>It appears that Drools is very similar to <a href="http://en.wikipedia.org/wiki/Eleusis_%28card_game%29">Eleusis</a> ;-)<br>
<br>-W<br><br>2011/5/29 Mark Proctor &lt;<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt;<br>&gt;<br>&gt; This is what&#39;s in the unit test &quot;test_ExtLegacy.drl&quot;:<br>&gt; declare BetterLegacy extends LegacyBean<br>
&gt;     // novel field<br>&gt;     oneMoreField  : String = &quot;Hello&quot;<br>&gt;<br>&gt;     // inherited fields redeclared to set initial value<br>&gt;     doubleField  : Double    = 3.3                @position(1)  // tag inherited field, will be 1st field<br>
&gt;     strField : String = &quot;XX&quot;<br>&gt;     intField : int = 245<br>&gt;     prop : boolean = true<br>&gt;     // objField is not redeclared<br>&gt; end<br>&gt;<br>&gt; and this one &quot;test_Extends.drl&quot;<br>
&gt; declare Person<br>&gt;     age  : int     = 99          @position(2)<br>&gt;     name : String  = &quot;john doe&quot;  @key    @position(1)<br>&gt; end<br>&gt;<br>&gt; declare Student extends Person<br>&gt;     school : String @key   @position(3)<br>
&gt; end<br>&gt;<br>&gt;<br>&gt; declare LongTermStudent extends Student<br>&gt;     years : int @key @position(5)<br>&gt;     course : String @position(4)<br>&gt; end<br>&gt;<br>&gt;<br>&gt; On 28/05/2011 18:22, Wolfgang Laun wrote:<br>
&gt;<br>&gt; It doesn&#39;t work:<br>&gt;<br>&gt;    declare Customer extends Person<br>&gt;<br>&gt; is declined with<br>&gt;<br>&gt;    Cannot extend supertype &#39;date.cust.Person&#39; (not a declared type)<br>&gt;<br>
&gt; -W<br>&gt;<br>&gt; 2011/5/28 Edson Tirelli &lt;<a href="mailto:ed.tirelli@gmail.com">ed.tirelli@gmail.com</a>&gt;<br>&gt;&gt;<br>&gt;&gt;    Wolfgang,<br>&gt;&gt;    I think Davide&#39;s implementation supports extending existing java classes... did you tried? What is not possible is to implement interfaces, since you can&#39;t define methods in the declare statement.<br>
&gt;&gt;    Edson<br>&gt;&gt;<br>&gt;&gt; 2011/5/28 Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; There is, since 5.2.0, the option of extending a class declared in DRL:<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt; declare A<br>&gt;&gt;&gt;    i : int<br>&gt;&gt;&gt; end<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; declare B extends A<br>&gt;&gt;&gt;   ...<br>&gt;&gt;&gt; end<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Any class origninating from Java code cannot be extended  in DRL.<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt; -W<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On 28 May 2011 10:56, Tomas Olsson &lt;<a href="mailto:tol@sics.se">tol@sics.se</a>&gt; wrote:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt; I have tried to look this up but cannot find any clear answer on the web.<br>&gt;&gt;&gt;&gt; Does drools support extension of existing classes for new type declarations?<br>&gt;&gt;&gt;&gt; That would be very nice if this would be possible.<br>
&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; /Tomas<br>&gt;&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt;&gt; rules-users mailing list<br>&gt;&gt;&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; rules-users mailing list<br>&gt;&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; --<br>&gt;&gt;   Edson Tirelli<br>&gt;&gt;   JBoss Drools Core Development<br>&gt;&gt;   JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; rules-users mailing list<br>&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; rules-users mailing list<br>&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; rules-users mailing list<br>&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br><br>