[midPoint] How to blank out user properties?

Ivan Noris ivan.noris at evolveum.com
Fri Jul 3 09:11:31 CEST 2020


Hi Richard,

last week I was using this. It's from my global object template but I
think it can be reworked for inbound mapping.

The mapping will remove e-mail address if the extension/recordStatus
attribute is "deleted". The range (<set>) is the key. Just returning
null is not enough (I had some hard time with this myself.)

This mapping is not importing addresses from anywhere. Just clearing
them. There is other resource from which I eventually import the email
addresses (for other than "deleted" users).

    <mapping>
        <name>Clear the e-mail address for deleted users</name>
        <strength>strong</strength>
        <source>
            <path>extension/recordStatus</path>
        </source>
        <expression>
            <script>
                <code>return null</code>
            </script>
        </expression>
        <target>
            <path>emailAddress</path>
            <set>
                <predefined>all</predefined>
            </set>
        </target>
        <condition>
            <script>
                <code>recordStatus == 'deleted'</code>
            </script>
        </condition>
    </mapping>

Works in 4.0.2.

Best regards

Ivan

On 2. 7. 2020 18:12, Richard Frovarp wrote:
> 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
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint

-- 
Ivan Noris
Senior Identity Engineer
evolveum.com




More information about the midPoint mailing list