Pages

Saturday, January 12, 2019

Groovy Series 1: Groovy + PBCS = New possibilities !!!

Groovy is the buzz word in Oracle EPM world and why shouldn’t it be. With the introduction of Groovy on EPBCS and PBCS+1 cloud options, it has made things so easy that everything seems to refreshed with Oracle EPM. On-premise version can also be enabled for Groovy, but it does not offer the groovy classes available on cloud.

EPBCS is the Enterprise Planning and Budgeting Cloud Service while PBCS + 1 is the base PBCS service with at least one Oracle module enabled. This module could be either one of Financials, Project Financials, Workforce or Capex.  Having either one of these opens up the system to have groovy capabilities.

Having capabilities to code in groovy programming language essentially makes PBCS a mini platform to play around with PBCS objects and anything with the data grid. Long back in the days of on-premise planning, we had the option to provide form validations using javascript which were replaced with data grid validation rules. Now imagine, having a similar javascript kind of capability with 10 times the power and ability to access all planning objects and data to play around. This is how groovy capabilities can be summarised.

What is Groovy?

18.11.1.1
        18.11.1.2
Groovy is a java syntax compatible object oriented language
  • Because of its optionally typed nature, it allows writing less code as compared to Java or any other traditional programming language
  • Runs on Java Platform (JVM)
  • Available with EPBCS, PBCS+, On-Prem Planning to give additional programming capabilities to Planning product
  • Can be accessed in Calc Manager under the “Edit Script” option on cloud environments
Opening up the system with options to code in a programming language as strong as Groovy,  makes life much easier and system robust. It gives numerous opportunities to think about any problem from all different perspectives or rather easy perspective !!!
If you have either EPBCS license or PBCS+1 license, the Groovy is accessible from Calc Manager. In Calc Manager, navigate to edit script mode, on right hand side, you have another drop down to choose script type.

18.11.1.3

Groovy is not there to replace Calc scripts or business rules, but complements each other. For example, using a IF within Calc scripts requires a member block within a FIX. What if we can write FIX based on certain conditions or want to execute a calc only when it fulfills certain condition? This is where groovy helps to generate the calc script on conditional basis. This not only reduces the length of the code, also the processing time.

Understanding Groovy structure:
Groovy follows the object oriented approach of programming and all methods and attributes are linked to an object. All objects are grouped under classes and creating an object of certain type gives access to all attributes and methods for that object.
Unlike Java, there is no main function to locate the start of a program. Scripting nature of groovy enables writing programs as any regular script, creating an object just by providing a name of the class.

Usage of Groovy with Oracle EPM cloud can be accessed from below URLs:
EPBCS Groovy Documentation: https://docs.oracle.com/cloud/latest/epm-common/GROOV/
Groovy Script Examples: https://docs.oracle.com/cloud/latest/epm-common/GROOV/groovy-examples.html

Apart from methods and classes available in the documentation, many other classes, objects and methods available in groovy can be used in EPM.
The root object of groovy scripts in PBCS is EPMScript. It is the base class for all EPM groovy scripts. Apart from this, the most important object is ‘Operation’. Operation represents the operation carried out on application. it is essentially used with operations performed on grid and thus the script can be triggered on any operation:
  • before load form
  • after load form
  • before save form
  • after save form
These are options similar to what we have for execution of business rules, but with groovy the options allow to run groovy rule before or after the form load or save. One common example is of validation check which can be run before form save to allow valid data goes into database and stop data save if its not. 

None the less, groovy opens up new avenues to control and configure the business rules and User Interface functionality. I will continue to add more examples of how groovy is evolving the PBCS into an overall new platform.

No comments:

Post a Comment