Wednesday, June 26, 2024

Unleashing the power of Artificial Intelligence in Oracle APEX 24.1

Oracle APEX has been a game-changer in the low-code application development  domain, enabling developers to build robust applications rapidly. 

Oracle recently released Apex version 24.1 which is loaded with AI features. With the introduction of the AI Assistant in Oracle APEX in version 24.1, APEX has elevated its capabilities, offering AI support to developers. Let's see what are the features and benefits of the Oracle APEX AI Assistant and how to configure and use it in a step by step tutorial.


What is the Oracle APEX AI Assistant?

The Oracle APEX AI Assistant is an intelligent, context-aware virtual assistant designed to help developers and end-users interact more efficiently with their APEX applications. 

It leverages natural language processing (NLP) and machine learning (ML) to understand user queries and automate routine tasks.

AI Assistant has ability to understand and process natural language queries. Developers and users can interact with the assistant using plain language, asking questions and giving commands to generate queries and/or automate repetitive tasks.


Steps to configure and use the APEX AI Assistant

First we need to configure Generative AI service in our APEX environment:


- Navigate to Workspace Utilities > All Workspace Utilities



- Navigate to Generative AI option



- Create a new service


- Let's select Open AI for the AI Provider


- You can choose Cohere, Open AI or Oracle Generative AI service providers






AI Provider: Open AI

Name: OpenAI

Used by App Builder: Make sure to enable this option

Base URL (auto-populated): https://api.openai.com/v1

Credentials (Create New): Obtain the Open AI API key and paste it here

Note: You can create a free Open AI account and generate an API key under Trial Keys section





- Click Create

- Once created, it should look like this




- With these steps, we have configured the Gen-AI Service in our APEX environment.


APEX AI Assistant Features

Once the Gen-AI Service is configured in APEX environment, below features will be automatically activated in our environment:

Create App Using Generative AI:
This feature facilitates the creation of new application from a natural language user prompt that specifies desired capabilities. This simplifies the development of new applications and allows developers to focus their energy and resources on creating unique, bespoke application features rather than underlying code.

Conversational AI dialogs:
This feature enables one to 'converse' with their application and database in natural language through an out-of-the-box conversational interface that developers can easily add to their applications. As a result, developers can provide a richer in-app experience without the need to build Generative AI or natural language processing components from scratch.

Let's take a look at these features in detail.


Create App Using Generative AI

- Navigate to App Builder and click Create a New App option



- Here, we will notice a new option named 'Create App Using Generative AI'. Select it.



- Let's mention below sentence to Gen-AI Engine to create a new App to manage Projects data.

"Create an app to maintain project milestones, project tasks, projects, project task todos, and project status, that includes pages for a chart, dashboard, interactive report, and faceted search."



- As we can see the Gen-AI Engine in our APEX Environment understood our Natural Language (NLP) prompt and has offered us an option that will create an application called Project Tracker with the pages to offer Project Overview, Dashboard, Projects interactive report and a Faceted Search page.



- Let's click Create Application

- This will take us to a final review page where we can see all above pages are listed. Let's click Create Application



- Once finished, we'll have our application ready for first use



- Let's run it and see how it works.

- Once logged in, we can see our app shows all the features including the pages described in above steps.

Project Overview:



Project Dashboard:


 
Projects List (Interactive Report):



Search Tasks (Faceted Search):



- This way we can leverage Gen-AI service to automatically create an App for us based on our Natural Language instructions.


Conversational AI dialogs


SQL Assistant:

Now, lets take a look at Conversational AI dialogs feature to 'converse' with our database in natural language and build constructs using AI.

 -Let's create a new page in our application

- Select Interactive Report and click next



- Provide name to the IR Report and select Source Type as SQL Query



- Here, we'll notice a new option named APEX Assistant

- This is another AI feature that let's us converse with our database and provide our requirements in Natural Language prompts and APEX Assistant would convert the same into SQL queries

- Let's mention a statement like "create a report based on Employees data" and see if Gen-AI decodes it and builds an Interactive Report query based on Employees and related information.




- As we can see the APEX Assistant understood our Natural Language prompt and has built the query for us. Let's click Insert to use this query.





- Validate the query and we can see the APEX AI Assistant has built a valid query for us.




- Let's run our AI Generated Interactive Report and we can see the query works perfectly.





PL/SQL Assistant


- The APEX AI Assistant is available throughout the App Builder at many places and it doesn't stop at generating SQL queries but we can use it to also generate PL/SQL Code.

- Let's create a Dynamic Action for example purpose

- Change Action to Execute Server-side code

- Under PL/SQL Code box, click Code Editor icon to popup the Code Editor

- As we can see we have APEX Assistant available under PL/SQL as well.

- Let's  mention statement 'anonymous block to maintain project tasks' and see if AI can generate a anonymous block to handle Project Tasks for us.




- As we can see, Gen-AI understood our Natural Language prompt and built an anonymous block for us that helps in performing Insert, Update and Delete operations on Project Tasks related data. We can utilize this as a template and tweak it as needed.


As seen above, the Oracle APEX AI Assistant in version 24.1 is a groundbreaking addition that significantly enhances the capabilities of the APEX platform. By leveraging AI and machine learning, it transforms the way developers interact with applications and databases, making the process more intuitive, efficient, and productive.


Share:

Friday, June 7, 2024

How to Fix duplicate timecard notifications and approval issue in Oracle Fusion Time and Labor (OTL)

In Fusion Time and Labor we came across a requirement where where every entry made on the timecard was supposed to be routed for an approval. We configured this solution by defining ‘Entry Level Approvals’ for the timecards.

Approvals at all the timecard entry levels should be completed/approved to move the time card into “Approved” status. If there are multiple approvers involved in the BPM workflow then each of the approvers must approve their corresponding entries.

While implementing this in Entry Level Approvals (ELA), we observed that multiple approvers were receiving multiple notifications for the same time card.  

Also, when both the approvers were approving their respective entries, the timecard was still remaining in Submitted status instead of moving to Approved status. Due to this issue, users' timecards were not getting approved at all.


Here's what can be done to fix this type of issues.


- Navigate to Setup and Maintenance




- In Search, look for 'Manage Task Configurations for Human Capital Management' task


- Open the task. This will take us to Business Process Management (BPM) worklist

- Search for task 'TimecardApprovalELA'

- This will show us two tasks one for Project Timecards and other for just Timecards. This is because Entry level Approvals are available for Project Costing Consumers as well as Payroll Consumers.




- Let's click on TimecardAprovalELA to edit it.

- Once opened, navigate to Notifications tab



- Click More




- Find and Check the box that says 'Don't send multiple notifications for the same human task event'




- Let's make sure Group Notification Configuration is set to 'Send Individual Emails with separate task form based on locale'





- Optionally, we can also enable 'Send task attachments with email notifications' so that attachments are sent to approvers via email



- Now, let's navigate to Configuration tab



- Scroll down and locate Task Aggregation option and set it to 'Once per task'




- Optionally, we can also configure other features of the approval such as allowing participants to route the approvals to others or allow them to edit future participants etc.




- Save and Commit the changes






With above configurations, we can fix the issue of BPM sending multiple notifications to multiple approvers when the Timecard contains multiple rows for two different assignments. 

This will also fix the issue of Timecard not getting approved even after all the underlying entries have been approved by corresponding managers.



Share: