As you have posted before, you can use the evaluator by referring to the<br>field in a previously bound fact.<br><br>$object : MyObject ( activated == false,<br> $name : name,<br> $firstValue : firstValue,<br>
$valueList : valueList )<br> <br> // getting the event representing the Value object<br> $firstValueEvent: Value( this == $firstValue )<br> <br> $newValue: Value ( name == $name<br>
&& this != $firstValueEvent<br> && this after[0ms,1h] $firstValueEvent<br> && $object.parameterValueList not contains this<br>
&& $object.valueList not contains this ### ###<br> && eval(valueExceededLimit(this)) )<br><br>I've tried to invert the order. Check carefully, I may have missed a trick ;-) <br>
<br>$newValue: Value ( $name : name, eval(valueExceededLimit(this)) )<br><br>$object : MyObject ( activated == false,<br> name == $name,<br> $firstValue: firstValue != $newValue,<br>
parameterValueList not contains $newValue,<br> valueList not contains $newValue,<br> <br>$firstValueEvent: Value( this == $firstValue && != $newValue,<br>
this before[0ms,1h] $newValue )<br><br>-W<br><br><br><br><br><div class="gmail_quote">2010/11/1 Tina Vießmann <span dir="ltr"><<a href="mailto:tviessmann@stud.hs-bremen.de">tviessmann@stud.hs-bremen.de</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
I understand why the order needs to be inverted. But that results in
the inversion of the whole condition. I'm not sure how to revert the
condition.<br>
The complete condition without 'not contains' and inversion is:<br>
<br>
$object : MyObject ( activated == false,<br>
$name : name,<br>
$firstValue : firstValue,<br>
$valueList : valueList )<br>
<br>
// getting the event representing the Value object<br>
$firstValueEvent: Value( this == $firstValue )<br>
<br>
$newValue: Value ( name == $name<br>
&& this !=
$firstValueEvent<br>
&& this
after[0ms,1h] $firstValueEvent <br>
&&
$object.parameterValueList not contains $newValue <br>
&& eval(
!($valueList.contains($newValue))<br>
&&
valueExceededLimit($newValue)) )<div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
<blockquote type="cite">To use not contains, you'll have to invert the order
of the patterns:<br>
$ value : Value ( // other restrictions )<br>
$object : MyObject ( $valueList : valueList not contains $value
)<br>
This will use the evaluator which should be more efficient than
eval()<br>
-W<br>
<br>
<br>
<div class="gmail_quote">2010/11/1 Mauricio Salatino <span dir="ltr"><<a href="mailto:salaboy@gmail.com" target="_blank">salaboy@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
can you try with
<div>$valueList not contains $value</div>
<div>but internally I suppose that it will work in the same
way that the eval.</div>
<div><br>
</div>
<div>
<div>
<div><br>
<div class="gmail_quote">
On Mon, Nov 1, 2010 at 11:55 AM, Tina Vießmann <span dir="ltr"><<a href="mailto:tviessmann@stud.hs-bremen.de" target="_blank">tviessmann@stud.hs-bremen.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Is it possible to write
the following conditions without using eval?<br>
<br>
<br>
$object : MyObject ( $valueList : valueList
) // of type List<br>
$ value : Value ( // other restrictions<br>
&& eval( !($valueList.contains($value)) ) )<br>
<br>
<br>
Thank you :)<br>
Tina<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br clear="all">
<br>
</div>
</div>
-- <br>
- CTO @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com</a>
<br>
- MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><br>
- Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br>
<br>
- Salatino "Salaboy" Mauricio -<br>
</div>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br>
</blockquote>
</div>
<br>
<pre><fieldset></fieldset>
_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</div></div></div>
<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>
<br></blockquote></div><br>