Hi, You can use for each mediator. This is used for similar scenarios.
[1] https://docs.wso2.com/display/ESB490/ForEach+Mediator On Mon, May 16, 2016 at 4:33 PM, Senthuran Sangarapillai < [email protected]> wrote: > 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 > > -- Best Regards, Malaka Silva Senior Tech Lead M: +94 777 219 791 Tel : 94 11 214 5345 Fax :94 11 2145300 Skype : malaka.sampath.silva LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77 Blog : http://mrmalakasilva.blogspot.com/ WSO2, Inc. lean . enterprise . middleware http://www.wso2.com/ http://www.wso2.com/about/team/malaka-silva/ <http://wso2.com/about/team/malaka-silva/> https://store.wso2.com/store/ Save a tree -Conserve nature & Save the world for your future. Print this email only if it is absolutely necessary.
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
