[rules-users] does WorkingMemory.iterator support remove()?
Godmar Back
godmar at gmail.com
Fri Oct 5 12:07:01 EDT 2007
Yes, that's what I want to do.
So you're saying that a facthandle iterator remains intact even if
fact handles are retracted/removed from WorkingMemory? That may be
worth documenting as well unless it's somehow implied.
- Godmar
On 10/5/07, Anstis, Michael (M.) <manstis1 at ford.com> wrote:
> Wouldn't the best approach be to get the FactHandles iterator and retact
> them from working memory rather than removing them through the iterator?
>
> Iterator itr = wm.iterateFactHandles();
> While(itr.next()) {
> FactHandle h = itr.next();
> wm.retract(h);
> }
>
> This would ensure truth maintenance is preserved.
>
> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org
> [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Godmar Back
> Sent: 05 October 2007 16:40
> To: Rules Users List
> Subject: Re: [rules-users] does WorkingMemory.iterator support remove()?
>
> Thanks - consider supporting it for efficiency. (Otherwise, removing a
> set of facts from working memory requires a temporary container to
> hold the facts to be removed.)
>
> - Godmar
>
> On 10/5/07, Mark Proctor <mproctor at codehaus.org> wrote:
> > Godmar Back wrote:
> > > Does the iterator returned by WorkingMemory.iterator support remove()?
> > >
> > > I checked the javadoc and the Drools manual, but may have missed it.
> > >
> > If you try it you'll get an exception thrown
> "UnsupportedOperationException"
> >
> http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/main/jav
> a/org/drools/util/JavaIteratorAdapter.java
> > > Please answer and augment documentation.
> > >
> > > - Godmar
> > > _______________________________________________
> > > rules-users mailing list
> > > rules-users at lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/rules-users
> > >
> > >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
More information about the rules-users
mailing list