The APEX 23.2 release introduced the Workflow component in the Application building paradigm. Take a quick look at these blogs for a quick recap of the APEX Workflow capabilities and examples.
With 24.1 we have made some enhancements to the Workflow functionality in APEX to improve the developer as well as the end user experience.
In this blog, we will be using the Expense Reimbursement Multi-level Approval App that I had blogged about earlier.
In App Builder, open the Expense Reimbursement App.
Click on the pages Monitor Expense Workflows and Expense Reimbursement Details and delete them one by one.
On the Application home page, Click on Create Page.
From the application Home Page, click on Run Application.
Log in as STEVE . Clck on Submit Expense to submit a new Expense Reimbursement Requests for ANANYA.
Click on Submit.
Now click on Monitor Workflows and then click on the entry- Expense Reimbursement for ANANYA to open the Workflow Details Page.
Scroll to the bottom of the Details page. Notice that there is a new region - Workflow Diagram. Expand this to get the live visual representation of the workflow instance.
Note that the activities that have been already completed, are bordered with green while the current activity is bordered with blue.
Log In as Jane and go to Pending Expense Approvals and click on Reject for the Level 1 of Reimbursement Request.
Log back in as Steve and open the Completed Workflow from Monitor Workflows.
Note that the diagram now shows the workflow has completed and highlights the route traversed by the workflow instance in green.
Repeat the above step with different amounts and expense reasons:
.
Now that we have quite a few workflow instances at different states, navigate to the Workflow Dashboard page
The Workflow Dashboard is divided into four regions
States By Workflow Region
The pie chart on the top left gives a state-wise distribution of all the workflow instances. When you click on a particular color on the chart, the Details section on the right, shows the number of workflow instances belonging to that particular state.
Active Workflows
Navigate to the Active Workflows to see how many workflows are there in active or waiting state. Clicking on a workflow on the left (Overview) section, will show the number of workflow instances that are waiting at a particular activity, on the right.
Faulted Workflows
Navigate to the Faulted Workflows region to see how many workflows are there in faulted state. Clicking on a workflow on the left (Overview) section, will show the number of workflow instances that have faulted at a particular activity of that workflow, on the right.
Performance
Finally, the Performance region shows the average completion time for the instances of a particular workflow.
Add more workflows to your application, and run them to see how they reflect in the Workflow Dashboard. The Workflow Dashboard, is a generated page. You can customize it to add more regions, or change the style of a particular chart, or remove regions that you don't prefer showing in the dashboard,
In APEX 23.2, when a workflow was terminated, if there was a human task activity that was still waiting to be completed this human task stayed assigned in spite of the termination of the workflow. The initiator of the task could manually cancel it of course, but the workflow termination did not take care of canceling these tasks automatically.
This has been addressed now. Try the following steps:
select state from apex_tasks where workflow_id = <provide the workflow instance ID here >;
The state will Canceled.
As an end user, to further debug into a faulted workflow, or a workflow that unexpectedly completed, we can use the Debug Message Data more effectively now.
Click on Actions > Columns. You will find a new column Workflow Instance. Bring it to the right to include it in the report.
The debug report will now show the workflow instance ID and you can use it to filter debug messages for the workflow instance you are interested in. Makes debugging a lot simpler!
Hope you enjoyed learning about these simple but super effective workflow enhancements in APEX 24.1 which could further enrich your application building experience!
Ananya hails from Kolkata and has been associated with Oracle for the past 2 decades. For many years, she was working for Oracle Integration Cloud and Oracle Process Automation Service, leading multiple teams. She now works as part of the Oracle APEX team and has co-designed and developed the APEX Approvals Component and APEX Workflow features.
She is also a bilingual poet with five published poetry collections in English and Bengali.
Next Post