Two ways you could do it:<br><br>List list = workingMemory.getObjects(Target.class);<br><br>or use a query:<br><br>drl:<br>query "target objects"<br> Target()<br>end<br><br>code:<br>QueryResults results = workingMemory.getQueryResults
( "target objects" );<br><br>cheers<br>Steve<br><br><br><br><br><div><span class="gmail_quote">On 4/10/07, <b class="gmail_sendername">jdepaul</b> <<a href="mailto:jjdepaul@us.ibm.com">jjdepaul@us.ibm.com</a>
> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Suppose my client code initially asserts two Facts into WorkingMemory<br>
instance: one Source object and one TargetOne object. As the rules get<br>applied, some of the rules may assert additional Target facts into WM. How<br>can I retrieve all of the Target facts (however many were created) from the
<br>WorkingMemory after fireAllRules() method was called (regardless of how many<br>Target objects were created as a result)?!<br><br>I will not know the concrete type of the target object types that were<br>asserted into WM instance, as they can be as many as 7 class sub-types
<br>(TargetOne, TargetTwo, TargetThree), though they will all share a common<br>super-class (com.mypackage.Target). Can someone show an example on how to<br>fetch the resulting Target objects after fireAllRules() is called and filter
<br>out the Target objects?<br><br>Thanks in advance -<br>James<br><br>--<br>View this message in context: <a href="http://www.nabble.com/Fetching-Facts-from-WM...-tf3550451.html#a9912199">http://www.nabble.com/Fetching-Facts-from-WM...-tf3550451.html#a9912199
</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams
<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501<br><a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a><br><a href="http://www.objectconsulting.com.au">
www.objectconsulting.com.au</a><br><br>consulting | development | training | support<br>our experience makes the difference