How can i read the array  using a loop in WSO2 ESB?

below example shows how to read an array by giving the index.

expression="fn:tokenize(syn:get-property('operation','myArray'),'\s')[1]"


steps I followed

  <payloadFactory media-type="json">
                    <format>{
                                           "userIdentifier": 
["tel:+00123456789","tel:+00123456789"]
                      }</format>

                </payloadFactory>
                <property expression="//userIdentifier" name="myArray"
                    scope="default" type="STRING"/>

                <iterate continueParent="true"
                    expression="//userIdentifier" sequential="true">
                    <target>
                        <sequence>
                            <property
                                
expression="fn:concat(get-property('operation','myArray'),//userIdentifier,' ')"
                                name="myArray" scope="operation" type="STRING"/>
                        </sequence>
                    </target>
                </iterate>
                <property
                    
expression="fn:tokenize(syn:get-property('operation','myArray'),'\s')[1]"
                    name="messageid" scope="default" type="STRING" 
xmlns:fn="http://www.w3.org/2005/xpath-functions"/>




Regards,
S.Senthuran



_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to