<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi all<br>
<br>
I'm still struggling with the handling of lists and membership in
the LHS of rule. I'm trying to formulate a rule that only fires if a
certain object is not yet a member of a list.<br>
<br>
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>
<pre class="moz-signature" cols="72">--
CU, Joe</pre>
</body>
</html>