You must not add the parenthesis after <i>not.</i><div><i><br></i></div><div>Try this:</div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">rule "Flag missing Foos with values"<br>
when<br> not Foo(stringProp=="blah", intProp==5)<br>then<br> System.err.println("A proper foo does not exist");<br>end</font></div><div><br></div><div>Bye</div><div><i>Raf</i><div><br><br><div class="gmail_quote">
On Fri, Aug 19, 2011 at 3:17 PM, Chris Richmond <span dir="ltr"><<a href="mailto:crichmond@referentia.com">crichmond@referentia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
How do I fire a rule if an object with certain characterstics does not<br>
exists.<br>
<br>
For example my class Foo, if I have a rule:<br>
<br>
rule "Identify Foos with values"<br>
<br>
when<br>
Foo(stringProp=="blah", intProp==5)<br>
then<br>
System.err.println("A Foo was found!");<br>
end<br>
<br>
<br>
So how do I check for lack of existence of an object with certain<br>
characteristics<br>
<br>
I tried:<br>
rule "Flag missing Foos with values"<br>
<br>
when<br>
not(Foo(stringProp=="blah", intProp==5))<br>
then<br>
System.err.println("A proper foo does not exist");<br>
end<br>
<br>
I also tried:<br>
rule "Flag missing Foos with values"<br>
<br>
when<br>
not(exists(Foo(stringProp=="blah", intProp==5)))<br>
then<br>
System.err.println("A proper foo does not exist");<br>
end<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br></div></div>