<div dir="ltr">Hi Kari,<div><br></div><div>as Ivan said there is only one iteration token in midpoint.</div><div><br></div><div>You can write script in expression in mapping which generates the email address. Something like this:</div><div><br></div><div><div>boolean unique = midpoint.isUniquePropertyValue(user, "emailAddress", resultAddress);</div><div>                    //<a href="http://log.info">log.info</a>("resultAddress" + resultAddress+ " isUnique " + unique);</div><div>                    while (!unique) {</div><div>                        customIterationToken = customIterationToken + 1;</div><div>                        resultAddress= primalResultName + customIterationToken;</div><div>                        polyStringResult = new PolyString(resultAddress);</div><div>                        unique = midpoint.isUniquePropertyValue(user, "emailAddress", resultAddress);</div><div>                        //<a href="http://log.info">log.info</a>("resultAddress" + resultAddress+ " isUnique " + unique);</div><div>                    }</div></div><div><br></div><div>Best Regards</div><div><br></div><div>Oskar Butovič</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-04-04 20:48 GMT+02:00 Ivan Noris <span dir="ltr"><<a href="mailto:ivan.noris@evolveum.com" target="_blank">ivan.noris@evolveum.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <p>Hi Kari,</p>
    <p>from what I know I think we have just one iteration token for
      whole User object for now. I think this issue may be for tracking
      this feature: <a class="m_-8306385833584349750moz-txt-link-freetext" href="https://jira.evolveum.com/browse/MID-1977" target="_blank">https://jira.evolveum.com/<wbr>browse/MID-1977</a>
      ("sponsoring needed").<br>
    </p>
    <p>You can have validation for any attribute to be unique in the
      object template, but unless someone corrects me, the iteration
      token is just one per user. (Schema suggests so as well.)</p>
    <p>Regards,</p>
    <p>Ivan<br>
    </p><div><div class="h5">
    <br>
    <div class="m_-8306385833584349750moz-cite-prefix">On 04/04/2017 02:06 PM, Kari Heikkilä
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      
      
      
      <div class="m_-8306385833584349750WordSection1">
        <p class="MsoNormal">Hello,<u></u><u></u></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal"><span lang="EN-US">setting up midPoint and
            phasing difficulties on username + email address generation.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">I have had (unique)
            username generation working nicely (using iteration feature.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">I need also generate
            unique primary email address for the new user.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Our policies for
            usernames  and email addresses  are such that username and
            email address may need different amount of iteration cycles
            to achieve uniqueness,<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">like username needing
            two cycles and email address only one cycle.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">My problem now is that I
            seem to get only one iteration loop and iterations are stop
            after both are found to be unique.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Templates generation
            these are launched from resource synchronization unmatched
            situation.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Is it possible to
            generate unique username and email address on separate
            loops?<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">If yes any pointers to
            documentation are welcome.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Best regards,<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Kari<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">--<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Qvantel Finland<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">System developer –
            integrations<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u><u></u></span></p>
      </div>
      <br>
      <fieldset class="m_-8306385833584349750mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><pre>______________________________<wbr>_________________
midPoint mailing list
<a class="m_-8306385833584349750moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a class="m_-8306385833584349750moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre class="m_-8306385833584349750moz-signature" cols="72">-- 
Ivan Noris
Senior Identity Engineer
<a href="http://evolveum.com" target="_blank">evolveum.com</a>
</pre>
  </font></span></div>

<br>______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><table style="font-family:Verdana,Arial,Helvetica,sans-serif;border-collapse:collapse;padding:0px;margin:0px;border-width:0px!important;border-style:solid!important;width:482px!important"><tbody><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:160px;vertical-align:bottom;padding:0px;border:0px solid gray!important"><p><span style="font-size:14px;font-weight:bold">Oskar Butovič</span><br>solution architect<br><br>gsm: [+420] 774 480 101<br>e-mail: <a href="mailto:oskar.butovic@ami.cz" target="_blank">oskar.butovic@ami.cz</a></p></td><td style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;border-right-width:1px;border-right-style:solid;border-right-color:rgb(204,204,204);padding:0px;border-top-width:0px!important;border-bottom-width:0px!important;border-left-width:0px!important;border-top-style:solid!important;border-bottom-style:solid!important;border-left-style:solid!important;border-top-color:gray!important;border-bottom-color:gray!important;border-left-color:gray!important">   </td><td style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;border:0px solid gray!important">   </td><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;vertical-align:bottom;padding:0px;width:123px;border:0px solid gray!important"><p>AMI Praha a.s.<br>Pláničkova 11<br>162 00 Praha 6<br>tel.: [+420] 274 783 239<br>web: <a href="http://www.ami.cz/" target="_blank">www.ami.cz</a></p></td><td style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;border-right-width:1px;border-right-style:solid;border-right-color:rgb(204,204,204);padding:0px;border-top-width:0px!important;border-bottom-width:0px!important;border-left-width:0px!important;border-top-style:solid!important;border-bottom-style:solid!important;border-left-style:solid!important;border-top-color:gray!important;border-bottom-color:gray!important;border-left-color:gray!important">   </td><td style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;border:0px solid gray!important">   </td><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;margin:8px;border:0px solid gray!important;width:116px"><p><img src="http://www.ami.cz/images/podpis/ami_logo.gif" alt="AMI Praha a.s." style="border:0px"></p></td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td colspan="7" style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;width:480px;border:0px solid gray!important"><br><a href="http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management" target="_blank"><img src="http://www.ami.cz/images/podpis/AMI-podpis-IdM_1.png" alt="AMI Praha a.s." style="border:0px;width:480px!important;height:82px!important"></a></td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td colspan="7" style="color:rgb(128,128,128);font-family:Arial,sans-serif;font-size:11px;padding:0px;border:0px solid gray!important"><br>Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za společnost AMI Praha a.s.<br>jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně písemnou formu.<br><br></td></tr></tbody></table></div></div></div></div></div></div></div>
</div>