<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi, Guys.</div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Regarding this issue, we added a condition using "<i>ScriptExpressionEvaluationContext.getThreadLocal().isEvaluateNew()</i></font><span style="font-family:arial,helvetica,sans-serif">" in order to check if it is a "real" modify. Because, as Rodrigo said, we received a null </span><font face="arial, helvetica, sans-serif">even though the attribute is valued on the Resource.</font></div><div class="gmail_default"><br></div><div class="gmail_default">Mapping on the resource:<br></div><div class="gmail_default"><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div class="gmail_default"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><attribute></i></div><i> <c:ref>ri:CONTRACT_DATE</c:ref><br> <inbound><br> <expression><br> <script><br> ...<br> log.debug("Attribute customDate value: {}", input);<br> ...<br> </script><br> </expression><br> <target><br> <c:path>$focus/extension/customDate</c:path><br> </target><br> <condition><br> <script><br> <code><br> <font color="#0000ff"> <b>boolean isEvaluateNew = ScriptExpressionEvaluationContext.getThreadLocal().isEvaluateNew();<br> if(isEvaluateNew == false) {<br> log.debug("Skipping attribute because is not a real modify: " + input);<br> return false;<br> }<br> return true; </b></font><b> </b> <br> </code><br> </script><br> </condition><br> </inbound><br></attribute></i></div><div class="gmail_default"><i><br></i></div><div class="gmail_default"><span style="font-size:12.8px">If we change the attribute value from "<i>2017-12-12 16:20:00</i>" to "</span><span style="font-size:12.8px"><i>2018-12-12 16:20:00</i>" on the resource and then we run an import, the log shows:</span></div><div class="gmail_default"><br></div><div class="gmail_default"><i>1. Skipping attribute because is not a real modify: null<br></i></div><div class="gmail_default"><i>2. Attribute customDate value: 2018-12-12 16:20:00</i></div><div class="gmail_default"><br></div><div class="gmail_default">As you can see it is working because we could skip the first modify (first point) and then processed the "real" modify (second point).</div><div class="gmail_default"><br></div><div class="gmail_default">Do you have any other suggestions?</div><div class="gmail_default"><br></div><div class="gmail_default">Regards.</div><div class="gmail_default"> </div><div class="gmail_default"><i><br></i></div><div class="gmail_default"><i><br></i></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font face="arial, helvetica, sans-serif">Ing Martin Besozzi</font></div><font face="arial, helvetica, sans-serif">Identicum S.A.<br></font><div dir="ltr"><font face="arial, helvetica, sans-serif">Jorge Newbery 3226</font></div><div dir="ltr"><font face="arial, helvetica, sans-serif">Tel: +54 (11) 4552-3050</font></div><a href="http://www.identicum.com" target="_blank"><font face="arial, helvetica, sans-serif">www.identicum.com</font></a><br></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Tue, Jan 24, 2017 at 12:50 PM, Rodrigo Yanis <span dir="ltr"><<a href="mailto:ryanis@identicum.com" target="_blank">ryanis@identicum.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello everyone,<div><br></div><div>We have a database SQL connector with inbound mappings on specific attributes that, as per business rule, cannot be null. Because of this, we defined custom logic to trigger an error when this happen on user sync time.</div><div><br></div><div>Our specific circumstance is that, we're always getting prompted with this error when the user get their attributes synced, even though the attribute is valued on the platform. Further log research showed that, before obtaining the <i>real </i>value on the platform, resource brings a <b>null</b> value for this attribute. This null value is not consistent with platform data and breaks our logic.</div><div><br></div><div>Mapping on the resource is defined:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"><attribute><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> <c:ref>ri:CONTRACT_DATE</c:<wbr>ref><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> <inbound><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> <expression><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> <script><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> <code><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> ...<br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> log.debug("Attibute customDate value: {}", input);<br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> ...<br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> </code><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> </script><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> </expression><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> <target><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> <c:path>$focus/extension/<wbr>customDate</c:path><br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> </target> <br></span><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:x-small"> </inbound><br></span><font face="monospace, monospace" size="1" color="#000000"></attribute></font></blockquote><div><br></div><div>In execution time, log entries look like this:</div><div><ol><li>Attibute customDate value: null<br></li><li>Attibute customDate value: 2017-12-12 16:20:00<br></li></ol><div>Do you know of any possible way to detect this ghost null values and filter them on resource logic?</div><div><br></div><div>Thanks</div><span class="HOEnZb"><font color="#888888"><div><div class="m_-5620336199374931850gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><font face="arial, helvetica, sans-serif"><b>Rodrigo Yanis.</b><br><img src="http://www.identicum.com/img/favicon.ico">Identicum S.A.<br></font>Jorge Newbery 3226<br>Tel: +54 (11) 4824-9971<font face="arial, helvetica, sans-serif"><br><a href="mailto:ryanis@identicum.com" target="_blank"><font color="#0b5394">ryanis@identicum.com</font></a><br><a href="http://www.identicum.com/" target="_blank"><font color="#0b5394">www.identicum.com</font></a></font></div></div></div></div></div></div></div></div></div></div></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br></div>