Thursday 12 December 2013

How to execute ODI Scenario with a button in a Data Entry Form from Hyperion Planning 11.1.1.3


The goal of this post is to share with the insiders, the best technical/functional proposal.
This implementation is valid for EPM Suite 11.1.1.3 version (Hyerion Planning).
In particular, the development enables to implement a button into Data Entry Form (DEF) in Hyperion Planning that allows the execution of an Oracle Data Integrator scenario (ODI). 
The scenario ODI, in our case, changes the value of a Substitution Variable in Essbase.
As you can well imagine, we could be doing anything else much more complex than a simple change of the value of a Variable Substitution.
So, the steps to implement are:
  1. How to insert a button in Hyperion Planning 11.1.1.3 (Data Entry Form)
  2. How to call ODI Scenario
  3. Setup the parameters for run a ODI scenario
  4. Development ODI package for setup Substitution Variable in Essbase

Let's start...!!!

1. How to insert a button in a Hyperion Planning

To create a button in a form, we have to refer to the JavaScript file called "ValidateData.js" that allows us to create the controls at the level of form.
In this file, we can implement a JavaScript function that is already natively declared:
  • drawCustomButtons()
As can be seen, this function requires no input parameter and the implementation of the button occurs within the function itself.
Below is a piece of code of the function mentioned above:

drawCustomButtom() function








I have highlighted in blue how is builded the button. Substantially within the function there is a further called native function:
  • DrawCmdBtn(......);
that creates the button itself.
The "DrawCmdBtn" function receives a number of parameters, such as the example above.
After this step, we can see inside a DEF in Hyperion Planning something like this:


Data Entry Form with button (Setup Month)


WARNING!!!
  - If EPM suite installation was made under WebLogic, to see the changes made ​​to ValidateData.js  file you must perform a re-deploy of Hyperion Planning module (or restart the Hyperion Planning service)
  - If the installation was done under Apache, just refresh the page or the Data Entry Form in question.


2. How to call ODI Scenario

To run a scenario ODI we need to refer to the previous case, namely the creation of the button that calls a function which writes the entire contents of a web page in HTML.
Taking, therefore, for example:
  • DrawCmdBtn ("PlanningBtn", "Setup Month", null, "submitForm ()", "Setup Month");
will be called "submitForm()" function created specifically to write a new HTML page.

Below the "submitForm()":

submitForm() 1 of 2

and the piece of code for declared variables in ODI

submitForm() 2 of 2

The function starts and ends with an opening and closure tag <html>.

Within define the parameters for the call scenario ODI and related input variables that need to be initialized on startup of the same. In this case there is only one variable called "MONTH", which is enhanced by an HTML select list with the values ​​of the twelve months of the year.

At the end of the function create an additional button in the new web page named "Execute Scenario", as shown in the figure, that initiates the event execution of the scenario ODI.

At its clicks, the form is submitted containing the parameters ODI using the function "submitAction_1(form)"


Form HTML submitted

NOTE: This solution creates a new external web page respect to Hyperion Planning and therefore to Hyperion Workspace. From this page, the event is triggered by the execution of the scenario ODI.


External Web Page
ODI Scenario executed


3. Setup the parameters for run a ODI scenario

To run a scenario ODI via web is necessary to define the parameters in the following list and prepared in an HTML form.
The scenario ODI runs through to the call of Java servlets "StartScen."
  • agent_name: Network name or IP address of the machine running the agent.
  • agent_port: The listening port for the agent.
  • master_driver: JDBC driver used to access the main repository.
  • master_url: JDBC URL used to access the main repository.
  • master_user: Database user to connect to the main repository.
  • master_psw: Password for the database user. This password must be encrypted work_repository. Name of the repository in which the scenario to be executed is stored.
  • snps_user: User name ODI.
  • snps_psw: Password for the user name ODI.
  • scen_name: ODI scenario name.
  • scen_version: Version number of the scenario.
  • context_code: Context (Default: GLOBAL)
  • log_level: Defines the logging level for the execution of the scenario. All activities whose recording level is less than or equal to this value will be kept in the register until the end of execution. However, if the scenario ends abnormally, all activities will be held, regardless of this setting . This parameter is an integer from 0 to 5 (Default: 5).
  • http_reply: Type of the HTTP response. This response indicates whether the session has been started or not. Types of responses are possible XML, HTML, and text. The default is XML. The valid values ​​for this parameter are XML | HTML | TXT. In addition to the response in XML, HTML or text format, all responses from the HTTP servlet StartScen are returned as a cookie in the HTTP header.
In our example, the parameters were evaluated as shown below.

NOTE: Many of the values ​​associated with the parameters in question can be traced on the connection within the ODI Designer.

ODI Scenario Parameter 

As can be seen, to perform a scenario ODI it requires a number of parameters, of which two of them are of type password:
  • master_psw
  • snps_psw
which are respectively the password to log on as a user of the database, the first, and as an user ODI, the second.

These two passwords must be passed, necessarily, as encrypted values​​. To encrypt the passwords we use the utility "agent.bat". This installation ODI at the following path:
  • <ODI_HOME>\oracledi\bin
To run this utility, you must then move to the above path, through a shell (Windows/Unix), and run it as follows:
  • agent.bat ENCODE <password>
The encrypted value returned can be used as the value to associate with the passaword. Below is an example of its use:

Encrypt password

4. Develop ODI package

To run ODI scenario, we must first create one, then create a package. In this example we will create a package that will allow you to set a value for a substitution variable within Essbase.
Shown below is composed of only one variable called "MONTH" (which take the value that will be set on the substitution variable in Essbase) and from an OdiOSCommand component called "SET_MONTH". The first will be initialized when the scenario starts and the second will invoke a batch file which is passed to the variable initialized at execution time (as shown in the properties of the figure).
To verify the correct execution of the ODI package, we can view the ODI Operator and display the last completed job.


ODI Package

ODI Operator - Scenario to good end

The result of all the process can be viewed in Essbase Administration Services Console, where the substitution variable changes its value, for example from "May" to "Jun" .

Before modify substitution variable "MONTH"
After modify substitution variable "MONTH"

Ok guys, this is all...The first post is complete. If you have any question or comment, about this post or this blog, please write or send me email.

I hope that you appreciate.

Enjoy!!!

No comments:

Post a Comment