<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000"><br>
Hi Ivan -<br>
<br>
Thanks - yes, this is the first time I am trying using the script var in
 inbound mappings as well - apparently Midpoint doesn't like it - so I 
will have to do it in a template (like in your previous examples). I was
 already setting the user name in an inbound expression - just needed 
the iteration token to resolve conflicts. <br>
<br>
I already have your example - I was just trying to move it into the 
schema handling, rather than the object template, so I'll just do it 
like you did.<br>
<br>
Thanks!<br>
<br>
BR/Deepak<br>
<br>
<blockquote style="border: 0px none;" 
cite="mid:53B29BA5.2080101@evolveum.com" type="cite">
  <div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div 
style="display:table;width:100%;border-top:1px solid 
#EDEEF0;padding-top:5px">       <div 
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
 photoaddress="ivan.noris@evolveum.com" photoname="Ivan Noris" 
src="cid:part1.03000709.05020504@trilobytesystems.com" 
name="compose-unknown-contact.jpg" height="25px" width="25px"></div>   <div
 
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
        <a moz-do-not-send="true" href="mailto:ivan.noris@evolveum.com" 
style="color:#737F92 
!important;padding-right:6px;font-weight:bold;text-decoration:none 
!important;">Ivan Noris</a></div>   <div 
style="display:table-cell;white-space:nowrap;vertical-align:middle;">   
  <font color="#9FA2A5"><span style="padding-left:6px">July 1, 2014 at 
2:29 PM</span></font></div></div></div>
  <div style="color:#888888;margin-left:24px;margin-right:24px;" 
__pbrmquotes="true" class="__pbConvBody">
  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  
    Hi Deepak,<br>
    <br>
    just a note from a practice: I've never used iterations on inbound.
    But you can use them in object template to generate (for example)
    unique user/name property.<br>
    <br>
    So in a few words, you would not set user/name from inbound
    expressions, but you would compute it from object template.<br>
    <br>
    I believe I've dropped some example to the list before, if not, I
    can drop one later today if you're interested.<br>
    <br>
    Regards<br>
    <br>
    Ivan<br>
    <br>
    <div class="moz-cite-prefix">On 07/01/2014 12:41 PM, Deepak
      Natarajan wrote:<br>
    </div>
    
    <br>
    <div>-- <br>  Ing. Ivan Noris<br>  Senior Identity Management 
Engineer<br>  evolveum.com<br>  
___________________________________________<br>           "Idem per idem
 - semper idem Vix."<br></div>
  <div>_______________________________________________<br>midPoint 
mailing list<br><a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br><a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br></div></div>
  <div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div 
style="display:table;width:100%;border-top:1px solid 
#EDEEF0;padding-top:5px">       <div 
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
 photoaddress="dnataraj@trilobytesystems.com" photoname="Deepak 
Natarajan" src="cid:part1.03000709.05020504@trilobytesystems.com" 
name="compose-unknown-contact.jpg" height="25px" width="25px"></div>   <div
 
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
        <a moz-do-not-send="true" 
href="mailto:dnataraj@trilobytesystems.com" style="color:#737F92 
!important;padding-right:6px;font-weight:bold;text-decoration:none 
!important;">Deepak Natarajan</a></div>   <div 
style="display:table-cell;white-space:nowrap;vertical-align:middle;">   
  <font color="#9FA2A5"><span style="padding-left:6px">July 1, 2014 at 
1:41 PM</span></font></div></div></div>
  <div style="color:#888888;margin-left:24px;margin-right:24px;" 
__pbrmquotes="true" class="__pbConvBody">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<br>
Hmmm. Looking at the documentation again, it seems inbound mappings are 
mentioned nowhere.<br>
<br>
Are these iteration tokens only valid for outbound mappings (i.e should I
 move this usage on inbound mappings to a user creation template?)<br>
<br>
Why is this so....? <br>
<br>

<br>

  </div>
  <div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div 
style="display:table;width:100%;border-top:1px solid 
#EDEEF0;padding-top:5px">       <div 
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
 photoaddress="dnataraj@trilobytesystems.com" photoname="Deepak 
Natarajan" src="cid:part1.03000709.05020504@trilobytesystems.com" 
name="compose-unknown-contact.jpg" height="25px" width="25px"></div>   <div
 
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
        <a moz-do-not-send="true" 
href="mailto:dnataraj@trilobytesystems.com" style="color:#737F92 
!important;padding-right:6px;font-weight:bold;text-decoration:none 
!important;">Deepak Natarajan</a></div>   <div 
style="display:table-cell;white-space:nowrap;vertical-align:middle;">   
  <font color="#9FA2A5"><span style="padding-left:6px">July 1, 2014 at 
1:37 PM</span></font></div></div></div>
  <div style="color:#888888;margin-left:24px;margin-right:24px;" 
