[rules-users] referencing the incoming objects vs the matching object
Michael Anstis
michael.anstis at gmail.com
Fri May 25 09:19:32 EDT 2012
Assuming TYPE_1 is the opposite of TYPE_2 and not just a difference it
should work.
What is "opposite" is perhaps difficult to define as there is probably some
semantics involved: up\down, left\right, yes\no.
These have well defined meanings and hence we can say with some certainty
that these are opposites or one and other.
On 25 May 2012 14:07, Ben Cuthbert <bencuthbert at ymail.com> wrote:
> 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
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120525/a7ae2f4d/attachment.html
More information about the rules-users
mailing list