<br>&nbsp;&nbsp; Ronald,<br><br>&nbsp;&nbsp; Last week I wrote the docs for TypeDeclaration. So, you may try the docs first hand and provide me feedback! ;)<br><br><a href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/ch06.html#d0e3047">https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/ch06.html#d0e3047</a><br>
<br>&nbsp;&nbsp; The API was promoted from drools-core to drools-api after M5 was released, so you need trunk to use it.<br><br><a href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/">https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/</a><br>
<br>&nbsp;&nbsp; Regarding your questions, I believe this is probably the easiest way of doing it, but not the only one. Just to mention another way would be to generate a JAXB domain model from your database and upload it as a jar to Guvnor.<br>
<br>&nbsp;&nbsp; If you want to dive into Drools internals and see how the classes are generated, take a look at org.drools.factmodel.ClassDefinition in drools-core as your starting point. From there you can navigate through the code searching for the references. IMO though, you don&#39;t need to go down this route.<br>
<br>&nbsp;&nbsp; Regarding the pipeline, if you want to customize it for your needs, you just need to create an intermediate step or use smooks to map from one model into the other. I think mark did not added a step to map from an external model into a type declared model yet. Contributions welcome.<br>
<br>&nbsp;&nbsp; Hope this helps,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><br><br><div class="gmail_quote">2009/2/6 Ronald Brindl <span dir="ltr">&lt;<a href="mailto:rbrindl@thegoldensource.com">rbrindl@thegoldensource.com</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;">
Referring to threads<br>
<a href="http://thread.gmane.org/gmane.comp.java.drools.devel/2860" target="_blank">http://thread.gmane.org/gmane.comp.java.drools.devel/2860</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp;Dynamic Facts: how to get jar wih Facts declared in drl<br>
<a href="http://thread.gmane.org/gmane.comp.java.drools.devel/2595" target="_blank">http://thread.gmane.org/gmane.comp.java.drools.devel/2595</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp;TypeDeclaration plugin heirarchy<br>
<br>
I am just in the process of evaluating the possibilities of using Drools.<br>
<br>
Our use case is the following:<br>
We have a dynamic metamodel, which gets generated from database during<br>
application initialisation phase. &nbsp;Then a runtime model gets instantiated,<br>
which is fed from incoming messages (files, jms, etc.)<br>
Both models are highly generic, basically maps of maps (lists of lists, for<br>
model instances)<br>
<br>
Now, i would like to publish the metamodel to Guvnor as fact model, so that<br>
business rules users can use it there and define<br>
<br>
In the last 2 days i dived into the sources, read the mailing list entries<br>
above, documentation and so on, but i still don&#39;t have a clear vision on<br>
how to accomplish that.<br>
<br>
Our first approach was to use TypeDeclaration, i.e. to dynamically create<br>
DRL that defines the fact types as defined in our metamodel, but i don&#39;t<br>
have a clue on how to assert data for those types, since i don&#39;t have the<br>
resulting java classes available in Java.<br>
(There was also some confusion: in the documentation (M5) it says, bytecode<br>
is generated for declaratively defined Facts, but i could not find anything<br>
in the code, where this byte code is generated)<br>
<br>
Our next approach was to generate interfaces as Fact types and create<br>
proxies to access the data. This would also allow us to implement another<br>
use case, that demands access to messages already stored in the database<br>
with the same id as the incoming messages, and compare what fields are new<br>
and to provide merging of new and old data.<br>
<br>
I also had a quick look at the new Pipeline concept, but as far as i<br>
understand that, it builds on a statically defined FactModel.<br>
<br>
Then i dived a little bit more into the code and saw code generation for<br>
accessing Java class facts, which also might be a reasonable solution for<br>
us.<br>
<br>
However, what i was asking myself was, if there is some entry point for<br>
functionality like that, some existing API.<br>
<br>
Thank you,<br>
ron.<br>
<br>
<br>
--<br>
Ronald Brindl<br>
Sr. Software Developer<br>
Member of Architecture Team<br>
The Goldensource Corporation<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">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>
</blockquote></div><br><br clear="all"><br>-- <br> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>