If globalService.getCustomObjects() returns a collection then there is no point in doing a from/collect to iterate and collect (again) what was a collection to start with.
Simply use for (Object obj: globalService.getCustomObjects()) insert(obj); -W 2011/10/27 Michael Anstis <michael.ans...@gmail.com> > Why not get get List using "from" in the LHS and iterate this in the RHS > adding individual facts? > > > On 27 October 2011 21:39, RK <rmeiap...@datacert.com> wrote: > >> I want to insert multiple facts sourced by a 'from' clause to a service >> method. >> For Ex: >> >> when >> ... >> then >> insert( mycustomobject() from globalService.getCustomObjects()) >> >> getCustomObjects() method will return several instances of custom objects >> based on a sql query and i want to insert them into the knowledge session. >> I'll be using these custom objects in other subsequent rules. >> >> Is it possible to do something like this ? >> >> Thanks >> >> >> -- >> View this message in context: >> http://drools.46999.n3.nabble.com/inserting-multiple-facts-in-RHS-tp3459071p3459071.html >> Sent from the Drools: User forum mailing list archive at Nabble.com. >> _______________________________________________ >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users >> > > > _______________________________________________ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > >
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users