Dayalan Punniyamoorthy Blog

Showing posts with label Calculation Manager Groovy. Show all posts
Showing posts with label Calculation Manager Groovy. Show all posts

Sunday, May 7, 2023

EPBCS Groovy Rule series-2, One rule for multiple Data forms do the calculation!

In this second part of the blog, let's explore how to reuse the same Calculation Manager Groovy rule by attaching the rule to multiple data forms to perform different actions in each data form.

The Groovy Calculation Manager rule is dynamic, it gets the account member from the data form, and depending on the selected account member the rule will perform a specific calculation. 




We can use the same rule and attach it to multiple Data forms. 

Let's see how the rule looks,

// Capture the edited periods and products
Set<String> editedMembers = []
operation.grid.dataCellIterator({DataCell cell -> cell.edited}, MemberNameType.ESSBASE_NAME).each { DataCell cell ->
        //editedMembers << cell.periodName << cell.getMemberName("Product")
        editedMembers << cell.periodName << cell.getMemberName("Years") << cell.getMemberName("Product") << cell.getMemberName("Customer")
    }
if(editedMembers.size() == 0){
    println("No edited cells found!")
    return;

Thursday, May 4, 2023

EPBCS Groovy Rule series-1, Focused calculation based on the selected account!

This blog post will demonstrate how to carry out a targeted calculation using the accounts you've chosen from the Data Form's Page.


Product and Customers on the Rows, on the Data Form.

The Data Form allows for the selection of a single account from a group of accounts in order to perform the calculation. A specific calculation will be performed depending on the account chosen by the members on the POV and on the Page of the Data from the rule related to the Data Form.

Really neat and effective, huh?

Let's look at the Calculation rule that makes this possible.

Wednesday, November 16, 2022

Calling Data Management Rule from Calculation Manager rule using Groovy!

null

This was always a special request from multiple customers Can I run Data Management rules from a form?  For quite a while the answer was sorry you cannot. But with Groovy + Calculation Manager you can do that. Yes, you can call the Data Management rule from a Calculation manager rule and attach the Calculation Manager rule to a Menu and attach that Menu to the Form, so the users can run them when needed.

The next question is if the User id is not an Admin user, will he be still able to run the Data Management rule. As per the Oracle EPM security setup you cannot.

But you can overcome this by using Connections either by using On Demand Connections or Named Connections.

A Brief intro on when to use when, (from the Oracle document)

In general, connections can be created in one of two ways:

On-demand connection

  Connection connection = connection(http://server:port/HyperionPlanning/rest/v3/applications/Vision, "user", "password")
These connections are easy to change and are great for prototyping and trying out connections.

Named connection

  Connection connection = operation.application.getConnection("Job Definitions")
These connections allow clean separation between resource details and usage. This has multiple benefits over on-demand
connections including:

  • Ease of maintenance - Reuse a connection definition in multiple scripts. Any changes to the definition will automatically apply to all scripts using the named connection.
  • Enhanced security - with on-demand connections, confidential information such as passwords and API keys are visible to anyone who can edit the Groovy script. With named connections, sensitive information can be encrypted and stored securely and cannot be seen or retrieved by Groovy scriptwriters.
  • Ease of use - simplifies the creation of connections to first-party resources such as Oracle Cloud Services.