OCI Process Automation (OPA) allows you to develop, automate and monitor your business processes. Customers can provision an OPA instance or enable the same from Oracle Integration Gen 3 – check the OPA documentation for more. Note OPA is a new product and is not the same as Process Cloud which is integrated in Visual Builder in a different way.
EDIT – From 24.04 onwards Visual Builder has out-of-the-box backend support for OCI Process Automation now and you can refer to the documentation to understand how to create an OPA Backend and Service Connections based on the same
The below blog can be referred to for versions prior to 24.04 to easily access OPA REST APIs which is explained below.
Applicablity
Applies to visual apps only in Visual Builder Runtime instance (standalone and OIC), Visual Builder Studio prior to 24.04 (for 24.04 onwards, there is out-of-the-box support for OPA, therefore refer to documentation instead of this blog). Not for app extensions currently.
Create a Backend
The first step is to create a Backend in VB representing OPA. To check which authentication can be used, first determine whether the OPA instance is the same IDCS/Identity domain as Visual Builder. If it is, then you can leverage both Identity Propagation and Fixed Credential methods. If both are not part of the same Identity domain, then you can leverage only the Fixed Credential method only. Both are described later.
Same Identity domain – OAuth 2.0 User Assertion (identity propagation from VB to OPA)
This method can be used if OPA and VB are in the same OCI Identity domain / IDCS stripe. The OPA REST APIs are called with the identity of the logged in user in this case.
- Make sure that the logged in developer to Visual Builder has the relevant Developer access in OPA.
- Begin by creating a visual app in VB.
- Now you need to create a Backend that represents OPA. The Backend can be created as a Tenant Backend or an Application level backend as per need; both are described below
- Create a Tenant Backend representing OPA – this will be available to all the visual apps to use.
- For this navigate to Tenant Settings -> Services. This option is only available to Administrators. (Note : In Visual Builder Studio, if you have setup the project to develop visual apps, this would be available in Environments as an additional Backends button)
- Create new Backend called "opacustom" with the following details
- URL = https://<OPA base URL>
- Authentication : OAuth 2.0 User Assertion
- Scope = The OAuth scope for OPA, typically https://<OPA base URL>/process
- Client Id / Secret / Token URL – Leave Blank
- Connection Type = Dynamic, Service Supports CORS is recommended. If the OPA service for some reason doesnt support CORS, you can change to Always Use Proxy
- Alternatively, if you dont want to configure a Tenant Backend, you can create an Application level Backend representing OPA – this will only be available to the visual app in question
- For this navigate to Services. Click on + icon.
- Create new Backend called "opacustom" with the same details
- Create a Tenant Backend representing OPA – this will be available to all the visual apps to use.
Different Identity Domain – OAuth 2.0 Resource Owner Password (no identity propagation)
If OPA and VB are not in the same OCI Identity domain / IDCS stripe, then you will need to use this method. In this case, no matter who is logging in, the OPA REST API will be called with the credentials that were provided in the backend configuration
- Get the username and password of a user having relevant Developer access in OPA.
- In this case, you need certain details from IDCS domain of OPA like client id and secret. For this, the OPA team recommends creating a new confidential application with the OPA process scope. See here on how to set this up. Make sure the OAuth 2.0 Resource Owner grant type is available for this confidential application. (Others are optional and not required for the purpose of this blog).
- Create a visual app in VB.
- Now you need to create a Backend representing the OPA system in VB. Here you can take two approaches – either create a Tenant Backend or an Application Level Backend, both options explained below:
- Create a Tenant Backend representing OPA – this will be available to all the visual apps to use.
- For this navigate to Tenant Settings -> Services (This option is only available to Administrators)
- Create new Backend called "opacustom" with the following details
- URL = https://<OPA base URL>
- Authentication : OAuth 2.0 Resource Owner Password
- Client Id and Client Secret – as collected earlier
- Username and Password – as collected earlier
- Token URL = This needs to be the IDCS token URL for the OPA instance. e.g https://<idcs_URL>/oauth2/v1/token
- Scope = https://<OPA base URL>/process
- Connection Type = Dynamic, Service Supports CORS is recommended. If the OPA service for some reason doesnt support CORS, change to Always Use Proxy
- Alternatively, if you dont want to configure a Tenant Backend, you can reate an Application level Backend representing OPA – this will only be available to the visual app in question
- For this navigate to Services. Click on + icon.
- Proceed to create new application-level Backend called "opacustom" with the same details
- Create a Tenant Backend representing OPA – this will be available to all the visual apps to use.
Creating Service Connection based on the OPA backend
Now that the Backend is created, proceed to create Service Connections based on this.
- Navigate to Services. Click on the + icon
- Choose to create a Service Connection using Define by Endpoint tile
- In the Service Connection Wizard, choose the OPA backend from the combobox options, and fill in the rest of the options like the method (GET/POST etc), Action Hint
- Fill in the rest of the URL e.g. /process/api/v1/tasks. Consult OPA REST API documentation for details
- Give a valid Service name in the Overview, and customize the Service Connection's Request/Response attributes as needed
- Navigate to the Test tab and test the Service Connection and click create if successful.
- Now the Service Connection is ready to be consumed in a webapp.
This completes the procedure on how to connect to OPA in VB currently. In the future, there will be more tooling in VB to for developers to make use of OPA implicitly