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