<!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 bgcolor="#ffffff" text="#000000">
I believe I have it... "declare" is meant to be used for easy
generation of java classes, so that rules can instantiate objects and
use them as such.&nbsp; For dynamic data models, "template" is a better fit,
as getField etc are geared towards map-like data structures.<br>
<br>
I believe that I could have :<br>
<br>
template "Address"<br>
&nbsp; String line1<br>
&nbsp; String line2<br>
end<br>
<br>
template "Person"<br>
&nbsp; String name<br>
&nbsp; int age<br>
&nbsp; Object address<br>
end<br>
<br>
rule "Test"<br>
&nbsp;&nbsp;&nbsp; when<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; add: Address(line1 == "address")<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; person: Person(address == add)<br>
&nbsp;&nbsp;&nbsp; then <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ...<br>
<br>
Is this correct?<br>
<br>
Cheers <br>
<br>
Stephen Kestle wrote:
<blockquote cite="mid:48B4D837.2050403@orionhealth.com" type="cite">I'm
creating a type hierarchy using TypeDeclarations based on an
ontological model (analagous to an xml schema for the purposes of this
post).
  <br>
  <br>
If I declare a drl file to have the following declarations
  <br>
  <br>
declare Address
  <br>
&nbsp; line1 : String
  <br>
&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>
it will create Java Pojo classes for me.&nbsp; However, I had it all working
using fact templates, except for the address item.&nbsp; Is it possible to
insert fact implementations based on templates, while declaring
TypeDeclarations in the drl?&nbsp; (I now go to look for how to specify the
format = TEMPLATE for the drl)
  <br>
  <br>
I say this because I'm looking up values using id strings - e.g. the
exact same way that FactTemplate based Facts does accessing.&nbsp; I don't
want to have to convert all my String ids to reflectively call the set
methods on the created Pojo.
  <br>
  <br>
Hopefully this is enough info for you 5.0 developers - I'm still trying
to wrap my head around it all.
  <br>
  <br>
Cheers
  <br>
  <br>
Stephen
  <br>
_______________________________________________
  <br>
rules-users mailing list
  <br>
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
  <br>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  <br>
  <br>
______________________________________________________________________
  <br>
This email has been scanned by the MessageLabs Email Security System.
  <br>
For more information please visit <a class="moz-txt-link-freetext" href="http://www.messagelabs.com/email">http://www.messagelabs.com/email</a>
______________________________________________________________________
  <br>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<title>Orion Signature</title>
<meta http-equiv="Content-Type" content="text/html; ">
<style media="screen" type="text/css">
A {        COLOR: #007186; TEXT-DECORATION: none;}
A:hover { COLOR: #EF7224; TEXT-DECORATION: underline}
</style>
<hr color="#007186" noshade="noshade">
<table align="center" border="0" cellpadding="3" cellspacing="0">
  <tbody>
    <tr>
      <td>
      <div align="right"><font color="#007186"
 face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><a
 href="http://www.orionhealth.com" target="_blank"><img
 src="cid:part1.07040603.03080604@orionhealth.com" border="0"
 height="50" width="150"></a></b></font></div>
      </td>
      <td bgcolor="#ef7224" width="1"><br>
      </td>
      <td>
      <p><font face="Verdana, Arial, Helvetica, sans-serif"><b><font
 color="#ef7224" size="2">Stephen Kestle</font> <font color="#007186"
 size="2">Software Engineer</font></b><font color="#007186" size="2"><br>
      <a href="mailto:stephen.kestle@orionhealth.com">stephen.kestle@orionhealth.com</a><br>
P: +64 9 638 0619<br>
M: +64 27 453 7853 <br>
F: +64 9 638 0699<br>
S: <a href="callto:skestle">skestle</a><br>
      <a href="http://www.orionhealth.com" target="_blank">www.orionhealth.com</a></font>
      </font></p>
      </td>
    </tr>
  </tbody>
</table>
<br>
<div align="center"><font color="#cccccc"
 face="Verdana, Arial, Helvetica, sans-serif" size="1">This e-mail and
any attachments are intended only for the person to whom it is
addressed and may contain privileged, proprietary, or other data
protected from disclosure under applicable law. If you are not the
addressee or the person responsible for delivering this to the
addressee you are hereby notified that reading, copying or distributing
this transmission is prohibited. If you have received this e-mail in
error, please telephone us immediately and remove all copies of it from
your system. Thank you for your co-operation.</font></div>
</div>
</body>
</html>