<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
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:
<blockquote
cite="mid:BANLkTikbRfuTK0WS7rce+ED=kxH_g6W6Ew@mail.gmail.com"
type="cite">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>
<div class="gmail_quote">2011/5/28 Edson Tirelli <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:ed.tirelli@gmail.com">ed.tirelli@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;">
<div><br>
</div>
Wolfgang,
<div><br>
</div>
<div> 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.</div>
<div><br>
</div>
<div> Edson
<div>
<div class="h5"><br>
<br>
<div class="gmail_quote">2011/5/28 Wolfgang Laun <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:wolfgang.laun@gmail.com"
target="_blank">wolfgang.laun@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left:
1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt
0.8ex; padding-left: 1ex;">
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>
<font color="#888888">
<br>
-W</font>
<div>
<div><br>
<br>
<br>
<div class="gmail_quote">On 28 May 2011 10:56,
Tomas Olsson <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:tol@sics.se" target="_blank">tol@sics.se</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204,
204); margin: 0pt 0pt 0pt 0.8ex;
padding-left: 1ex;">
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 moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org"
target="_blank">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote>
</div>
<br>
</div>
</div>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org"
target="_blank">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
</div>
</div>
-- <br>
Edson Tirelli<br>
JBoss Drools Core Development<br>
JBoss by Red Hat @ <a moz-do-not-send="true"
href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
</div>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
</blockquote>
</div>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>