[midPoint] How to blank out user properties?

Richard Frovarp richard.frovarp at ndsu.edu
Thu Jul 2 18:12:59 CEST 2020


I'm reading a list of our employees from a DB through a
DatabaseTableConnector resource. As part of that process I'm setting a
custom schema element that is their title. That's fine. However, when
they are no longer employed, they disappear from the database table.

So I'm trying to blank out the title property, since if they aren't
employed anymore, they don't have a title. We want to keep historic
records, and they may still be a student, which we wouldn't populate a
title.

How does one go about doing this? It was suggested using an object
template on the deleted situation, but that doesn't appear to be
working.

Resource:

<reaction>
  <situation>deleted</situation>
  <synchronize>true</synchronize>
  <action>
    <handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action
-3#unlink</handlerUri>;
  </action>
  <objectTemplateRef oid="5b23b0d3-0740-47a1-932d-c5a4ab513bc4" />
</reaction>

User Template:

<mapping>
  <description>Clean out department</description>
  <strength>strong</strength>
  <target>
    <path>$user/extension/ndsuPrimaryJobTitle</path>
  </target>
  <expression>
    <script>
      <code>null</code>
    </script>
  </expression>
</mapping>

No errors are thrown, it's just that the title element remains populate
with the last know value when the user is deleted from the resource.

Thanks,
Richard


More information about the midPoint mailing list