<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Deepak,<br>
      <br>
      Pavol is right you need to return a List object luckily groovy has
      the tokenize operation which will do exactly that, I'm using the
      below in one of my connectors sucessfully:<br>
      <br>
       <inbound><br>
                              <strength>strong</strength><br>
                              <expression><br>
                              <script><br>
                                 
<language><a class="moz-txt-link-freetext" href="http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy">http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</a></language><br>
                                  <code><br>
                                          if (!basic.isEmpty(input))<br>
                                          {<br>
                                              input.tokenize(",");<br>
                                          }<br>
                                  </code><br>
                              </script><br>
                              </expression><br>
                              <target><br>
                                 
      <path>$user/extension/pid:foo</path><br>
                              </target><br>
      <br>
                          </inbound><br>
      <br>
      Cheers<br>
      Paul<br>
      <br>
      On 13/05/14 08:31, Pavol Mederly wrote:<br>
    </div>
    <blockquote cite="mid:5371CA4A.70201@evolveum.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Hello Deepak,<br>
        <br>
        although I'm not very familiar with groovy, your script seems to
        return not a List, but an array (of strings).<br>
        Please convert it to the java.util.List (or any Collection)
        before returning the value to midPoint.<br>
        <br>
        Best regards,<br>
        Pavol<br>
        <br>
        <br>
        On 13. 5. 2014 7:47, Deepak Natarajan wrote:<br>
      </div>
      <blockquote cite="mid:5371B20B.6090903@trilobytesystems.com"
        type="cite">
        <meta http-equiv="content-type" content="text/html;
          charset=ISO-8859-1">
        <br>
        Hi Everyone -<br>
        <br>
        I have extended my Midpoint schema with a  custom multi-valued
        property like so :<br>
        <br>
                    <xsd:element name="foo" type="xsd:string"
        minOccurs="0" maxOccurs="unbounded"><br>
                        <xsd:annotation><br>
                            <xsd:appinfo><br>
                                <a:indexed>true</a:indexed><br>
                            </xsd:appinfo><br>
                        </xsd:annotation><br>
                    </xsd:element><br>
        <br>
        How do I populate this from with an inbound mapping?<br>
        <br>
        When I do :<br>
        <br>
                        <attribute><br>
                            <ref>ri:resourceFoo</ref><br>
                            <inbound><br>
                                <expression><br>
                                    <script><br>
                                        <code><br>
                                                return
        resourceFoo.split(',')<br>
                                        </code><br>
                                    </script><br>
                                </expression><br>
                                <target><br>
                                   
        <path>$user/extension/apos:foo</path><br>
                                </target><br>
                            </inbound><br>
                        </attribute><br>
        <br>
        I get the error :<br>
        <span style="font-weight: bold;">Caused by:
          java.lang.IllegalArgumentException: Expected class
          java.lang.String type, but got class [Ljava.lang.String;</span><br>
                at
        com.evolveum.midpoint.prism.util.JavaTypeConverter.convert(JavaTypeConverter.java:240)


        ~[prism-2.3-SNAPSHOT.jar:na]<br>
                at
        com.evolveum.midpoint.model.common.expression.ExpressionUtil.convertValue(ExpressionUtil.java:178)


        ~[model-common-2.3-SNAPSHOT.jar:na]<br>
                at
        com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.convertScalarResult(Jsr223ScriptEvaluator.java:184)


        ~[model-common-2.3-SNAPSHOT.jar:na]<br>
                ... 54 common frames omitted<br>
        <br>
        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..)<br>
        <br>
        Thank you!<br>
        <br>
        BR/<br>
        <div class="moz-signature">-- <br>
          Deepak Natarajan<br>
          <br>
          <br>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
midPoint mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>