Wolfgang, still no news as to the expected behaviour :(<br><br>Sotty, I appreciate you are probably busy with other activities, however any your thoughts on the following would be most welcome:-<br><ul><li>For POJOs is a field only added to the declared type if it has a getter and setter (something laune said he'd seen; email earlier in this thread)?</li>
<li>Are fact-level annotations inherited?</li><li>Are field-level annotations inherited?</li><li>Type erasure on subclasses, if type A declares "myVar : String" and type B extends A and declaring "myVar : Integer", what should happen?</li>
</ul>For others interested, here's some answers already received:<br><ul><li>Can declarative types extend Java POJOs and other declared types?<br></li></ul><div style="margin-left: 40px;"><sotty> yes</div><ul><li>
For
POJO's do I need to include an "empty" declaration? So "declare
java.util.ArrayList end" if I want to "declare MyList extends ArrayList"
in a java.util package? <br></li></ul><div style="margin-left: 40px;"><sotty> no, it should be enough to import
the fqn or use it in the "extends".<br><b><manstis> note this is different to what is documented in the Drools Expert user-guide<br></b><br></div>Thanks,<br><br>Mike<br><br><div class="gmail_quote">On 12 July 2011 13:12, Michael Anstis <span dir="ltr"><<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><a href="https://issues.jboss.org/browse/JBRULES-3133" target="_blank">https://issues.jboss.org/browse/JBRULES-3133</a> created.<div>
<div></div><div class="h5"><br><br><div class="gmail_quote">On 12 July 2011 13:08, Michael Anstis <span dir="ltr"><<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">There's also a quirk regarding the class resolution:-<br><br>Given Person class:-<br>
<br>
<span style="font-family: courier new,monospace;">package com.guvnor.domain;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">import java.math.BigDecimal;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">public class Person {</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> private BigDecimal salary;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> public BigDecimal getSalary() {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> return salary;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> public void setSalary(BigDecimal salary) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> this.salary = salary;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;">
<br><br>The following compiles OK:-<br><br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">package com.sample</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">import com.guvnor.domain.Person</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">declare Person</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end</span><br></div><br>However the following does not (without explicitly importing <span style="font-family: courier new,monospace;">java.math.BigDecimal</span> - which is a field type in Person):-<br>
<br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">package com.sample</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">import com.guvnor.domain.Person</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">import com.guvnor.domain.Address</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">declare Person</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace; color: rgb(255, 0, 0);">declare Person2 extends Person</span><br style="font-family: courier new,monospace; color: rgb(255, 0, 0);">
<span style="font-family: courier new,monospace; color: rgb(255, 0, 0);"> flange : String</span><br style="font-family: courier new,monospace; color: rgb(255, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(255, 0, 0);">end</span><br>
</div><br>Error being "Unknown DroolsError class org.drools.compiler.TypeDeclarationError: Unable to find class 'BigDecimal' ".<br><br>With kind regards,<br><br>Mike<div><div></div><div><br><br>
<div class="gmail_quote">On 11 July 2011 08:41, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Subsection 5.7.7 discusses 'extends' and describes how it is done for types declared in Java.<br>
<br>One finesse is apparently not documented: Java types must be proper JavaBeans; otherwise the construction of the accessors will fail. (Try, for instance, a property with a getter but no matching setter.) <br>
<br>HTH<br>-W<br><br><br><div class="gmail_quote"><div><div></div><div>On 10 July 2011 22:29, Michael Anstis <span dir="ltr"><<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>
What's the rules around declared types extending another (declared) type?<br><br>I've been asked to provide for declared type extension in Guvnor (by Prakash) but the Expert user-guide doesn't say it exists at the engine level.<br>
<br>I tried "declare MyType extends java.util.ArrayList" and received a parser\compiler error stating "java.util.ArrayList was not a declared type" (or words to that effect) so some form of extension appears possible.<br>
<br>Thanks,<br><br>Mike<br>
<br></div></div>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br>
<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>