← Back to list

EPM Cloud — Data Management Job Notification using Groovy BRules

Looking to send email notifications of the Data Management Jobs or Data Load status? This blog will help you start with it.

vigneshpt8 · 2024-01-10 07:29 · 10 claps · 3.6 min read
#oracle-epm-cloud #rest-api #data-management #data-exchange #fdmee
Open on Medium ↗
Wiki topics: BIZ · Business Strategy

EPM Cloud — Data Management Job Notification using Groovy Business Rules

Looking to send email notifications of the Data Management Jobs or Data Load status? This blog will help you start with it.

I’ll keep it simple; I need to create a Groovy script to capture information about the last job executed in Data Management, extract its details, and send this information via email. My intention is to execute this Groovy rule immediately after my data load, ensuring it consistently captures details from the latest job run. I’ll also cover the process of attaching the business rule to a data load rule in this discussion.

To start, initiate a REST request using a REST client to fetch Data Management job details from EPM Cloud. The designated REST URL for this purpose is https://<cloudinstance>/aif/rest/v1/jobs/. This request is designed to retrieve information about the top few jobs, typically the top 10, that have been executed in Data Management. If you are specifically seeking details about a particular job, you can include the Job Number in the REST URL. However, for this specific requirement, we only require information from the latest job, which is inherently encompassed within the top 10. Execute this rule promptly after the data load.

The following is an example of the REST response obtained when making a GET request. I am utilizing the Postman REST Client to inspect these responses.

Figure 1: Postman REST Client

Figure 1: Postman REST Client

Let’s now proceed with Groovy scripting. Initially, let’s break down the script into components. First, import the necessary functions and reference the connection details configured in the connections section in EPM Cloud. Please refer to the blog on ***REST Connection for guidance on creating a REST connection in EPM Cloud. Now, our next step is to concatenate the REST URL we are aiming to access, which in this case is (/aif/rest/V1/jobs/)***.

Figure 2: Groovy Editor

Figure 2: Groovy Editor

The script’s response will be in JSON format, similar to what was demonstrated earlier using the REST client (Postman). As JSON responses can be challenging to read and process, there are several classes available for managing JSON. In this case, I will use the “JsonSlurper” class.

Figure 3: Groovy Editor (Cont.)

Figure 3: Groovy Editor (Cont.)

In essence, the JSON body of the response is converted into a Map, containing key/value pairs. The “items” key is extracted as a list, and the first index entry is converted back to a Map. From this Map, the values corresponding to the “jobId,” “jobStatus,” and “executedBy” keys are extracted and stored for further use.

Before proceeding to the email section, let’s print the values to verify if the script is retrieving the correct values. This can be done by comparing the extracted values with the Data Management Process Detail.

Here’s the Result !!

Figure 4: Job Console

Figure 4: Job Console

Figure 5: Data Management Process Details

Figure 5: Data Management Process Details

Great! Moving on to the email section, let’s concatenate the details, add some HTML break tags to enhance readability, and declare a few variables to store the recipient’s email address and subject. We can then prepare the parameters for sending the email.

Figure 6: Groovy Editor (Cont.)

Figure 6: Groovy Editor (Cont.)

Now, let’s examine the sendmail portion of the script, which should be a POST request.

Figure 7: Groovy Editor (Cont.)

Figure 7: Groovy Editor (Cont.)

There you go !!

Figure 8: Sample Email

Figure 8: Sample Email

Certainly, consider this script as a foundational template and leverage the available REST features to enhance its functionality according to your specific requirements.

To attach the Groovy Rule to Data Loads, navigate to Data Exchange in EPM Cloud. Select the Integration where you want to send the notification and then go to Options, then select Business Rules. Add the event and provide all the necessary details to integrate the Groovy Rule with your Data Loads.

When configuring the Business Rule in the Integration, ensure that you choose the ‘After Load’ Event. This ensures that the attached business rule will be triggered immediately after the load step, allowing the Groovy script to retrieve details from the last executed job and send the notification accordingly.

Thank you for taking the time to read through this blog. I hope you find it beneficial.


메타데이터
post_id
c0ceb1d1decd
slug
epm-cloud-data-management-job-notification-using-groovy-brules-c0ceb1d1decd
url
https://medium.com/@vigneshpt8/epm-cloud-data-management-job-notification-using-groovy-brules-c0ceb1d1decd
canonical_url
https://medium.com/@vigneshpt8/epm-cloud-data-management-job-notification-using-groovy-brules-c0ceb1d1decd
author_url
https://medium.com/@vigneshpt8
status
ok
fetched_at
2026-06-22 17:31:34