<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Sorry, the actual error in my logic was
totally unrelated to the fragment below.<br>
<br>
The problem was that the DQAttribute that should have matched
below was inserted by another rule, but the insertion was done at
a time when the checkViolations collection was still emtpy. And I
had forgotten the modify() after filling the checkViolations
collection.<br>
<br>
So the rule "saw" an empty collection and that last condition did
not trigger. Once I corrected that, things started working :-)<br>
<br>
On 08/03/2013 10:59 PM, Joe Ammann wrote:<br>
</div>
<blockquote cite="mid:51FD6F3D.9020606@pyx.ch" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Here's what I currently have (Drools 5.5.0 btw):<br>
<br>
<blockquote><tt>rule "R2030: UpdateDQAttribute"</tt><br>
<tt>dialect "mvel" </tt><br>
<tt>agenda-group "PROCESS_CHECKRESULTS"</tt><br>
<tt>when</tt><br>
<tt> pv : PriceViolation ( p : changedPrice.price, dqc :
check )</tt><br>
<tt> ps : PriceSeries ( id == p.seriesId )</tt><br>
<tt> i : Instrument ( id == ps.instrument.id )</tt><br>
<tt> dqa : DQAttribute ( rootId == i.id, objectId == p.id )</tt><br>
<tt> not dqcv : DQCheckViolation ( check.id == dqc.id ) from
dqa.checkViolations</tt><br>
<tt>then</tt><br>
<tt> # debug</tt><br>
<tt> for (DQCheckViolation dqcv : dqa.checkViolations) {</tt><br>
<tt> logger.debug("dqc: {}, dqcv: {}", dqc.id,
dqcv.check.id);</tt><br>
<br>
<tt> }<br>
end</tt><br>
</blockquote>
The rule fires and the log statement produces<br>
<br>
<blockquote><tt>PriceCheck: dqc:
6fc6636b-9b7c-4302-bce7-1680eec57830, dqcv:
6fc6636b-9b7c-4302-bce7-1680eec57830</tt><br>
</blockquote>
The ids are the same, so I would have expected that last LHS
condition to avoid that the rule fires.<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
CU, Joe</pre>
</body>
</html>