__pbrmquotes="true" class="__pbConvBody"><div>Hi -<br><br>I'm trying to 
formulate unique uid's for the user on an inbound mapping.<br>I am using
 iterationToken (I am using a snippet from one of Ivan's<br>examples).<br><br>This
 is my attribute mapping<br><br>                <attribute><br>   
                 <ref>icfs:name</ref><br>                   
 <limitations><br>                        
<minOccurs>0</minOccurs><br>                        
<access><br>                            
<read>true</read><br>                            
<add>true</add><br>                            
<modify>true</modify><br>                        
</access><br>                    </limitations><br>         
           <inbound><br>                        
<c:expression><br>                            <c:script><br>
                                <c:code><br>                      
              input + '-apos' + iterationToken<br>                      
          </c:code><br>                            
</c:script><br>                        </c:expression><br>  
                      <target><br>                            
<path>$user/name</path><br>                        
</target><br>                    </inbound><br>             
   </attribute><br><br>followed by the iteration definition :<br><br>
                <iteration><br>                    
<maxIterations>999</maxIterations><br>                    
<tokenExpression><br>                        <script><br>   
                         <code><br>                               
 if (iteration == 0) {<br>                                    return "";<br>
                                } else {<br>                            
        return "" + (iteration + 1)<br>                                }<br>
                            </code><br>                        
</script><br>                    </tokenExpression><br>     
           </iteration><br><br>I am getting the following 
exception, when I import users :<br><br>Caused by:<br>com.evolveum.midpoint.util.exception.ExpressionEvaluationException:<br>groovy.lang.MissingPropertyException:
 No such property: iterationToken<br>for class: Script17 expression in 
mapping in inbound expression for<br>{<a class="moz-txt-link-freetext" href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>}name<br>in
 <a class="moz-txt-link-freetext" href="resource:036f0100-2fe8-49e1-a8fd-5548374f8703(APOS">resource:036f0100-2fe8-49e1-a8fd-5548374f8703(APOS</a> CSV Feeder<br>Resource
 Definition)<br>        at<br>com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:124)<br>~[model-common-3.0.jar:na]<br>
        at<br>com.evolveum.midpoint.model.common.expression.script.ScriptExpression.evaluate(ScriptExpression.java:108)<br>~[model-common-3.0.jar:na]<br>
        at<br>com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluator.transformSingleValue(ScriptExpressionEvaluator.java:58)<br>~[model-common-3.0.jar:na]<br>
        at<br>com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator$1.process(AbstractValueTransformationExpressionEvaluator.java:420)<br>~[model-common-3.0.jar:na]<br>
        ... 50 common frames omitted<br>Caused by: 
javax.script.ScriptException:<br>groovy.lang.MissingPropertyException: 
No such property: iterationToken<br>for class: Script17<br>        at<br>org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:323)<br>~[groovy-1.8.6.jar:1.8.6]<br>
        at<br>org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41)<br>~[groovy-1.8.6.jar:1.8.6]<br>
        at javax.script.CompiledScript.eval(CompiledScript.java:92)<br>~[na:1.7.0_45]<br>
        at<br>com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:122)<br>~[model-common-3.0.jar:na]<br>
        ... 53 common frames omitted<br>Caused by: 
groovy.lang.MissingPropertyException: No such property:<br>iterationToken
 for class: Script17<br>        at<br>org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)<br>~[groovy-1.8.6.jar:1.8.6]<br>
        at<br>org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)<br>~[groovy-1.8.6.jar:1.8.6]<br>
        at<br>org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)<br>~[groovy-1.8.6.jar:1.8.6]<br>
        at Script17.run(Script17.groovy:2) ~[na:na]<br>        at<br>org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320)<br>~[groovy-1.8.6.jar:1.8.6]<br>
        ... 56 common frames omitted<br><br>I seem to be following the 
general guidelines here :<br><a class="moz-txt-link-freetext" href="https://wiki.evolveum.com/display/midPoint/Unique+Account+Username+HOWTO">https://wiki.evolveum.com/display/midPoint/Unique+Account+Username+HOWTO</a><br><br>Am
 I missing something?<br><br>Thanks in advance -<br>BR/Deepak<br><br><br><br><br></div></div>
</blockquote>
<br>
<div class="moz-signature">-- <br>Deepak Natarajan<br>



Director<br>
<br>



Trilobyte Systems ApS<br>
<br>
Falkoner Alle 1, 3            Frederikinkatu 61A, 6th Floor<br>



2000 Frederiksberg         Business Center Papula<br>



Denmark            
              
00100 Helsinki<br>
            
            
            
    Finland<br>
<br>
Tel : +45 29375068<br>
<a class="moz-txt-link-freetext" href="http://www.trilobytesystems.com">http://www.trilobytesystems.com</a><br>
<br>



<br>



</div>
</body></html>