Integration

Get Involved. Join the Conversation.

Topic

    Mark Chappell
    Calling an Integration from another IntegrationAnswered
    Topic posted October 24, 2018 by Mark ChappellBronze Medal: 1,250+ Points, tagged Adapters, ERP Cloud, Integration, PaaS, REST 
    1030 Views, 20 Comments
    Title:
    Calling an Integration from another Integration
    Summary:
    How to pass parameters/values from 1 integration to another integration called with the REST api
    Content:

    Hi Everyone,

    I'm calling a child Integration from a main Integration via the REST connection, based on the URI for my child Integration. but I need to pass a value from the main integration to the child, and then the child to use this parameter variable.

    I am assuming this is possible?

    If it is, does anyone have any experience with this that they can share? 

    Thank you as always.

    Mark.

    Best Comment

    Hemen Shah

    Yes you can call child integration from main integration. Here I did it for my project. Here I am sending you screen shots. Hope this will help you.

     

    Comment

     

    • Hemanth Lakkaraju

      Calling another ICS rest-based integration is exactly same as calling any external rest api. You can configure child integration trigger (rest adapter) with a template parameter or query parameter and you can pass this from Parent flow.

      • Mark Chappell

        Hi Hemanth,

        how would the parameter relate in the Child Integration?

        Do we define a Variable in the Child Integration, and ensure the parameter name I pass from the main integration matches the variable in the child? 

        any detail instructions / examples would be very much appreciated.

        thank you.

        Mark

    • Phil
      It is possible, no different to calling another service
      
      I believe we covered in the book and there are advanced illustrations in the resources from 3rd parties - https://urldefense.proofpoint.com/v2/url?u=https-3A__oracle-2DIntegration.cloud&d=DwIFAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=MXYbTzTshRc5epJxhBYWZ4WjZFeYrTxE5mIacleO5S8&m=KcvDR3XoCLOFrFOV3Y1SX2nQQ4MlJi-XNZgt0NgDzCQ&s=qMF5Y0DD8mj9DCM-5-EOOQodjoUXutLMI4_F7A1AiaU&e= 
      
    • John Graves

      True.  You can pass parameters via URI, query params, header or body depending on the use-case.

      There are, as Phil mentioned, many books discussing best practices on when to use each of these in REST calls.  All are possible and easy to do in OIC.

      Have fun.

      -John

    • Hemen Shah

      Yes you can call child integration from main integration. Here I did it for my project. Here I am sending you screen shots. Hope this will help you.

       

      • Mark Chappell

        Hi Hemen

        how would the parameter relate in the Child Integration?

        Do we define a Variable in the Child Integration, and ensure the parameter name I pass from the main integration matches the variable in the child? 

        any detail instructions / examples would be very much appreciated.

        thank you.

        Mark

    • Mark Chappell

      Thanks All

      I'm glad to learn this is possible, as I expected. However I'm new to using OAICS and very new to using REST API call's.

      I'm sure I can figure out how to pass a parameter in the REST adapter config, but how would the parameter relate in the Child Integration?

      Do we define a Variable in the Child Integration, and ensure the parameter name I pass from the main integration matches the variable in the child? 

      any detail instructions / examples would be very much appreciated.

      thank you.

      Mark

    • Mark Chappell

      Hi Guys

      thanks for the help so far...

      I've added a word doc, screen shot showing my attempts at defining a template parameter within my REST connection config, within my main integration... this REST connection obviously invokes my child Integration... 

      however, when I run my integration with this template parameter defined as it is, my integration errors with the following;

      : Fault Details : <nstrgdfl:APIInvocationError xmlns:nstrgdfl="http://xmlns.oracle.com/cloud/generic/rest/fault/REST/CallChildInteg"><nstrgdfl:type/><nstrgdfl:title/><nstrgdfl:detail/><nstrgdfl:errorCode/><nstrgdfl:errorDetails><nstrgdfl:type>http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6</nstrgdfl:type><nstrgdfl:title>Method Not Allowed</nstrgdfl:title><nstrgdfl:errorCode>405</nstrgdfl:errorCode><nstrgdfl:errorPath>&lt;![CDATA[POST https:/xxxxxxxxxxxxxxxxxxxxxxx.oraclecloud.com/ic/api/integration/v1/integrations/PO_UPDATE_BUSSER_MC_DEV1%7C01.00.0000/schedule/jobs/TESTfromOAICS returned a response status of 405 Method Not Allowed]]&gt;</nstrgdfl:errorPath><nstrgdfl:instance>&lt;![CDATA[Method Not Allowed]]&gt;</nstrgdfl:instance></nstrgdfl:errorDetails></nstrgdfl:APIInvocationError> :Application Error

      any advice greatly appreciated on this error - and then also, how I can reference this parameter in my child integration.

      thanks as always

      Mark

      • Hemanth Lakkaraju

        So you want to invoke a scheduled integration as a child? Did you look at this on how to use? I would suggest first try to test it standalone so that way you can easily get to know how to configure this as an invoke in parent.

        Calling schedule integration as a rest call is slightly different to calling another rest-based integration in terms of passing parameters. While the latter use template parameters or query parameters in URL as parameters, former requires parameters to be passed in payload as an array like below (I've not tried though):

        I assume, from above error TESTfromOAICS is the parameter value to be passed here and I would assume testScheduledParam will be the scheduled parameter name you created for the scheduled flow. With these assumptions,

        The URI should be: https:/xxxxxxxxxxxxxxxxxxxxxxx.oraclecloud.com/ic/api/integration/v1/integrations/PO_UPDATE_BUSSER_MC_DEV1%7C01.00.0000/schedule/jobs

        The Body should be:
        {
            "action":"NOW",
            "parameters":[
                {
                    "name":"testScheduledParam",
                    "value":"TESTfromOAICS"
                }
            ]
        }

         

        • Mark Chappell

          Hi Hemanth,

          Currently my child Integration is a scheduled integration yes...

          It is simply calling a BIP Report, decoding and then sending the output to an SFTP Server... I've taken the URI from this Integration and created a REST Connection in OAICS pointing to it. Then I've dropped this REST Connection into my main Integration in order to invoke it. This works as long as I am not trying to pass parameters as described. 

          My child Integration does not need to be a scheduled Integration. However, if I create a new child integration as an Orchestrated Integration - what would be my trigger for this? and how would I then call from my main integration?

          If can figure this out, I will attempt with template parameters...

          I will also attempt using the payload option for a scheduled Integration...

          How then, in either case, does my child integration reference the parameters passed to it? 

          Finally, I've just come across this article: 

          How to invoke an Integration From another Integration in OIC without creating a connection

          https://blogs.oracle.com/integration/how-to-invoke-an-integration-from-another-integration-in-oic-without-creating-a-connection

          This looks an option for me, but I'd like to understand how to pass parameters manually via REST also... 

           

          thanks for your help

          Mark

           

          • Hemanth Lakkaraju

            If child is another REST-based integration having EndpointURL --> https://host:port/ic/api/integration/v1/flows/rest/CHILDFLOW/1.0/testTemplateparam?testQueryparam=test

            Below is the configuration for Parent Invoke REST Connection:

            Connection URL: https://host:port/ic/api/integration/v1
            URI: /flows/rest/CHILDFLOW/1.0/{testTemplateParam}
            QueryParams: testQueryparam (type string)
            Request and Response --> based on payload configured for child trigger.

            If child is another Scheduled Orchestration-based integration having EndpointURL --> https:/host:port/ic/api/integration/v1/integrations/SCHFLOW%7C01.00.0000/schedule/jobs and have scheduled params as schParam1 as String

            Below is the configuration for Parent Invoke REST Connection:

            Connection URL: https://host:port/ic/api/integration/v1/flows/rest
            URI: /integrations/SCHFLOW%7C01.00.0000/schedule/jobs
            Request: JSON as specified in above format

            The parameter name in payload should match exactly as the parameters configured in the child integration.

          • John Graves

            Mark,

            I find it odd that the blog entry you refer to points to a flag feature not mentioned in the OIC docs.

            Also, that blog entry shows how to create a rest service with parameters and should serve as a reasonable example for your question.  The sample Hello World serves as the example receiving parameters and this blog shows how to call it.

            Hemanth, below, shows how to use the query parameters.

            -John

        • Vasanth Mahendran

          Hello Hemanth,

          We are triggering schedule integration through rest API the similar way as . 

          https:/xxxxxxxxxxxxxxxxxxxxxxx.oraclecloud.com/icsapi/integration/v2/integrations/TEST_SCHEDULE%7C01.00.0000/schedule/jobs that execute it synchronously one after other for multiple requests. 

          Now we need to pass parameters while we trigger the schedule integration. I tried your suggestion in the post above. But it is not working for me. One difference is now the API version is v2.

          Following is body I used while triggering the scheduled integration.

          {
          "action":"NOW",
          "parameters":[
          {
                  "name":"Document_id",
                  "value":"doc_1321"
          }
              ]
          }
           
          The TEST_SCHEDULE integration gets triggered but the scheduled parameter named Document_id does not get the value "doc_1321".

          Regards,

          Vasanth Mahendran

          • Hemanth Lakkaraju

            1. The endpoint is wrong. There is no such pathURI - /icsapi/integration/v2/integrations

            2. If you are referring to this API, then it is ICS v2 API that doesn't support parameters.

            3. Parameters through rest call are supported only in OIC version of APIs.

    • Rajan Modi

      Do check out recent blog that can allow integration calling another integration differently and is optimized: https://blogs.oracle.com/integration/how-to-invoke-an-integration-from-another-integration-in-oic-without-creating-a-connection

    • Sajeena K S

      Hi,

      What is the best approach to invoke a local integration from another in AIC? Is that using the integration activity or using a rest adapter?

      Thank You

      Sajeena

      • Hemanth Lakkaraju

        Depends on the use case. Using the activity saves maintenance of a connection and credentials while using adapter will give the opportunity to use features supported by adapter.

      • Rishabh

        Hi,

        I am not able to see Integration Activity in my Integration. Anything we need to enable to use Integration Call in our integration. I am using 19.2.3 version OIC.

        • Monish Munot

          Ideally this features should be available in 19.2.3 if not you will have to raise SR and get it enabled.

          You can refer blog for any issues.