So, if used like that, 'not' does not have 'existential' meaning then,
but
simple 'negation'? I mean, the expression
not MyObject(field == 'value')
would still mean 'not exists', correct? Would the expression
not (MyObject(field == 'value'))
mean
MyObject(field != 'value')
then. In other worlds, "all objects OTHER then those matching the
constraint"?
Thanks.
Vlad
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: 20 February 2007 14:37
To: Rules Users List
Subject: Re: [rules-users] logical 'not' - is there such a construct?
Vlad,
In 3.1M1 you can write:
rule X
when
not (
MyObject( aaa == "bbb" ) and
MyObject2( bbb == "aaa" )
)
then
// do something
end
But remember that variables bound inside the "not" block are not avaible
in the consequence for obvious reasons.
[]s
Edson
Olenin, Vladimir (MOH) wrote:
Hi,
I wonder if there is logical 'not' operator (in the meaning of "!="
->
'not equal') which can be applied to the whole rule? Eg:
Rule x
When
! (
MyObject(aaa == "bbb")
MyObject2(bbb == "aaa")
)
Then
// do smth
End
Basically I'm looking for an operator to reverse the evaluation result
of the expression in the brackets. The use case: in my system all
rules are defined from 'rule passes' prospective, while the
application should take some action in case the rule is NOT passed
(ie, 'else' case).
Any way to do that except reformulating the constraints themselves?
Thanks,
Vlad
------------------------------------------------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @
www.jboss.com
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users