<div dir="ltr"><br>&nbsp;&nbsp; In other words, in 5.0 you can do:<br><br>declare Address<br>&nbsp;&nbsp; line1 : String<br>&nbsp;&nbsp; line2 : String<br>end<br><br>declare Person<br>&nbsp; name : String<br>&nbsp; age : int<br>&nbsp; address : Address<br>end<br><br>
&nbsp;&nbsp; There are additional notation and features you are able to use when working with type declarations, but the above is what you asked for.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><br><div class="gmail_quote">2008/8/11 Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">FactTemplates are an experimental feature and only supports primitives and strings as fields. It was based around using arrays for the models, this made the implementation easy but tooling and integration with other libraries being very hard. For 5.0 we using &quot;type declarations&quot; which basically are generated pojos, which causes a nightmare for custom classloader stuff, but is much more tooling and 3rd party library integration friendly. These type declarations support primitives and classes for their fields.<br>
<font color="#888888">
<br>
Mark</font><div><div></div><div class="Wj3C7c"><br>
Stephen Kestle wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m trying to make some fact templates in the form of<br>
<br>
template &quot;Address&quot;<br>
 &nbsp; String line1<br>
 &nbsp; String line2<br>
end<br>
<br>
template &quot;Person&quot;<br>
 &nbsp; String name<br>
 &nbsp; int age<br>
 &nbsp; Address address<br>
end<br>
<br>
It complains that it is &quot;Unable to resolve class &quot;Address&quot;&quot;<br>
<br>
 &nbsp;1. Is there any way around this - am I just getting syntax wrong?<br>
 &nbsp;2. Is this being fixed in 5.0 or &gt; 4.0.7 (which I have)<br>
 &nbsp;3. Am I able to modify the class loader to grab the FactTemplate<br>
 &nbsp; &nbsp; class types and infer the correct object? e.g. is this something<br>
 &nbsp; &nbsp; that&#39;s ridiculously hard, and so hasn&#39;t already been included?<br>
 &nbsp;4. Am I going about this entirely the wrong way?<br>
 &nbsp; &nbsp; &nbsp; &nbsp;1. Are nested types at all useful in the rules?<br>
 &nbsp; &nbsp; &nbsp; &nbsp;2. Is it possible to even have a rule like:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p: Person( age == 5, Address(line1 == &quot;My address))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ? (given a java object schema)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;3. Should I be using variables and other rules to assert facts?<br>
 &nbsp; &nbsp; &nbsp; &nbsp;4. Off topic: Is rules composition achieved by the assertion of<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; facts for other rules to use?<br>
<br>
What I want to do:<br>
I am dealing with (xml) schemas and ontologies, and need to be able to create Fact Templates from these definitions. &nbsp;While I can do this easily enough in java side, I believe I need to create the templates to match my java objects so that the rules can be compiled.<br>

<br>
Thanks heaps<br>
<br>
Stephen<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
</blockquote>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>