[rules-users] How to trigger update when modifying a list attribute?

Paulo Reis casmeiron at gmail.com
Thu Aug 16 08:05:40 EDT 2012


Hi guys,

I'm having the follow issue: I have an object that contains a list. The object is inserted on the memory but not the list, so I want to do something like this:

when
	$obj: Object()
	eval($obj.hasInList("item"))
then
	$obj.replaceInList("item", "replacement");
end

How do I trigger the update for $obj? I've tried to add Java Beans support but that didn't help, neither @watch nor @PropertyChangeSupport on java class.

Im watching the debug but don't see the object being modified and I've rules that were triggered that shouldn't be because the value was already changed.

Inserting the list on the working memory won't help me, as I need to search like this:

when
	$obj: Object()
	eval($obj.hasInList("item item1 item2 item3"))
then
	$obj.replaceInList("item item1 item2 item3", "singleItem")
end

The example above search for several items (each one is a list element), so I need to replace them all for a single element.

Any thoughts?

Thanks in advance.

Paulo Reis
casmeiron at gmail.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120816/7e195048/attachment.html 


More information about the rules-users mailing list