How to use Document Understanding AI service in Process Automation

 Info:

Recently, Oracle added new Document Understanding feature with OCI Process Automation.

In Process Automation forms, intelligent document processing is implemented with the Document Understanding control that uses out of the box pretrained AI models from OCI Document Understanding AI service to automatically detect, classify and extract texts and objects from uploaded documents.

Now you can upload your document like passport or driver license and this service automatically extract data. In real life scenarios, we used this service where we have to show our passport, driver license or any other doc.

Like Hotel check-in, rental car, hospital, visa service etc.

Another example, I still remember during Covid period , we have to use ArriveCAN app to enter Canada which scan our passport to extract all information.

So let's test this in our process automation forms. In my previous post I created a business process of "Time Off Request application". You can see that BLOG here.

This is not the best case to use document understanding as this is just time off request, but this is just to show you how we can use this service with our business process.

So let me open the web form which I developed in my last blog, and you can see on the right below there is AI service Document Understanding.


Now let's drag and drop the document understanding to our web form canvas.


Select the control and edit its properties on left side in General tab, I label it "Upload Document"


As you can see it only accept below file types as of now. Oracle might add more types later.


Now click on the Document tab in properties next to General tab. Here you can see only these 2 Document types supported: Passport or Driver license.


I select Passport. As soon as I select passport as document type, it will create the data object: passport with related definitions such as firstname, lastname, country and so on.

The data object and data definitions are displayed under the Data section.


Now select the Generate Control property to automatically generate controls for the created data definitions.

Under messages section if we expend we will see all the default messages that will be displayed, if required we can edit those messages.


Now there is a styling tab, I am not doing any changes there.


Now you can click on Preview button top to just see how it will look like.


Now let's activate this from the top Activate button and click on Override. it will deactivate old version and create new snapshot.


Now click on Test in Workspace



click on the Submit Time off Request and the form is open for employee to fill up information.


Now the fun part will start, I fill all the information and then I have my passport copy on my laptop in .PNG format which I drag and drop in form and within few seconds you will see all information automatically fill-up in the form from my passport.




you will also see this message.


Now we can submit the request for Team lead approval. Now the process is same as I showed in my last Blog. This One I just wanted to test this new cool feature with process Automation.

Hope you like the Blog!






How to provision and build a simple business process with OCI Process Automation (OPA)

 Introduction:

OCI Process Automation (OPA) is an OCI PaaS service which enables you to rapidly design, automate, and manage business processes in the cloud.

The service has two environments:

Design time (Designer): for developing, testing, and activating process applications.

Runtime (Workspace): for running, monitoring, and managing activated applications.

In this blog, I will show you step by step how we can create a process application from scratch in process Automation.

In My blog I use a real time scenario of "Time Off request application" by employee. (I used very simple web form but you can add many other things as per requirement)

For example, an employee will submit the a Time Off Request and his team leader will approve or reject the request as per Justification.

here is what we will create today.



So Let's start.

1. First we have to provision our process automation Instance.

Go to OCI -> Developer Services -> Click on Process Automation

Click on create, fill the info and create instance.

Once instance created, click on the instance and click on the Open console to access OCI web console.

2. Now we are ready to start the process application.


Click on create and fill the title and create application.



3. Now we can start with the design of our process.

click on Time Off request application and lick on + sign to Add components.

We will select the structured process option.


After that click on this process

You will something like below to start your process designer.

4. Now before design we have to create roles. 2 roles , one for requester and one for approver (team lead)

From top right click Add -> Click on New Roles

Fill the Title as Requester and create.

Same way create another role as Approver.



Now click on each role and search user from right side, for simplicity and testing I assign same user for both roles. So I can test later as requester and TL approver as well which I will show you at the end.




5. Now Roles created, again open the designer process and click on the bar on the left of the canvas.
Click the edit icon open properties, select Requester in the role drop-down field.



you will see bar name changed to Requester, same way click on + sign below requester bar and add TL approver role.


