Oracle Documentation

Moving modified data using Groovy and SmartPush

Before you begin

This 15-minute tutorial shows you how to push data from a source location to a target location using Groovy rules and smart push.


Planners can now push data from a source location to a target location via Groovy rules. The EPM object model allows script writers to use the SmartPush object to perform the data push operation. A SmartPush object will automatically scope the data that is pushed based on the shape of a grid if one is provided. The push can be further scoped by specifying an override members map and override exclusion members map. In this exercise you will push data in context of a grid by further scoping it down to only edited employee data.

What do you need?

An EPM Enterprise Cloud Service instance allows you to deploy and use one of the supported business processes. To deploy another business process, you must request another EPM Enterprise Cloud Service instance or remove the current business process.

  • Have Service Administrator access to EPM Enterprise Cloud Service. The instance should not have a business process created.
  • If you haven't already, register for a free Oracle Cloud Customer Connect account so you can access the required files. Upload and import this Planning snapshot into your environment. If you've previously uploaded the snapshot for another Groovy tutorial, you can continue using the same snapshot.

For more information on uploading and importing snapshots, refer to the Administering Migration for Oracle Enterprise Performance Management Cloud documentation.

The scripts you need for this tutorial are linked as text files within each section.

Pushing edited Planning data to a reporting cube

In this section, you implement a Groovy script to push data for edited employees in Planning to the reporting cube.

  1. Open Calculation Manager and create a rule named Groovy Push Employee Data in the Plan2 cube.
    New Object
  2. In the Rule Editor, change the Designer option to Edit Script and set the Script Type to Groovy Script.
    Rule Editor Options
  3. Copy this script and paste it into the editor:
    if(!operation.grid.hasSmartPush("Employee Data"))
    // Capture the employees whose Salary and/or Reporting Manager were edited
    Set<String> employees = []
    operation.grid.dataCellIterator('Salary', 'Reporting Manager').each { DataCell cell ->
    	if(cell.edited) {
        	employees << cell.getMemberName("Employee") 
    if(employees) {
    // Push data to the reporting cube for edited employees only
    	String employeesStr = """\"${employees.join('", "')}\"""" 
    	operation.grid.getSmartPush("Employee Data").execute( [ "Employee" : employeesStr ] ) 

    Check if the grid has a SmartPush named “Employee Data” associated with it. If not, no further processing is required, so return from the script.

    Iterate over the Salary and Reporting Manager cells that have been edited and collect the unique employee names.

    Convert the set of unique employee names to a String with employee names quoted and separated by a comma. For example: “Employee 1”, “Employee 3”.

    Push the data for the edited employees to the reporting cube.

    You can exclude members from the data push by providing an exclusion members map when executing the SmartPush as follows:

    if(employees) {
    	//Push data to the reporting cube for all edited employees except No Employee
    	String employeesStr = """\"${employees.join('", "')}\""""
    	operation.grid.getSmartPush("Employee Data").execute(["Employee" : employeesStr], 
        	["Employee" : "No Employee"])
  4. On the toolbar, click Save (Save) to save the script, then click Validate and Deploy (Validate and Deploy) to validate and deploy the script. Click OK when prompted. Close the Calculation Manager window.
    Successful Deployment

Adding the rule to a form

In this section, you add your Groovy script rule to the ManageEmployees form, to be run after saving.

  1. Navigate to Forms (under Create and Manage) and select the ManageEmployees form.
    Form Manager
  2. Edit the form. Add the Groovy Push Employee Data rule and set it to Run After Save. Save the form and close the Form Manager window.
    Run After Save

Testing the Groovy rule

In this section, you test your Groovy rule by editing data in the Employees dashboard.

  1. From the Planning Home page, click Dashboards. Open the Employees dashboard.
    Employees Dashboard
  2. For Employee 1, edit Salary data and set Reporting Manager to John S.
    The ManageEmployees form with highlighted cells.
  3. Save the form (not the dashboard).
    Save the form.
  4. The changes are reflected in the ManagerReport form.
    The ManagerReport form with saved changes.

Next tutorial

Calculating Modified Data Using Groovy

Want to learn more?

Copyright © 1995, 2020, Oracle and/or its affiliates.