5 Replies Latest reply on Jul 12, 2018 1:28 PM by Scott Nelson

    How to handle input of List of Object list in a process Service Call Step?

    New Member

      Hi

       

      I have created a service connector with WSDL having an Array of Object. I created a Process object equivalent to the Array of object.When I create my process, I have defined the Input field as List of Object list and in my service call step i am not sure how I need to handle this field in the input tab. For eg I have the array defined in my request -

       

      <links>

                  <link>

                     <entityType>Sample Entity Type</entityType>

                     <entityHccId> 1234</entityHccId>

                     <operation>Add</operation>

                  </link>

                   <link>

                     <entityType>Entity type 2</entityType>

                     <entityHccId>5687</entityHccId>

                     <operation>Add</operation>

                  </link>

               </links>

       

      I am attaching the screenshot where I Am not quite sure how to handle the above. When I test my PROCESS through postman for the SWAGGER URL, it doesn't seem to take the array of link when i pass the JSON request . But it is able to get the other regular input fields. Appreciate any help on this.

        • 1. Re: How to handle input of List of Object list in a process Service Call Step?
          Scott Nelson Guru

          Hi Sitaraman,

           

           

          The description isn't clear whether you are trying to pass an array to the service connector or assign an array returned by the service.

           

          If you are trying to pass an array, see 500672  for a good explanation.

           

          If you are trying assign a returned array to a list of Process Objects, see 478024 .

           

          In the latter scenario, it is important to make sure the return value is configured properly in your service connector to format the response in a way your process can handle it.

           

          HTH

           

          Scott S Nelson

          1 of 1 people found this helpful
          • 2. Re: How to handle input of List of Object list in a process Service Call Step?
            New Member

            @

            Hi Scott

             

             

             

            Thanks for y our response. I am trying to pass a multi dimensional array to the service connector. I was able to resolve the issue using the following.

             

             

             

            • Created two process objects in Service connector - links and link. link has the three attribute/fields defined and links has object list reference to link
            • In the input tab, i defined links as object list of links (list of links)
            • In the binding tab - body, I included two for loops to loop through the main <links> tab and the child <link> tab based on the object list $links and $links/link@
            • In the process, Field definition I defined links as object list of links and in the service call step, i used formula - $input.links for the service connector input field - links
            • This resolved my issue.

             

            What i did wrong earlier was

             

             

             

            1. Instead of using the process object defined within service connector, i created global process object and used that in Process and in the service connector i defined the field as Object list of "Any"
            2. I also tried to define the field in service connector as object list of "links" that was defined within the service connector. This obviously was wrong since the global process object will never be equal to the process object within my service connector (Thats my understanding)
            3. I initially configured my process and service connector with the process object created within the service connector. But when i looked into the SWAGGER URL after the process got published, i found that the field links was defined as string array. This made me think that i should not have used the object defined within service connector but i need to create separate process object outside the service connector. This is the point where i went wrong and it never worked. I am very new to Informatica cloud and ICRT, hence i was  experimenting a lot.

             

             

            Thanks

            Sitaram

             

             

             

            I hope my explanation is clear and would help someone else who would be facing the same issue in future. @ScottNelso

            1 of 1 people found this helpful
            • 3. Re: How to handle input of List of Object list in a process Service Call Step?
              shobhan Kumar New Member

              Hi Sitaram

               

              Can you please provide the Binding code snippet where you formed 2 'for' loops for the main <links> tab and the child <link> tab

               

              Regards

              Shobhan

              • 4. Re: How to handle input of List of Object list in a process Service Call Step?
                Thomas Righele Seasoned Veteran

                I am having some trouble with this too. Can someone post a binding code example with a for loop? Must it be in a "content" or "Xquery" format?

                 

                -Tom

                • 5. Re: How to handle input of List of Object list in a process Service Call Step?
                  Scott Nelson Guru

                  Depends on what you want to do with your list. Using an Xquery for loop works in lots of situations. If you need to do several things or do something to something other than your list for each item in your list you would have a sub-process that takes the object as an argument and then call it on each object in your list. In some case you would use the List functions of Xquery.

                   

                  There are a few examples on this support network. When I get time, I plan to write up some examples on my blog (theitsolutionist.com)

                   

                  HTH

                  Scott S Nelson