[midPoint] Getting improper null input on attribute mapping

Martin Besozzi mbesozzi at identicum.com
Tue Jan 24 22:13:27 CET 2017


Hi, Guys.
Regarding this issue, we added a condition using "
*ScriptExpressionEvaluationContext.getThreadLocal().isEvaluateNew()*" in
order to check if it is a "real" modify. Because, as Rodrigo said, we
received a null even though the attribute is valued on the Resource.

Mapping on the resource:

*<attribute>*

























*    <c:ref>ri:CONTRACT_DATE</c:ref>    <inbound>       <expression>
  <script>              ...              log.debug("Attribute customDate
value: {}",  input);              ...              </script>
 </expression>       <target>
<c:path>$focus/extension/customDate</c:path>       </target>
<condition>                  <script>                      <code>
                   boolean isEvaluateNew =
ScriptExpressionEvaluationContext.getThreadLocal().isEvaluateNew();
                     if(isEvaluateNew == false)  {
                log.debug("Skipping attribute because is not a real modify:
" +  input);                                          return false;
                     }                             return true;
               </code>                </script>          </condition>
</inbound></attribute>*

If we change the attribute value from "*2017-12-12 16:20:00*" to "*2018-12-12
16:20:00*" on the resource and then we run an import, the log shows:


*1. Skipping attribute because is not a real modify: null*
*2. Attribute customDate value: 2018-12-12 16:20:00*

As you can see it is working because we could skip the first modify (first
point) and then processed the "real" modify (second point).

Do you have any other suggestions?

Regards.




Ing Martin Besozzi
Identicum S.A.
Jorge Newbery 3226
Tel: +54 (11) 4552-3050
www.identicum.com

On Tue, Jan 24, 2017 at 12:50 PM, Rodrigo Yanis <ryanis at identicum.com>
wrote:

> Hello everyone,
>
> 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.
>
> 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 *real *value on the platform, resource brings a *null* value
> for this attribute. This null value is not consistent with platform data
> and breaks our logic.
>
> Mapping on the resource is defined:
>
>> <attribute>
>>     <c:ref>ri:CONTRACT_DATE</c:ref>
>>     <inbound>
>>        <expression>
>>           <script>
>>              <code>
>>               ...
>>               log.debug("Attibute customDate value: {}",  input);
>>               ...
>>              </code>
>>           </script>
>>        </expression>
>>        <target>
>>           <c:path>$focus/extension/customDate</c:path>
>>        </target>
>>     </inbound>
>> </attribute>
>
>
> In execution time, log entries look like this:
>
>    1. Attibute customDate value: null
>    2. Attibute customDate value: 2017-12-12 16:20:00
>
> Do you know of any possible way to detect this ghost null values and
> filter them on resource logic?
>
> Thanks
>
> *Rodrigo Yanis.*
> Identicum S.A.
> Jorge Newbery 3226
> Tel: +54 (11) 4824-9971
> ryanis at identicum.com
> www.identicum.com
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170124/51fff935/attachment.htm>


More information about the midPoint mailing list