<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000"><br>
Yes! This was the issue, thanks guys!<br>
<br>
BR/Deepak<br>
<br>
<blockquote style="border: 0px none;" 
cite="mid:5371CC73.2040803@pheaney.co.uk" 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="lists@pheaney.co.uk" photoname="Paul Heaney" 
src="cid:part1.04010600.05090503@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:lists@pheaney.co.uk" 
style="color:#737F92 
!important;padding-right:6px;font-weight:bold;text-decoration:none 
!important;">Paul Heaney</a></div>   <div 
style="display:table-cell;white-space:nowrap;vertical-align:middle;">   
  <font color="#9FA2A5"><span style="padding-left:6px">May 13, 2014 at 
10:40 AM</span></font></div></div></div>
  <div style="color:#888888;margin-left:24px;margin-right:24px;" 
__pbrmquotes="true" class="__pbConvBody">
  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  
    <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 moz-do-not-send="true" 
href="http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy"
 class="moz-txt-link-freetext">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>
    
    <br>
  <div>_______________________________________________<br>midPoint 
mailing list<br><a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br><a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br></div></div>
  <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="mederly@evolveum.com" photoname="Pavol Mederly" 
src="cid:part1.04010600.05090503@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:mederly@evolveum.com" 
style="color:#737F92 
!important;padding-right:6px;font-weight:bold;text-decoration:none 
!important;">Pavol Mederly</a></div>   <div 
style="display:table-cell;white-space:nowrap;vertical-align:middle;">   
  <font color="#9FA2A5"><span style="padding-left:6px">May 13, 2014 at 
10:31 AM</span></font></div></div></div>
  <div style="color:#888888;margin-left:24px;margin-right:24px;" 
__pbrmquotes="true" class="__pbConvBody">
  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  
    <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>
    
    <br>
  <div>_______________________________________________<br>midPoint 
mailing list<br><a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br><a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br></div></div>
  <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.04010600.05090503@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">May 13, 2014 at 
8:47 AM</span></font></div></div></div>
  <div style="color:#888888;margin-left:24px;margin-right:24px;" 
__pbrmquotes="true" class="__pbConvBody">
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
  <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>
</blockquote>
<br>
<div class="moz-signature">-- <br>Deepak Natarajan<br>


<br>


Trilobyte Systems ApS<br>


Falkoner Alle 1, 3<br>


2000 Frederiksberg<br>


Denmark<br>


+45 29375068<br>


<br>


</div>
</body></html>