<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><font class="Apple-style-span" face="arial" size="2">I am using the knowledge session to get the objects created. </font><div style="font-family: arial; font-size: 10pt; "><br></div><div><font class="Apple-style-span" face="arial" size="2">knowledgeSession.getObjects(): </font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">this will return all objects: the facts that were inserted into the engine before fireAllRules(), plus the new facts created as result of the rule execution.</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Also you can use getQueryResults, or openLiveQuery for the working memory to retrieve facts from the working
memory. </font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">--- On </font><b style="font-family: arial; font-size: 10pt; ">Fri, 1/28/11, Benson Fung <i><benson.redhat@gmail.com></i></b><font class="Apple-style-span" face="arial" size="2"> wrote:</font><br><blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; font-family: arial; font-size: 10pt; "><br>From: Benson Fung <benson.redhat@gmail.com><br>Subject: [rules-users] How to obtain the object/fact created in the
rule file?<br>To: "Rules Users List" <rules-users@lists.jboss.org><br>Date: Friday, January 28, 2011, 12:02 PM<br><br><div class="plainMail">Hi,<br><br>I developed a rule as below:<br><br> rule "Rule1"<br> dialect "mvel"<br> when<br> Fields( field1 > "100" )<br> then<br> FieldResults fact0 = new FieldResults();<br> fact0.setField1( "This is Correct!" );<br> insert(fact0 );<br> end<br><br>After calling fireAllRules(...), the above rule will be fired and<br>created a fact object in the working memory.<br>My problem is how to obtain the FieldResults object in the java<br>program. Please
advise.<br><br><br>Thanks<br>Benson<br>_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="/mc/compose?to=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></div></blockquote></div></td></tr></table><br>