Our News | Taysols

Oracle EPM Cloud: Groovy Templates - User Variables

Written by Taysols | Aug 4, 2020 4:31:38 AM

In our previous post, we demonstrated using a Groovy template for data validation. In this blog, we will explain another Groovy Template for User Variables within Oracle’s EPM Cloud.

User Variables are commonly used in EPM applications from dynamic filters in data forms to business rules. User Variables are created by system administrators and are associated with a specific dimension. Once User Variables are defined and implemented in the application, users will need to update their values. This is done by accessing User Preferences.

In this demonstration, we will show how we can make a Groovy Template to let Planning users set their User Variables by accessing a Task List instead of the standard interface. Allowing users to set their variables via Task List offers flexibility and consistency when navigating Planning tasks.

To start with the Groovy script, we will need to define a Calculation Manager variable to prompt users to select a member value for their variable. Then, we need to retrieve the User Variable and set the values based on user selection.

The script will look like this:

In this script example; it will prompt the user to select a value and save it for a user variable called “Year”.

What if we need to set more than a user variable?

If that is the case, then it’s best to use a template to create a Groovy script that can be used to update any user variables.

Like in the previous post, we will create a text-based template and modify the script to make it dynamic.

To do so, we will need three Design Time Prompts (DTP):

  1. DTP for the dimension that’s associated with the user variable
  2. DTP for the user variable
  3. DTP for the value

The same script can be used in the template with few changes to include the DTP variables, making the script more dynamic and reusable for any user variable.

Now we have the template ready.

We will create a business rule for every user variable that needs to be updated. In this example, we have two variables for Entity and Year dimensions, so we need to create two business rules and use the Groovy template.

To use the template in the business rule, drag and drop the object into the main rule body and select the DTP values. In this example, the DTP values are for the UV_Year and the business rule.

Once the Business Rules are created, validated and deployed, we can assign them to a Task List. By giving Planning users access to the Task List and assigning launch access to the business rules, Planning users will be able to select their User Variables directly from the Task List.

Finally, let’s verify the business rule is working and select a member for Entity User Variable. The rule should prompt the user to choose a value from the Entity dimension.

After successfully testing the business rules, we can verify the variables are successfully being updated by navigating to user preferences and seeing if the variables are listed, as seen below:

And that’s it. You’ve successfully created a Groovy Template allowing for Planning users to set their User Variables and enhance standard out of the box function of your Oracle EPM Cloud.

Want to know more about maximising your Oracle EPM solution? Contact us.