<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000"><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>
<blockquote style="border: 0px none;"
cite="mid:53B28F7B.3010502@trilobytesystems.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="dnataraj@trilobytesystems.com" photoname="Deepak
Natarajan" src="cid:part1.04030504.02020407@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>