[midPoint] No such property: iterationToken

Ivan Noris ivan.noris at evolveum.com
Tue Jul 1 13:29:41 CEST 2014


Hi Deepak,

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.

So in a few words, you would not set user/name from inbound expressions,
but you would compute it from object template.

I believe I've dropped some example to the list before, if not, I can
drop one later today if you're interested.

Regards

Ivan

On 07/01/2014 12:41 PM, Deepak Natarajan wrote:
>
> Hmmm. Looking at the documentation again, it seems inbound mappings
> are mentioned nowhere.
>
> Are these iteration tokens only valid for outbound mappings (i.e
> should I move this usage on inbound mappings to a user creation template?)
>
> Why is this so....?
>
>> Deepak Natarajan <mailto:dnataraj at trilobytesystems.com>
>> July 1, 2014 at 1:37 PM
>> Hi -
>>
>> I'm trying to formulate unique uid's for the user on an inbound mapping.
>> I am using iterationToken (I am using a snippet from one of Ivan's
>> examples).
>>
>> This is my attribute mapping
>>
>> <attribute>
>> <ref>icfs:name</ref>
>> <limitations>
>> <minOccurs>0</minOccurs>
>> <access>
>> <read>true</read>
>> <add>true</add>
>> <modify>true</modify>
>> </access>
>> </limitations>
>> <inbound>
>> <c:expression>
>> <c:script>
>> <c:code>
>> input + '-apos' + iterationToken
>> </c:code>
>> </c:script>
>> </c:expression>
>> <target>
>> <path>$user/name</path>
>> </target>
>> </inbound>
>> </attribute>
>>
>> followed by the iteration definition :
>>
>> <iteration>
>> <maxIterations>999</maxIterations>
>> <tokenExpression>
>> <script>
>> <code>
>> if (iteration == 0) {
>> return "";
>> } else {
>> return "" + (iteration + 1)
>> }
>> </code>
>> </script>
>> </tokenExpression>
>> </iteration>
>>
>> I am getting the following exception, when I import users :
>>
>> Caused by:
>> com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
>> groovy.lang.MissingPropertyException: No such property: iterationToken
>> for class: Script17 expression in mapping in inbound expression for
>> {http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3}name
>> in resource:036f0100-2fe8-49e1-a8fd-5548374f8703(APOS CSV Feeder
>> Resource Definition)
>> at
>> com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:124)
>> ~[model-common-3.0.jar:na]
>> at
>> com.evolveum.midpoint.model.common.expression.script.ScriptExpression.evaluate(ScriptExpression.java:108)
>> ~[model-common-3.0.jar:na]
>> at
>> com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluator.transformSingleValue(ScriptExpressionEvaluator.java:58)
>> ~[model-common-3.0.jar:na]
>> at
>> com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator$1.process(AbstractValueTransformationExpressionEvaluator.java:420)
>> ~[model-common-3.0.jar:na]
>> ... 50 common frames omitted
>> Caused by: javax.script.ScriptException:
>> groovy.lang.MissingPropertyException: No such property: iterationToken
>> for class: Script17
>> at
>> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:323)
>> ~[groovy-1.8.6.jar:1.8.6]
>> at
>> org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41)
>> ~[groovy-1.8.6.jar:1.8.6]
>> at javax.script.CompiledScript.eval(CompiledScript.java:92)
>> ~[na:1.7.0_45]
>> at
>> com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:122)
>> ~[model-common-3.0.jar:na]
>> ... 53 common frames omitted
>> Caused by: groovy.lang.MissingPropertyException: No such property:
>> iterationToken for class: Script17
>> at
>> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
>> ~[groovy-1.8.6.jar:1.8.6]
>> at
>> org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
>> ~[groovy-1.8.6.jar:1.8.6]
>> at
>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
>> ~[groovy-1.8.6.jar:1.8.6]
>> at Script17.run(Script17.groovy:2) ~[na:na]
>> at
>> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320)
>> ~[groovy-1.8.6.jar:1.8.6]
>> ... 56 common frames omitted
>>
>> I seem to be following the general guidelines here :
>> https://wiki.evolveum.com/display/midPoint/Unique+Account+Username+HOWTO
>>
>> Am I missing something?
>>
>> Thanks in advance -
>> BR/Deepak
>>
>>
>>
>>
>
> -- 
> Deepak Natarajan
> Director
>
> Trilobyte Systems ApS
>
> Falkoner Alle 1, 3            Frederikinkatu 61A, 6th Floor
> 2000 Frederiksberg         Business Center Papula
> Denmark                          00100 Helsinki
>                                         Finland
>
> Tel : +45 29375068
> http://www.trilobytesystems.com
>
>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-- 
  Ing. Ivan Noris
  Senior Identity Management Engineer
  evolveum.com
  ___________________________________________
           "Idem per idem - semper idem Vix."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20140701/b6e7fb2a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose-unknown-contact.jpg
Type: image/jpeg
Size: 770 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20140701/b6e7fb2a/attachment.jpg>


More information about the midPoint mailing list