Moving Modified Data Using Groovy Rules and Smart Push

In this topic, we’ll show you best practices on how you can use Groovy rules and Smart Push to move modified data into a reporting cube.

On a data form, users can modify employee salary and assign a Reporting Manager. After the form data is saved, Smart Push is run to copy data to the reporting cube for analysis. Then, dimensions are also consolidated, if necessary, as the data is being copied.

If the form contains hundreds of rows of data, all of that data is checked against the configured data map, processed for dimension consolidation, if any is set, and then pushed to the reporting cube. Depending on the amount of data on your form, this process may take a while to complete.

You can improve the performance of data synchronization between your input and reporting cubes by designing a Groovy rule that identifies and isolates the data you modified, and pushes only the isolated data into your reporting cube.

For example, we configured a simple data map for Smart Push that maps dimension members from our input cube to our reporting cube.

Groovy Rule Example Data Map for Smart Push

Then we prepared forms that display data from our input and reporting cubes.

Groovy Rule Input Cube Form

Groovy Rule Reporting Cube Form

The form used for data entry has Smart Push enabled and uses the form’s context to push data for all the members selected for the dimensions defined on the form.

Groovy Rule Form Showing Smart Push Enabled and Form Context Used

For the Groovy rule, here’s the entire script.

Groovy Rule Script Example

The script starts by identifying the associated data map for smart push.

Groovy Rule Script Showing the Associated Data Map

This section of the script uses the dataCellIterator method to identify edited cells and isolates them.

Groovy Rule Script Showing dataCellIterator Method

Then, this section takes the isolated data and runs the focused data movement using Smart Push and the data map configured and associated with the form. A message displays when modified data is moved to the reporting cube.

Groovy Rule Script Showing Push Data for Edited Employees Only

If there are no modifications, a message displays when there are no changes and data was not moved to the reporting cube.

Groovy Rule Script with Message Data

After we created this Groovy rule, we deployed it the same way we deploy business rules.

Groovy Rule Deploy

Then, in form management, associated it with the form. The Groovy rule runs after the form data is saved.

Groovy Rule Associating with a Form

Groovy Rule Run After Save

To run the Groovy rule, open the form in Input Cube, make some changes, and then click Save.

Groovy Rule Run On Save

Once saved, the updated data will display in the reporting cube.