If you insert POJOs as facts in Jess, you&#39;ll have to write a <br>   (deftemplace X (declare (from-class X)))<br>and the fields available for pattern matching in rules rely on the JavaBeans convention.<br><br>I have (quite successfully) used POJOs resulting from unmarshalling an XML document (via JAXB) as facts, both in Drools and in Jess; most certainly without writing any &quot;copycat&quot; fact classes and tedious transformations.<br>
<br>As for globals: They play the same role in Drools as in Jess; in neither system are they part of the working memory.<br><br>I don&#39;t know what you could mean by a &quot;standard fact class&quot;.<br><br>As for iterating over all fact objects in Drools&#39; WM, Drools provides getObjects() in WorkingMemory; or you could set up a query and run this.<br>
<br>-W<br><br><br><div class="gmail_quote">On 10 September 2010 14:54, Donald Winston <span dir="ltr">&lt;<a href="mailto:satchwinston@yahoo.com">satchwinston@yahoo.com</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&#39;m reviewing JBoss Rules (Drools) for an application I&#39;m starting to build. It appears that the only way to assert facts is to use the insert(Object) method where the object is a bean using the proper naming conventions for it&#39;s properties. There also appears to be a way to use arbitrary objects using globals but do these end up in the fact base? It&#39;s disturbing to me that I have to create a bunch of classes whose sole purpose in life is to support the rule base. This is similar to using java server pages and having to create a bunch of classes just to support each page. That&#39;s why I don&#39;t use java server pages and use xsl transformations instead. I want to use my xml jdom document to represent my data and not have to create a bunch of beans. I can&#39;t seem to find anything in the api where I can assert facts without creating my own custom classes. There&#39;s no standard Fact class?<br>

<br>
I&#39;ve been also experimenting with Jess and it provides an easy way for me to do this. I just iterate through my jdom document and create Fact objects and assert them. I can then execute the rules and then iterate through the updated fact base using engine.listFacts() and update my jdom document. It couldn&#39;t be easier or more natural. Is there an analogous way to do this in Drools?<br>

<br>
<br>
Thank you very much.<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>