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! 




No comments:

Post a Comment

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...