Monday, July 17, 2023

#976 OIC 3 Visual Builder invoking OCI Process Automation

Invoking OPA from Visual Builder is very similar to invoking OPA from OIC3, see my post here on how to do the latter.



Here is the process I will invoke for Visual Builder - 




Request payload is as follows - 














So to the steps for Visual Builder invoking OPA - 

Step 1 - Create an IDCS app for OPA

This is described in the post mentioned above. This will give you your client id and secret.

Step 2 - Get the required url for invoking process 

The format is as follows - 

https://yourOPA.oci.oraclecloud.com/process/api/v1/process-instances?applicationName=yourOPAAppName&version=1.0&processName=yourProcessName

So, for me - application name is OrderApprovals and process name is OrderProcess.

Step 3 - Create an App in Visual Builder 

First thing I do is add a Business Object with the same fields as the request -
















Note the pre-seeded fields - createdBy etc.

Step 4 - Define Service Connection in Visual Builder 

This will be based on the OPA REST api discussed above.




As you can see, Authentication is set to OAuth 2.0 Resource Owner Password Credentials.

You provide client/id secret as well as userid/password (of a valid OPA user).

Scope is set to  
https://yourOPA.oci.oraclecloud.com/process offline_access

Token Url is set to https://yourIDCS.identity.oraclecloud.com/oauth2/v1/token


Step 5 - Build a simple app


My VB app is very simple - it allows me to create orders - 


Note the extra button in the Create page - Send for Approval. This will invoke the OPA api.


Step 6 - Test it





I check in Process Workspace






No comments: