Monday, March 7, 2022

Integration between Oracle Integration Cloud Rest API and Process Forms

In this blog we will see how we can leverage Integrations in Process form to generate Dynamic LOV’s on Form fields, perform Refresh connector Actions on an event, filter list response based on criteria and Skip Data Upon Load.

For this, we will develop a simple form which will capture User’s International movement details request and submit for approval -
  • In the form we will have user select his Current and Destination Country/State.
  • Source Country LOV will be populated on form Load
  • Once user selects Source Country, Source State and Destination Country LOV’s will be populated.
  • User should not be able to see Source Country name in Destination Country LOV’s
  • Once user selects Destination Country, Destination State LOV will be populated.
  • Considering this as POC, Source and Destination options available are only India and USA.
Watch this video to understand how the form will behave-

Let’s begin –
  1. For this use case I have developed a OIC service which returns list of Country one Rest resource and list of State having Param as Country Name on 2nd resource. It looks like this.
  2. Navigate to Process. Click Create to create New Process Application -> Create an Application to start from scratch
  3. Name the application and click Create.
  4. Click on Create a Structured Process -> Start with a Form -> Name the process –> Click Create
  5. Click on Start and Edit properties.
  6. Give it a title and click on Form to create a new Form -> Name it -> Check Open form Immediately -> Click Create
  7. Once the form opens, Drag and drop Select field 4 times, rename, and position them.

    Now we will configure Integration and then come back to form.

  8. Click on Integrations -> Link to an Integration. Here we will select existing OIC integrations, for non OIC Rest and SOAP fulfillment services we can create connectors using options ‘Connect to Rest Connector’ and ‘Connect to SOAP connector’
  9. Select OIC integration and click on Create. Upon finishing you will be able to see this service configuration card under Integrations. In my case I have selected CountryStateLookup which I have developed prior to coming to Process

    Let’s get back to form.

  10. Click on Source Country -> Change Option Source from Static to Connector
    • Select the required connector, resource, operation
    • Similarly, we will configure State, Destination Country, and Destination State.
    • Provide element name coming from Integration in Response.
  11. Although we have now setup all fields to populate using Integrations, however we wouldn't want to call an Integration to fetch Source State, Destination Country and Destination State unless Source Country is selected. For this we will use Form features.
  12. In Source State, Destination Country and State click on Enable skip upon Load.
  13. On Source Country create an event so that we can load Source State once user has selected Country.
  14. Create Event and select On Change
  15. Edit and Add Action -> Select Control -> SourceState ->Refresh Connector
  16. We can also refresh Connector for Destination based on this.
  17. Now once user selects Destination Country, we also need to populate Destination State so let’s create an event on Destination Country also.
  18. Only thing left is to configure Destination Country to not show Source Country name. For this we will use Filter. Edit Filter. Add Filter Criteria -> Select Operator “Not equals to”. In type select Control and in Control select SourceCountry. Click on ok and that’s it done.  
  19. Save and Activate and Test. 

Thank you 😊

No comments:

Post a Comment