[midPoint] iterationToken in Object Template

Martin Marchese mmarchese at identicum.com
Wed Jun 22 19:03:40 CEST 2016


Hi all,

I have an Object Template for users, and since I need email to be unique, I
defined an iteration on it:

*<objectTemplate oid="c0c010c0-d34d-b33f-f00d-777222222333">*
*  <name>User Template CSV sync</name>*
*  <iteration>*
*    <maxIterations>10</maxIterations>*
*    <tokenExpression>*
*      <script>*
*        <code>*
*          if (iteration == 0) {*
*            return "";*
*          } else {*
*            return ""+iteration;*
*          }*
*        </code>*
*      </script>*
*    </tokenExpression>*
*  </iteration>*
*...*
*...*

And then within the emailAddress mapping:

<mapping>
    <strength>weak</strength>
    <source>
      <path>givenName</path>
    </source>
    <source>
      <path>familyName</path>
    </source>
    <expression>
      <script>
        <language>
http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy
</language>
        <code>
          def givenNameStr = ''+givenName
          givenNameStr.substring(0,1) + '' + familyName + iterationToken +
'@domain.com'
        </code>
      </script>
    </expression>
    <target>
      <path>$user/emailAddress</path>
    </target>
  </mapping>

The problem is that whenever I create a user, the email is always being set
as if the iterationToken is '' and this result on duplicate emailAddress
attribute among users.

Is there something I'm doing wrong?

Thanks in Advance

*Ing. Martín Marchese*
Identicum S.A.
Anchorena 1357 PB
Tel: +54 (11) 3526.5509
mmarchese at identicum.com
www.identicum.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20160622/7e48a208/attachment.htm>


More information about the midPoint mailing list