[midPoint] User template - rename user

mariano marron marron.mariano87 at gmail.com
Tue Aug 30 20:49:10 CEST 2016


Hi everyone, I have the following issue: I need to import users from a
database table (I'm using the database resource) but first I need to see if
the user in the table has the field "email" not null, and if it does,
that's the name I want for my user in midpoint. If it doesn't, I user
another field of the table (id number). I have configured the resource
inbound mapping to map the id number to the name first and I was trying to
set the email if not null with an object template, using the following
mapping:

   <mapping>
      <strength>weak</strength>
      <source>
         <name>email</name>
         <c:path>$user/emailAddress</c:path>
      </source>
      <expression>
         <script>
            <language>
http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy
</language>
            <code>
            return email.split("@")[0]
        </code>
         </script>
      </expression>
      <target>
         <c:path>name</c:path>
      </target>
      <condition>
         <script>
            <code>
                email != null
            </code>
         </script>
      </condition>
   </mapping>

This isn't working. Any ideas why? The resource is referenced to the
template and it's executing it when I import users (I see some other logic
applied to the user that is created in midpoint), but not renaming them.
Thanks in advance.

Mariano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20160830/4033d802/attachment.htm>


More information about the midPoint mailing list