Sure thing. I would be happy to. Only thing is I can&#39;t promise how quickly I can get it out.<br><br>I have the latest trunk code, but can&#39;t find any docs on the rule verifier. Are there? Otherwise I&#39;ll read the code.<br>

<br>Right now I am reading the JAR contents and using Velocity templates to create new rules. These generated rules are placed into an agenda group to ensure that they fire first. The rule base is then specifically setup to suck these rules in.<br>

<br>I am assuming you are picturing something a little different Mark so that there aren&#39;t so many steps for the user. <br><br>Let me know what you think.<br><br>dave<br><br><div class="gmail_quote">On Tue, Dec 9, 2008 at 3:08 AM, Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>&gt;</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;">


  

<div bgcolor="#ffffff" text="#000000"><div>
David Sinclair wrote:
<blockquote type="cite">I actually have something similar. All of our classes are
JPA entities. So I get a hold of the JAR that contains all the class
definitions and generate traversal rules to spider out the object
model. I look for @Entity, @MapperSuperclass, @Emeddeable, etc. This
handles 1-1, 1-many, many-1, and many-many.<br>
  <br>
To asset 1 object and see it follow all the relationships is pretty
wild! The only problem is, you sometimes don&#39;t want to have all the
relationships followed, or else you could end up with half the DB in
memory. </blockquote></div>
The rule verification has code to tell you what classes and what fields
are used in rules. This can be used to help you determine when
relationships actually need to be added.<div><br>
<blockquote type="cite">To solve this, I have TraversalPolicy facts that define
when a relationship should be followed. There are default policies that
go to a depth of 3 in every direction. Then you can define rules in
Guvnor to allow for more fine grained traversal under certain
circumstances.<br>
</blockquote></div>
This sounds like some interesting code, if we could add it with the
above idea to minimise what is actually inserted. Fancy on working on
this for an optional module for drools for better JPA integration?<br><font color="#888888">
<br>
Mark<br>
</font><blockquote type="cite"><div><br>
dave<br>
  <br>
  <div class="gmail_quote">On Fri, Dec 5, 2008 at 11:09 PM, Mark
Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>&gt;</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;">I
thought of a simple, yet powerful idea, anyone want to give this ago?
It will be the start of making ontologies more sanily usable for java
developers.<br>
    <br>
Person<br>
&nbsp;@relation(name=&quot;OwnerPetRelation&quot;, verb=&quot;IsOwnerOf&quot;)<br>
&nbsp; Set&lt;Pet&gt; pets;<br>
    <br>
Pet<br>
&nbsp;@relation(name=&quot;OwnerPetRelation&quot;, verb=&quot;IsOwnedByf&quot;)<br>
&nbsp; Person owner;<br>
    <br>
    <br>
IsOwnerOf and IsOwnedBy do not live on the classpath. The engine
detects those annotations and generates them as internal classes. Or
actually it can be one class, where it&#39;s able to use the two keywords
to reference that class in either direction. When you insert your
Persons and Pets, the relations are automatically inserted too
(assuming there are rules that use them). This allows people to more
naturally explore the relational aspect of their data, without having
to create and insert the relations themselves. Once a Relation is being
maintained by the engine, any updates to the underlying collection will
result in relations being added and removed.<br>
    <br>
If we build in relation inferrence, to avoid the extra binding, it
would mean that by simply annotating their classes people can do the
following (Assuming Cat is a type of Pet):<br>
    <br>
When<br>
&nbsp; Person( location == London ) IsOwnerOf() Cat( color == &quot;Tabby&quot;)<br>
&nbsp; ....<br>
    <br>
The above will get all my london people and their tabby cats. The
simply placement of the IsOwnerOf() pattern, would be nice if () was
optioal, would constrain the Cat to those related to the Owner. i.e.
the short hand equivalent of:<br>
$p : Person( location == London ) IsOwnerOf( owner == $p, $c : Cat )
Cat( this == $c, color == &quot;Tabby&quot;)<br>
    <br>
I think that&#39;s powerful and provides for a hyrbid OO and Relational
modelling approaches, &nbsp;asthey can still use graph notation:<br>
person.pets[0].color == &quot;tabby&quot;<br>
    <br>
This also solves the question that people always ask, how do I insert
my collection. With that in place there would still be plenty more to
do, like constraints, but it would be a start to improving Drools&#39;
relationahip programming &quot;out of the box&quot; capabilities. So who&#39;s game?<br>
    <br>
Mark<br>
    <br>
    <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>
  </blockquote>
  </div>
  <br>
  </div><pre><hr size="4" width="90%"><div>
_______________________________________________
rules-dev mailing list
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
  </div></pre>
</blockquote>
<br>
</div>

<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>