Quote from the Expert manual:
"A Working Memory may operate in two assertion modes, i.e., equality
or identity, with identity being the default."
Search for the keyword to see all references; you'll need "equality".
-W
On 05/12/2013, Sonata <plz.write.to(a)gmail.com> wrote:
Hi, I have a rule that on its RHS, it creates new objects with
random
content
and inserts them.
How do you check if the object already exists in drools memory?
I am thinking to use kcontext.getKnowledgeRuntime().getObjects() in the RHS
to loop for all the objects and stop inserting if an object with same
content exists.
Is there any better way?
May be like using query?
Drools ver is 5.5.0.Final
Thank you
--
View this message in context:
http://drools.46999.n3.nabble.com/Any-easy-way-to-avoid-inserting-same-id...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users