[midPoint] Re. Multi-valued properties

Pavol Mederly mederly at evolveum.com
Tue May 13 09:31:22 CEST 2014


Hello Deepak,

although I'm not very familiar with groovy, your script seems to return 
not a List, but an array (of strings).
Please convert it to the java.util.List (or any Collection) before 
returning the value to midPoint.

Best regards,
Pavol


On 13. 5. 2014 7:47, Deepak Natarajan wrote:
>
> Hi Everyone -
>
> I have extended my Midpoint schema with a  custom multi-valued 
> property like so :
>
>             <xsd:element name="foo" type="xsd:string" minOccurs="0" 
> maxOccurs="unbounded">
>                 <xsd:annotation>
>                     <xsd:appinfo>
>                         <a:indexed>true</a:indexed>
>                     </xsd:appinfo>
>                 </xsd:annotation>
>             </xsd:element>
>
> How do I populate this from with an inbound mapping?
>
> When I do :
>
>                 <attribute>
>                     <ref>ri:resourceFoo</ref>
>                     <inbound>
>                         <expression>
>                             <script>
>                                 <code>
>                                         return resourceFoo.split(',')
>                                 </code>
>                             </script>
>                         </expression>
>                         <target>
> <path>$user/extension/apos:foo</path>
>                         </target>
>                     </inbound>
>                 </attribute>
>
> I get the error :
> Caused by: java.lang.IllegalArgumentException: Expected class 
> java.lang.String type, but got class [Ljava.lang.String;
>         at 
> com.evolveum.midpoint.prism.util.JavaTypeConverter.convert(JavaTypeConverter.java:240) 
> ~[prism-2.3-SNAPSHOT.jar:na]
>         at 
> com.evolveum.midpoint.model.common.expression.ExpressionUtil.convertValue(ExpressionUtil.java:178) 
> ~[model-common-2.3-SNAPSHOT.jar:na]
>         at 
> com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.convertScalarResult(Jsr223ScriptEvaluator.java:184) 
> ~[model-common-2.3-SNAPSHOT.jar:na]
>         ... 54 common frames omitted
>
> I have tested my groovy snipped and I'm assuming if it returns a List 
> (as indicated in the stack trace), it would be handled by Midpoint. I 
> couldn't find an example (maybe I missed this..)
>
> Thank you!
>
> BR/
> -- 
> Deepak Natarajan
>
>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20140513/7f8fb7eb/attachment.htm>


More information about the midPoint mailing list