Hi,

 

I need to have two objects of the same class present in the working memory at the same time. Both objects can have other nested objects of different classes.

The reason is I need to compare data change b/w two objects. E.g;

 

originalObject_A.getPersonTO().getAge() != changedObject_A.getPersonTO().getAge()

 

I am using Drools 3.0, DRLs and DSL.

 

My question is: how do I assert two objects belonging to the same class in working memory in order to access them both in DSL.

 

E;g

 

I can do:

 

workingMemory.assertObject(originalObject_A); //instance of class A       

workingMemory.assertObject(changedObject_A); //instance of class A

 

and in DRL I can write:

 

[when]There is an instance with = originalObject_A:ClassA()

 

how do I get the changedObject_A in dsl.

 

How does drools know which object I am requesting? I hope my question is clear. Is it even possible in drools 3.0?

 

Thanks

Saleem Lakhani