[rules-users] referencing the incoming objects vs the matching object

Ben Cuthbert bencuthbert at ymail.com
Fri May 25 09:07:02 EDT 2012


All

If I have an object say 

class TestObject {
	private String type;
	private String name;
}

And I want to match opposite types so I fire in the following

insert(new TestObject("TYPE_1", "This is our type 1 object");
insert(new TestObject("TYPE_2", "This is our type 1 object");

So I want to say only match again opposite types

would this work?

rule "#999 Match"
	dialect "mvel"
	when
	    $incoming : TestObject($type: type)
	    $current : TestObject( type != $type)
	then
	    insert(new String("LOGGING: incoming:" + $incoming.getType() + " current:" + $current.getType() ));
end

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


More information about the rules-users mailing list