There are basically 2 swimlane's one for Requester and one for Approver.

Now from the right palette, expand human category and drag an approver task to second swimlane. Adjust the process flow so that the approve task is second element in the flow. Rename it to Approver TL.

Same way expand the Gateway category and drag Exclusive gateway activity to second swimlane and renamed to Approved?

Expand Human category again and drag submit task to first swimlane and rename it to Resubmit.

Connect Approved? activity to Resubmit task using connector (arrow icon). same way connect Resubmit activity with Approval TL.

You will see like below after above activity.

6. Now we have to create a Web form for human interaction.

Click Add on top of page -> expand UIs and click on Web form
Fill the title and click create.

After create click on the web form, you will see something like below


Now drag and drop the input text field from right palette. Change the field name to first name and label to First Name from properties in the right side.
Repeat the same for last name field and email field.
Also, create Start time off and End time off field of type Date Time.
last I create another Justification field of type Text Area, see below full form.

7. Now we will add Dynamic control to fields via Events.

Enable control field validation based on another form of control field. For example, if start time off is given then End Time Off is mandatory and End Time off should be after start Time Off.

Select End Time Off, on the left properties , scroll down to Events section. Click Add and choose the event "On change" and provide name of the event as OnChangeofEndTimeOff.


Now Edit the onChangeofEndTimeOff to define event conditions by click on the pencil icon.


This condition is basically define if end time off is less than start time off , it will throw error.

8. Now again go back to our design process page.

Open properties of Submit time off request 


add Title and UI form which we created in last step.

Same for Approval TL Request task, configure properties like below.
and below properties for Resubmit task.
select the connector between Approved? to Completed and in properties pane configure Name as Yes.

Same way select connector from Approved? to Resubmit and configure Name as "More Information Required" and define the condition taskOutcomeDataObject=="REJECT" and mark as Conditional Flow.

9. Now we have to define data objects.

Data objects are the variables used to store the information used by your business processes. 
They’re defined during the design and implementation stage of a process. To complete a process application, you must ensure that you have associated each activity with the data objects it requires.

Navigate to design process and click on Data from right side 


In the Data pane click on + to create Data object. Name as timeoffrequestDO. select type as Business and Business Object as "TimeOff Request Form", click create.

Notice a new data object is created under Process data, we will use this data object to store time off request form data.
10. Now the last step is Data Association.

Data association refers to the flow of data within a process. Use the Data Association editor to define input and output for flow elements that need them.

In the Time Off Request form select Submit time off Request task, select open Data Association.


and associate as below and click apply.


Now select Approval TL and select open Data Association and map as per below diagram in input tab.

and in output tab map as per below and click apply.

11. Activate an application

Activating an application moves its metadata from design time (designer) to runtime (Workspace), where it can be run in production capacity.
Click on Activate button on top right


keep everything default and activate. It will show that snapshot is taken and application is activated.

Click on "Test in Workspace" and it will open Workspace window.


12. Now test and run the application in workspace.
Click on Submit Time off request application and the Time off request form I created earlier will appears.


complete the form and submit.

Now as an approver role, Team lead gets assigned task when a requester/employee makes a time off request.

Now choose workspace from the Options menu and go to team Tasks where you will see the request.

Here you can also see the title and process name that we defined earlier.

Right now request is status unclaimed so click on actions and claim it.
When I claim it, it will go to My tasks and assigned to me.

Now I can open this request to see details or I can click on action to approve or reject. I click on approve it. Now task will disappear from my Tasks.

But If I will click on Reject , it will again go to team task to employee has to fill up the form again and resubmit.

Once it approved, you can still see/track the request, click on tracking.

click on completed and you will see all completed requests.


So this way we can create a simple application, I hope you like this blog! 




Analyze Invoices with Oracle Analytics and AI Document Understanding

OCI Document Understanding is an AI service that enables developers to extract text, tables, and other key data from document files through...