<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Glenn,</p>
    <p>not sure; I was using this for years after being hinted by
      developers. I usually also mention it during our midPoint
      trainings.</p>
    <p>Best regards,</p>
    <p>Ivan<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 05/22/2017 10:06 AM, BOSCHMANS Glenn
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:43FA1D2E0C8C00438B9E6C1D2595B5E0370D79F6@SVMXECSPW049.irisnet.wan">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Calibri Light \,sans-serif";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Arial",sans-serif;
        color:windowtext;}
span.titrecar
        {mso-style-name:titrecar;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Arial",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;
        mso-fareast-language:EN-US;}
span.EmailStyle26
        {mso-style-type:personal-reply;
        font-family:"Arial",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:windowtext"
            lang="EN-US">Hi Ivan,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:windowtext"
            lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:windowtext"
            lang="EN-US">At first glance, the work-around does it job.
            Thanks for your help!<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:windowtext"
            lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:windowtext"
            lang="EN-US">Is there any documentation on
            ScriptExpressionEvaluationContext (and possibly similar
            classes)? A search on the wiki returned no results.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:windowtext"
            lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:windowtext"
            lang="EN-US">Best regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:windowtext"
            lang="EN-US">Glenn<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:windowtext"
            lang="EN-US"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span
                  style="color:windowtext;mso-fareast-language:NL-BE"
                  lang="EN-US">From:</span></b><span
                style="color:windowtext;mso-fareast-language:NL-BE"
                lang="EN-US"> midPoint
                [<a class="moz-txt-link-freetext" href="mailto:midpoint-bounces@lists.evolveum.com">mailto:midpoint-bounces@lists.evolveum.com</a>]
                <b>On Behalf Of </b>Ivan Noris<br>
                <b>Sent:</b> vrijdag 19 mei 2017 22:40<br>
                <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a><br>
                <b>Subject:</b> Re: [midPoint] Generation of $user/name
                on reconcilitation of new account<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p>Hi Glenn,<o:p></o:p></p>
        <p>the configuration looks ok to me. Or at least, I'd do it in
          the same way. The configuration of iteration token expression
          is probably missing, but maybe the defaults are fine.<o:p></o:p></p>
        <p>The configuration of resource and its relationship to your
          object template is OK. #addFocus action is OK (#addUser is the
          same, ast least fow now, but it's deprecated and kept for
          backward compatibility reasons only)<o:p></o:p></p>
        <p>The trick and workaround follows.<o:p></o:p></p>
        <p>The problem is with the old value of the attributes (mainly
          givenName, as it's used in substring). To see that, I used
          <trace>true</trace> element in the mapping:<o:p></o:p></p>
        <p><mapping><br>
                <name>JIT Username generation</name><br>
                <strength>weak</strength><br>
                <trace>true</trace><br>
                <source><br>
                   <c:path>$user/givenName</c:path><br>
                </source><br>
                <source><br>
                   <c:path>$user/familyName</c:path><br>
                </source><br>
                <expression><br>
                   <script><br>
                     <code><br>
                     boolean isNew =
com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluationContext.getThreadLocal().isEvaluateNew()<br>
                     if (isNew) return
          basic.norm(basic.stringify(givenName)).substring(0,1) +
          basic.norm(basic.stringify(familyName)) //+ iterationToken<br>
                     </code><br>
                   </script><br>
                </expression><br>
                <target><br>
                   <c:path>name</c:path><br>
                </target><br>
             </mapping><o:p></o:p></p>
        <p>2017-05-19 22:20:19,027 [] [midPointScheduler_Worker-6] INFO
          (com.evolveum.midpoint.model.common.mapping.Mapping): Mapping
          trace:<br>
          ---[ MAPPING 'JIT Username generation'  in
          objectTemplate:a2fefde3-d6e6-49eb-ae2e-586eca3d747a(Boschmans
          User Template)]---------------------------<br>
          Source: <b>givenName: old=null</b>, delta=PropertyDelta( /
          {.../common/common-3}givenName, ADD),
          new=PP({.../common/common-3}givenName):[PPV(PolyString:Bill
          X.)]<br>
          Source: <b>familyName: old=null</b>, delta=PropertyDelta( /
          {.../common/common-3}familyName, ADD),
          new=PP({.../common/common-3}familyName):[PPV(PolyString:Gates)]<br>
          Target: PPD:{.../common/common-3}name {<a
            href="http://prism.evolveum.com/xml/ns/public/types-3"
            moz-do-not-send="true">http://prism.evolveum.com/xml/ns/public/types-3</a>}PolyStringType[0,1],RAM<br>
          Expression: script: ScriptExpression( boolean isNew =
          com.evolveum.midpoint.mod...)<br>
          Condition: true -> true<br>
          Result: added: bgates<o:p></o:p></p>
        <p>As you can see, the old values are empty, but the new have
          correct values.<o:p></o:p></p>
        <p>Of course I (you) could use "basic.stringify(givenName))<b>?.</b>substring(0,1)"
          to avoid calling substring on null object; but the initial
          would be missing then.<o:p></o:p></p>
        <p>The above is traced after I fixed the mapping (I removed
          iterationToken though), so it produced correct login (bgates
          for Bill X. Gates). The workaround is to use the "isNew"
          condition, which evaluates to true if the expression in the
          mapping is processed for the new value (and not the old).<o:p></o:p></p>
        <p>I still need to understand if this workaround is the only
          way, or if you encountered a bug (or missing documentation
          which is also a bug). I remember, several years ago I used the
          same principle in one of my projects as you and it worked.<o:p></o:p></p>
        <p>I have just finished our MidPoint Customization and
          Deployment training course so I can't guarantee I have time to
          look at this in the couple of following (work) days. But I'm
          curious to find the better solution/answers. Until that,
          please try if the proposed workaround works for you. Thank
          you.<o:p></o:p></p>
        <p>Best regards,<o:p></o:p></p>
        <p>Ivan<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <p class="MsoNormal">On 05/16/2017 04:50 PM, BOSCHMANS Glenn
            wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif">Hi
              all,</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">Thanks for the information, but sadly still
              no luck. All I end up with is a shadow with a partial
              result that is in status fatal_error. I found this in the
              logs.</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">2017-05-16 15:40:04,072 []
              [midPointScheduler_Worker-3] ERROR
(com.evolveum.midpoint.model.impl.util.AbstractSearchIterativeResultHandler):
              Reconciliation of object
shadow:7a70d0e8-839f-473b-ade6-ce38c91f7895(62f64fd8-4807-4a3c-8c32-129d8df890d1)
              from
              <a
                href="resource:94f21f3e-89b6-4d93-8cbc-e1bfc9fa41dd%28External"
                moz-do-not-send="true">resource:94f21f3e-89b6-4d93-8cbc-e1bfc9fa41dd(External</a>
              Database Userstore) failed:
              java.lang.StringIndexOutOfBoundsException: String index
              out of range: 1 expression in mapping 'JIT Username
              generation' in
              objectTemplate:52f4ca67-2bea-4da9-b26b-bffbd852fa39(JIT
              Username generation)(givenName=null; familyName=null; ) in
              expression in mapping 'JIT Username generation' in
              objectTemplate:52f4ca67-2bea-4da9-b26b-bffbd852fa39(JIT
              Username generation)</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">So givenName and familyName are passed as
              null to the objectTemplate, but I don’t know why null is
              passed as those attributes have values in the database.
              I’ve probably forgotten to configure something, but I
              don’t know what it could be.</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">Here is a part of the schema handling on the
              resource. I left out the attributes that have nothing to
              do with the username.</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"><schemaHandling></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      <objectType></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <kind>account</kind></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <intent>default</intent></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <default>true</default></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">        
              <objectClass>ri:Account</objectClass></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <attribute></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <c:ref>icfs:uid</c:ref></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <displayName>UID</displayName></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <tolerant>true</tolerant></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <exclusiveStrong>false</exclusiveStrong></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         </attribute></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <attribute></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <c:ref>icfs:name</c:ref></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <tolerant>true</tolerant></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <exclusiveStrong>false</exclusiveStrong></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            <outbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <authoritative>true</authoritative></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <exclusive>false</exclusive></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <strength>normal</strength></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               <source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                 
              <c:path>$user/name</c:path></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               </source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            </outbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         </attribute></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <attribute></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <c:ref>ri:accountUsername</c:ref></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <tolerant>true</tolerant></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <exclusiveStrong>false</exclusiveStrong></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            <outbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <authoritative>true</authoritative></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <exclusive>false</exclusive></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <strength>normal</strength></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               <source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                 
              <c:path>$user/name</c:path></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               </source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            </outbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         </attribute></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <attribute></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <c:ref>ri:accountFirstName</c:ref></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <tolerant>true</tolerant></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <exclusiveStrong>false</exclusiveStrong></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            <outbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <authoritative>true</authoritative></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <exclusive>false</exclusive></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <strength>normal</strength></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               <source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                 
              <c:path>$user/givenName</c:path></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               </source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            </outbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            <inbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <authoritative>true</authoritative></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <exclusive>false</exclusive></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <strength>normal</strength></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               <target></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                 
              <c:path>$user/givenName</c:path></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               </target></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            </inbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         </attribute></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <attribute></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <c:ref>ri:accountLastName</c:ref></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <tolerant>true</tolerant></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <exclusiveStrong>false</exclusiveStrong></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            <outbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> 
                           <authoritative>true</authoritative></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <exclusive>false</exclusive></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <strength>normal</strength></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               <source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                 
              <c:path>$user/familyName</c:path></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               </source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            </outbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            <inbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <authoritative>true</authoritative></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <exclusive>false</exclusive></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">              
              <strength>normal</strength></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               <target></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                 
              <c:path>$user/familyName</c:path></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               </target></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            </inbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         </attribute></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">        
            </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <credentials></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            <password></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               <outbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                 
              <authoritative>true</authoritative></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                 
              <exclusive>false</exclusive></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                 
              <strength>normal</strength></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               </outbound></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            </password></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         </credentials></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      </objectType></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">   </schemaHandling></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">Here is a part of the synchronization (only
              unmatched):</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"><synchronization></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      <objectSynchronization></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <name>Sync External DB
              Userstore</name></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <kind>account</kind></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <intent>default</intent></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">        
              <focusType>c:UserType</focusType></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <enabled>true</enabled></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">        
              <reconcile>true</reconcile></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">        
            </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <reaction></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">           
              <situation>unmatched</situation></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            <objectTemplateRef
              oid="52f4ca67-2bea-4da9-b26b-bffbd852fa39"
              type="c:ObjectTemplateType"></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               <targetName></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                  <t:orig>JIT Username
              generation</t:orig></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                  <t:norm>jit username
              generation</t:norm></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               </targetName></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            </objectTemplateRef></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            <action></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">               <handlerUri><a
href="http://midpoint.evolveum.com/xml/ns/public/model/action-3#addFocus"
                moz-do-not-send="true">http://midpoint.evolveum.com/xml/ns/public/model/action-3#addFocus</a></handlerUri></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            </action></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         </reaction></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      </objectSynchronization></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">   </synchronization></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">And finally the mapping in the
              objectTemplate:</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"><mapping></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      <name>JIT Username
              generation</name></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      <strength>weak</strength></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      <source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">        
              <c:path>$user/givenName</c:path></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      </source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      <source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">        
              <c:path>$user/familyName</c:path></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      </source></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      <expression></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <script></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">            <code></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                                                              
              return
              basic.norm(basic.stringify(givenName)).substring(0,1) +
              basic.norm(basic.stringify(familyName))+ iterationToken</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">                                              
              </code></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         </script></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      </expression></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      <target></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">         <c:path>name</c:path></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">      </target></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US">   </mapping></span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:9.0pt;font-family:"Arial",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <div>
            <div style="border:none;border-top:solid #E1E1E1
              1.0pt;padding:3.0pt 0cm 0cm 0cm">
              <p class="MsoNormal"><b><span
                    style="mso-fareast-language:NL-BE" lang="EN-US">From:</span></b><span
                  style="mso-fareast-language:NL-BE" lang="EN-US">
                  midPoint [<a
                    href="mailto:midpoint-bounces@lists.evolveum.com"
                    moz-do-not-send="true">mailto:midpoint-bounces@lists.evolveum.com</a>]
                  <b>On Behalf Of </b>Ivan Noris<br>
                  <b>Sent:</b> maandag 15 mei 2017 20:33<br>
                  <b>To:</b> midPoint General Discussion<br>
                  <b>Subject:</b> Re: [midPoint] Generation of
                  $user/name on reconcilitation of new account</span><o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"> <o:p></o:p></p>
          <div>
            <div>
              <p class="MsoNormal">Hi Glenn,<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">the trick with object template from
                Roman and Gustav is one (probably best) possibility.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">I can imagine also something like
                this (not tested, but should work):<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><attribute><br>
                  <ref>icfs:name</ref><br>
                  <inbound><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">    <source><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">     
                <path>$account/accountUsername</path><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">    </source><o:p></o:p></p>
            </div>
            <div>
              <div>
                <p class="MsoNormal">    <source><o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">     
                  <path>$account/accountFirstname</path><o:p></o:p></p>
              </div>
              <p class="MsoNormal">    </source><o:p></o:p></p>
            </div>
            <div>
              <div>
                <p class="MsoNormal">    <source><o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">     
                  <path>$account/accountLastname</path><o:p></o:p></p>
              </div>
              <p class="MsoNormal">    </source><br>
                    <expression><br>
                      <script><br>
                        <code><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">if (!basic.isEmpty(accountUsername))
                {<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">  return accountUsername // return
                accountUsername if it's not null<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">} else {<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">  return accountFirstname + '.' +
                accountLastname // do whatever you need here<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">}<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">        </code><br>
                      </script><br>
                    </expression><br>
                    <target><br>
                      <path>$user/name</path><br>
                    </target><br>
                  </inbound><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"></attribute><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">The mapping is inbound for icfs:name,
                because for normal connector, that attribute will always
                exist.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">I don't know if you already have some
                inbound for that attribute, but you can have several
                (more than 1) inbounds for the same attribute.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">The question is if the mapping should
                also change the existing username in midPoint, if not,
                the mapping should be weak.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">Please note that this solution will <strong><span
                    style="font-family:"Calibri",sans-serif">not</span></strong>
                generate unique username in midPoint. For that you must
                use object template with iterators [1].<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">[1] <a
href="https://wiki.evolveum.com/display/midPoint/Unique+midPoint+User+Name"
                  moz-do-not-send="true">
https://wiki.evolveum.com/display/midPoint/Unique+midPoint+User+Name</a><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">Regards,<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">Ivan<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
            <div class="MsoNormal" style="text-align:center"
              align="center">
              <hr width="100%" size="2" align="center">
            </div>
            <blockquote style="border:none;border-left:solid #1010FF
              1.5pt;padding:0cm 0cm 0cm
              4.0pt;margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt">
              <p class="MsoNormal"><b><span
                    style="font-family:"Helvetica",sans-serif">From:
                  </span>
                </b><span
                  style="font-family:"Helvetica",sans-serif">"BOSCHMANS
                  Glenn" <<a href="mailto:gboschmans@cibg.brussels"
                    moz-do-not-send="true">gboschmans@cibg.brussels</a>><br>
                  <b>To: </b><a
                    href="mailto:midpoint@lists.evolveum.com"
                    moz-do-not-send="true">midpoint@lists.evolveum.com</a><br>
                  <b>Sent: </b>Monday, May 15, 2017 4:36:26 PM<br>
                  <b>Subject: </b>[midPoint] Generation of $user/name
                  on reconcilitation of new        account</span><o:p></o:p></p>
              <div>
                <p class="MsoNormal"><span
                    style="font-family:"Helvetica",sans-serif"> </span><o:p></o:p></p>
              </div>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">Hi all,</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">We are creating a new environment in
                  which midPoint will be used as IDM and WSO2 IS as IdP.
                  When a user registers in the IdP (through Just In
                  Time-provisioning with a federated IdP) this will be
                  based on their eID. A username is not created, and
                  thus not stored in the database userstore.
                </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">The next step is to add those users in
                  midPoint. We planned on doing reconciliation during
                  live synchronization. However, as the username is null
                  in the database, we don’t have a value for the
                  $user/name attribute and so the creation of the new
                  user fails.</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">Is there a possibility in the schema
                  handling to configure the first name and last name to
                  generate a username? For example:</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">accountFirstName: Glenn</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">accountLastName: Boschmans</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US"> </span><o:p></o:p></p>
              <p class="MsoNormal" style="margin-left:18.0pt"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">-> $user/name: gboschmans</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">I thought about using a Groovy script in
                  the inbound of accountUsername to see if the attribute
                  accountUsername is null. If not null return the value
                  of the accountUsername attribute. If it is null, then
                  I want to generate the username based on attributes
                  accountFirstName and accountLastName. However, I’m not
                  sure if it is possible to get the values of attributes
                  accountFirstName and accountLastName.
                </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">Any ideas?
                </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">Thanks in advance!</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">Best regards,</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="font-size:9.0pt;font-family:"Arial",sans-serif"
                  lang="EN-US">Glenn Boschmans</span><o:p></o:p></p>
              <div>
                <table class="MsoNormalTable" cellpadding="0" border="0">
                  <tbody>
                    <tr>
                      <td
                        style="width:229.5pt;border:none;border-right:solid
                        #FECB00 1.0pt;padding:.75pt .75pt .75pt .75pt"
                        width="306" valign="top">
                        <p class="MsoNormal"><span
                            style="font-size:12.0pt"><img
                              id="_x0000_i1026"
                              src="cid:part8.D27E2322.63BFD632@evolveum.com"
                              class="" width="300" height="101"
                              border="0"></span><o:p></o:p></p>
                      </td>
                      <td style="padding:.75pt .75pt .75pt .75pt"
                        valign="top">
                        <p><span class="titrecar"><b><span
                                style="font-size:15.0pt" lang="EN-US">Glenn
                                Boschmans</span></b></span><span
                            style="font-size:10.0pt;font-family:"Arial",sans-serif"><br>
                          </span><span class="MsoSubtleReference"><span
                              style="font-size:10.0pt" lang="EN-US">Consultant</span></span><span
style="font-size:10.0pt;font-family:"Arial",sans-serif"><br>
                          </span><span style="font-size:11.0pt"
                            lang="EN-US">Business Integrated Solutions </span>
                          <span
                            style="font-size:10.0pt;font-family:"Arial",sans-serif"><br>
                          </span><span
                            style="font-size:10.0pt;font-family:"Calibri
                            Light ,sans-serif",serif" lang="EN-US">Kunstlaan 21,
                            1000 Brussel -
                          </span><span
                            style="font-size:10.0pt;font-family:"Calibri
                            Light ,sans-serif",serif;color:#0080BF"
                            lang="EN-US"><a href="http://cibg.brussels"
                              target="_blank" moz-do-not-send="true"><span
                                style="color:#0080BF">cibg.brussels</span></a></span><span
style="font-size:10.0pt;font-family:"Calibri Light
                            ,sans-serif",serif" lang="EN-US"> - </span><span
style="font-size:10.0pt;font-family:"Calibri Light
                            ,sans-serif",serif;color:#0080BF"
                            lang="EN-US"><a
                              href="http://cibg.brussels/disclaimer-1"
                              target="_blank" moz-do-not-send="true"><span
                                style="color:#0080BF">disclaimer</span></a></span><span
style="font-size:10.0pt;font-family:"Arial",sans-serif"><br>
                          </span><span
                            style="font-size:10.0pt;font-family:"Calibri
                            Light ,sans-serif",serif" lang="EN-US">+32
                            2 282 47 70</span><span
                            style="font-size:10.0pt;font-family:"Calibri
                            Light ,sans-serif",serif;color:#FECB00"
                            lang="EN-US"> | </span><span
                            style="font-size:10.0pt;font-family:"Calibri
                            Light ,sans-serif",serif" lang="EN-US"> 
                            <br>
                          </span><span style="font-size:9.0pt"
                            lang="EN-US">Be green, leave it on the
                            screen !</span><span
                            style="font-size:10.0pt" lang="EN-US">                                                      
                          </span><span
                            style="font-size:10.0pt;font-family:"Calibri
                            Light ,sans-serif",serif" lang="EN-US"><a
href="http://www.linkedin.com/company/cirb_cibg" target="_blank"
                              moz-do-not-send="true"><span
                                style="text-decoration:none"><img
                                  id="_x0000_i1027"
                                  src="cid:part11.312377BC.590FBF34@evolveum.com"
                                  class="" width="22" height="19"
                                  border="0"></span></a>  <a
                              href="https://twitter.com/CIRB_CIBG"
                              target="_blank" moz-do-not-send="true"><span
                                style="text-decoration:none"><img
                                  id="_x0000_i1028"
                                  src="cid:part13.A9421F2D.BC98E084@evolveum.com"
                                  class="" width="19" height="19"
                                  border="0"></span></a>  <a
href="http://www.leefmilieu.brussels/themas/duurzame-stad/label-ecodynamische-onderneming"
                              target="_blank" moz-do-not-send="true"><span
                                style="text-decoration:none"><img
                                  id="_x0000_i1029"
                                  src="cid:part15.C3B8F882.0BEAC191@evolveum.com"
                                  class="" width="19" height="19"
                                  border="0"></span></a></span><o:p></o:p></p>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </div>
              <p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Helvetica",sans-serif;mso-fareast-language:NL-BE"><br>
                  _______________________________________________<br>
                  midPoint mailing list<br>
                  <a href="mailto:midPoint@lists.evolveum.com"
                    moz-do-not-send="true">midPoint@lists.evolveum.com</a><br>
                  <a
                    href="http://lists.evolveum.com/mailman/listinfo/midpoint"
                    moz-do-not-send="true">http://lists.evolveum.com/mailman/listinfo/midpoint</a></span><o:p></o:p></p>
            </blockquote>
            <div>
              <p class="MsoNormal" style="margin-bottom:12.0pt"><span
                  style="font-size:12.0pt"> </span><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:12.0pt"> </span><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:12.0pt">-- </span><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:12.0pt">Ivan
                  Noris<br>
                  Senior Identity Engineer<br>
                  evolveum.com</span><o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"><span
              style="font-size:12.0pt;font-family:"Times New
              Roman",serif;mso-fareast-language:NL-BE"><br>
              <br>
              <br>
              <o:p></o:p></span></p>
          <pre>_______________________________________________<o:p></o:p></pre>
          <pre>midPoint mailing list<o:p></o:p></pre>
          <pre><a href="mailto:midPoint@lists.evolveum.com" moz-do-not-send="true">midPoint@lists.evolveum.com</a><o:p></o:p></pre>
          <pre><a href="http://lists.evolveum.com/mailman/listinfo/midpoint" moz-do-not-send="true">http://lists.evolveum.com/mailman/listinfo/midpoint</a><o:p></o:p></pre>
        </blockquote>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman",serif;mso-fareast-language:NL-BE"><br>
            <br>
            <o:p></o:p></span></p>
        <pre>-- <o:p></o:p></pre>
        <pre>Ivan Noris<o:p></o:p></pre>
        <pre>Senior Identity Engineer<o:p></o:p></pre>
        <pre>evolveum.com<o:p></o:p></pre>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Ivan Noris
Senior Identity Engineer
evolveum.com
</pre>
  </body>
</html>