[rules-users] Any easy way to avoid inserting same id object into memory?

Wolfgang Laun wolfgang.laun at gmail.com
Thu Dec 5 02:44:21 EST 2013


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 at 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-object-into-memory-tp4027102.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> 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