Two ways you could do it:
List list = workingMemory.getObjects(Target.class);
or use a query:
query "target objects"
QueryResults results = workingMemory.getQueryResults( "target objects" );
On 4/10/07, jdepaul <jjdepaul(a)us.ibm.com> wrote:
Suppose my client code initially asserts two Facts into WorkingMemory
instance: one Source object and one TargetOne object. As the rules get
applied, some of the rules may assert additional Target facts into WM.
can I retrieve all of the Target facts (however many were created) from
WorkingMemory after fireAllRules() method was called (regardless of how
Target objects were created as a result)?!
I will not know the concrete type of the target object types that were
asserted into WM instance, as they can be as many as 7 class sub-types
(TargetOne, TargetTwo, TargetThree), though they will all share a common
super-class (com.mypackage.Target). Can someone show an example on how to
fetch the resulting Target objects after fireAllRules() is called and
out the Target objects?
Thanks in advance -
View this message in context:
Sent from the drools - user mailing list archive at Nabble.com
rules-users mailing list
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
consulting | development | training | support
our experience makes the difference