Create Process Instance from the Integration and Invoke the Integration Service from the Process Instance - Part 4
The aim of this post is to show practical examples and set-ups to enable interaction of OPA with other cloud services or with any enterprise system capable to invoke REST APIs.
This is the follow-up article to
OCI Process Automation is a cloud native, low-code service that helps developers quickly design, deploy, and manage approval workflows across applications.
Now I will demonstrate following OPA invocation scenarios:
Prerequisites:
Integration Flow –> OPA Process Instance Creation
Previously we interacted with the OPA as Platform using OPA Management API REST services and the same from the VBCS.
Everything what is possible to configure or change on top of running processes and some process design configurations is possible to do through the same API family as well.
Now we will interact from the Integration flow with the OPA process application.
I created/prepared before composite e2e application(VBCS, Integration, Process) with the very simple VBCS – mobile application where Supplier Data are populated and, on the button, “Submit” (1) is invoked Integration flow responsible to create the supplier in the ERP Cloud. Then in the case that ERP responds with business or other error OPA Process Application is invoked (2) to create Fix Supplier Data process instance. Once data fixed through OPA workflow task and form (3) again Integration is invoked to another attempt to create the supplier business object in the ERP cloud. In case of error – new Fix supplier process is created.
Before in the OIC Gen2 there was special action in the pallet for the “PCS” invocation. Nowadays in OIC Gen3 where serverless cloud native services running on OCI there is no special connector or action on OIC side to connect to Process Automation OPA.
There are several possibilities to define the connection to OPA on OIC side. I will show one frequent option in the following paragraphs.
Connection Definition - Integration Flow –> OPA Process Instance Creation / OAuth Resource Owner Password Credential
The connection approach re-uses the same client application approach as it is described in the first article Prerequisite - Part 1 - How To Interact with The Oracle Process Automation.
Confidential application is defined in the IDom where OPA belongs to
and it must contain OPA scope for the process and decisions
Integration connection then needs to be defined including the user identity for the user who is in the role of the process owner resp. in the role of the swim-line where the process start activity is placed.
Connection is then defined with the user credentials. This type of the connection should be used if there is in place e.g. technical integration based on some system event or scheduled process and we have no possibility to use federated identity or identity of the user that is client of the Integration resp. Process Application.
The security policy is chosen as “OAuth Resource Owner Password Credentials”
In the optional security the scope with the "offline_access" and auth header should be configured
Note: To invoke OPA API in different Identity Domain and propagating the user using “OAuth Client Credentials using JWT Client Assertion” see OAuth Using the JWT User Assertion in OIC and OAuth 2.0 Grants with OIC REST Adapter
OIC-Integration-> OPA invocation
Now we are ready to test OIC-Integration->OPA interaction.
Invoke for the OPA should be configured like following
Payload example is possible to use from the postman exercise(article - Part1).
And process API response is possible to use from the postman as well
Response is possible then to use for further instance management or registration to custom business analytics for the monitoring of business specific process instances – in our case FixSupplier process.
There is Supplier process integration we can test now. The result of submitting payloads with existing DUNS number should be 2 new process instances to fix the Supplier data.
In the Activity stream you can observe the integration activities details
Recommended by LinkedIn
In the Process Workspace Tracking we should see the new instance created
In the Audit it is possible to see payload Details
Now we can go to OPA and to see how to Invoke Integration.
OPA -> OIC-Integration invocation
From the Process automation side to Integration component is quite easy. Process Automation as the business process management and case management tool expects business interactions. So adapting to interaction types is done through connector very similar to VBCS.
You can create and use two kinds of connectors in Process Automation - REST connectors and Integration connectors.
To connect to an integration in Oracle Integration, you must create a connector using the integration.
From a selected process application, click Add in the upper right corner of the page.
In the Add Component pane, expand Connectors and choose Integration.
Available active integrations designed with REST triggers from Oracle Integration are listed.
Choose an integration from the list or search for the integration and select it and Click Create.
Details of the created connector to OIC
The connector configured with the integration is displayed in the Connectors page as well as the process application's main page. You can identify it as an integration connector by the Integration icon Integration icon.
In the process design activities will appear connector provided integration
For the Integration Invoke Activity is necessary to configure properties and then manage data associations
Configuring Input and Output data asociation you can map Process or Form data objects into Service payload and response from integration for further processing in the process flow.
After finishing the mapping, the process is ready to be invoked and after the submitting the fixed data the process invokes Integration responsible for the data provisioning to e.g. ERP Cloud in our case.
Once the instance is created as in the above integration test or VBCS test from the previous article. Then data can be fixed in Workspace Tasks or directly in the instance tracking opening the instance or via notification link from the email.
I fixed the DUNS number and re-submitted the supplier.
In the Tracking we can check the processing steps
We can check Integration Activity Input and Output in the Audit steps and links to step detail
Of course we should find the integration flow in the OIC Observability.
We can see that the integration processed that resubmission of the Supplier business object
ERP view
So, within this post we could see that interact from the OIC Integration services to/from OPA processes is very easy and again low-code wizard driven.
As in the previous posts we used REST API for Oracle Cloud Infrastructure Process Automation which allows many more interactions with process applications, running instances, roles, credentials, tasks …
Credits: Niall Commiskey, Stan Tanev
References:
Oracle Integration Cloud ☁️ - OIC/ICS || Cloud Engineering || 3X OIC Certified || 11X Oracle Certified || APIGEE || Ex- EY
1yThanks for sharing this, Peter! I am gonna check this on Gen3 as serverless cloud native services are on OCI now.