About Creating a Groovy Business Rule

Note:

You can use Groovy rules only for applications of type "Enterprise" (available with Enterprise PBCS or PBCS Plus One licenses), Strategic Workforce Planning, Sales Planning, and FreeForm.

Groovy business rules allow you to design sophisticated rules that solve use cases that normal business rules can't solve; for example, rules to prevent users from saving data on forms if the data value is above a predefined threshold.

You create Groovy rules in Calculation Manager and execute them from any place that you can execute a calc script rule in a business process; for example, on the Rules page, within the context of a form, in the job scheduler, in dashboards, in task lists, and so on. Groovy rules are also supported in rulesets. You can have a combination of calc script rules and Groovy rules within a ruleset.

Oracle supports two types of Groovy rules:

  • Rules that can dynamically generate calc scripts at runtime based on context other than the runtime prompts and return the calc script which is then executed against Oracle Essbase.

    For example, you could create a rule to calculate expenses for projects only for the duration (start and end dates) of the project.

    Another example is a trend-based calculation that restricts the calculation to the accounts available on the form. You could use this calculation for various forms in Revenue, Expense, Balance Sheet, and Cash Flow. This allows for optimization and reuse.

  • Pure Groovy rules that can, for example, perform data validations and cancel the operation if the data entered violates company policies.

Watch this tutorial video to learn best practices in moving modified data using Groovy Rules and Smart Push.

Video iconMoving Modified Data Using Groovy Rules and Smart Push

Watch this tutorial video to learn how to improve calculation performance on business process forms by creating context-specific, dynamic business rules using the Groovy scripting language.

Video iconCalculating Modified Data Using Groovy Rules

Note:

For Enterprise applications, a Java API reference is available to use as you create Groovy rules. To view the technical reference for designing Groovy rules, see the Java API Reference for Oracle Enterprise Performance Management Cloud Groovy Rules on the cloud help center. You can also access this reference from the Oracle Enterprise Planning and Budgeting Cloud Academy. To access the Academy, sign in, and then click Academy.

The Java API reference includes examples that demonstrate the syntax and power of the EPM Groovy object model. To view examples, open the Java API Reference for Oracle Enterprise Performance Management Cloud Groovy Rules. Then take an action:

  • On the main page, scroll down to Example Groovy Scripts, and then click the word here in the sentence about sample Groovy scripts.
  • In the left pane, under All Classes, click the StrategicModel Class.