[midPoint] Re. Multi-valued properties

Deepak Natarajan dnataraj at trilobytesystems.com
Tue May 13 07:47:55 CEST 2014


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


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


More information about the midPoint mailing list