2 Replies Latest reply on Oct 17, 2013 1:25 PM by Eric Elzinga

    Dynamic variable in oracle service bus


      I have for-each loop in OSB. In this loop I am calling business service. I have to store response somewhere so that I can use it whenever i required.

      means suppose loop will run 3 times i have to store all three responses different place or different variable so that I can use it later.


      Please help me on this requirement. its urgent.

        • 1. Re: Dynamic variable in oracle service bus

          Define a schema for the result and a "list" type that is zero or many of the result types. You can then define a variable of the list type and add to it each time round the loop:




          You can get fancier, adding in metadata about which loop the result came from but that should cover you for a wide variety of needs.



          • 2. Re: Dynamic variable in oracle service bus
            Eric Elzinga

            you could do something like this


            assign <resultlist/> to variable $myList

            then in the looping use the insert activity to do something like

            expression = <myresultelement>

            location=as first child of resultlist

            xpath = ./*

            in variable = .resultlist



            in the looping do something like :

            replace ./* in variable mylist with concat(mylist,'<newresultelement>eee</newresultelement>')


            after the looping you will have something like this







            then do another replace/assing with


            ./* in mylist with <resultlist>{$mylist}</resultlist>

            now we also have the root-element for the list



            so..just some thoughts on how to achieve it