[rules-users] Working memory update problem in the LHS

Fabrice Granzotto granz at MIT.EDU
Fri Oct 19 14:38:23 EDT 2007


I have 3 classes in my working memory:

- Item
- Container
- History

I first create an object Item i (which is in the container c):

Container c1=new Container(?c1?);
Item i=new Item(c1);
session.insert(i);

When I insert the item in the working memory a rule is fired and creates a new
History object which is directly asserted in the working memory:

History h1=new History(i);
insert(h1);

Now we have this situation: History.getItem().getContainer().getName() gives
?c1?. After that, in my application, I change the container of the Item i:

i.setContainer(new Container(?c2?));
(auto update in the working memory via a bean, it works, the debugger indicates
that the item was updated)

Now we should this situation: History.getItem().getContainer().getName() gives
?c2?. But in the LHS of the rules, this call still gives ?c1? and in a
RHS it is ok, it gives ?c1?

What am I doing wrong? Why is the History object not updated in the LHS?

Thanks for your help

Fabrice



More information about the rules-users mailing list