[rules-users] Need Help with 2 same objects in Working Memory

Saleem Lakhani Saleem.Lakhani at citizensfla.com
Fri Mar 21 13:28:38 EDT 2008


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() 

 

to access originalObject_A but how do I access the changedObject_A in
dsl. 

 

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

 

Thanks

Saleem Lakhani

 

 

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080321/4610b308/attachment.html 


More information about the rules-users mailing list