Business Intelligence – Oracle

Oracle BI EE 10.1.3.4.1 – Scheduling Essbase/Planning Calculation Scripts – Action Framework & Custom Java Remote Procedure calls

Posted by Venkatakrishnan J on May 21, 2009

In the blog entry here, i had shown you how to run an essbase calculation script from the BI EE dashboards. To make it even more complete, lets look at a means of calling a calculation script through BI Scheduler. So, our idea is to use BI EE as a scheduler to schedule Essbase/Planning calculations. In order to do that there are certain pre-requisites. I have covered this in my blog entry before here. Once the setup is done, lets open the JDeveloper and create a new project. Include the schedulerrpccalls.jar, Ess_japi.jar and Ess_es_server.jar as part of the project properties.

The idea is to basically write a custom java program which in turn will run an Essbase calculation script through the Java API. The java program would then be bundled in the form of a jar file and called from an iBot. Use the below code to login to Essbase and then to execute the calculation.

package bischeduler;

import java.io.*;

import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJavaExtension;
import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJobInfo;
import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJobException;

import com.essbase.api.base.*;
import com.essbase.api.dataquery.*;
import com.essbase.api.session.*;
import com.essbase.api.datasource.*;
import com.essbase.api.domain.*;
import com.essbase.api.metadata.*;

public class BIScheduler implements SchedulerJavaExtension{
    public BIScheduler() {   

        String s_userName = "admin";
        String s_password = "password";
        String s_olapSvrName = "localhost";
        String s_provider = "http://localhost:13080/aps/JAPI";

        try
        {
        IEssbase ess = IEssbase.Home.create(IEssbase.JAPI_VERSION);
        IEssDomain dom = ess.signOn(s_userName, s_password, false, null, s_provider);
        IEssOlapServer olapSvr = (IEssOlapServer)dom.getOlapServer(s_olapSvrName);
        olapSvr.connect();

        IEssCube cube = olapSvr.getApplication("Global").getCube("Global");
        String maxLstat = "import database 'Global'.'Global' data connect as 'global' identified by 'global' using server rules_file 'UnitsLd' on error abort;";
        //cube.loadData(IEssOlapFileObject.TYPE_RULES,"UnitsLd",0,"SH",false,"global","global");
        cube.calculate(false,"CalcAll");
        //cube.beginDataload("UnitsLd",IEssOlapFileObject.TYPE_RULES,"global","global",0);
        //IEssMaxlSession maxLsess = (IEssMaxlSession)dom.getOlapServer(s_olapSvrName);
        //maxLsess.execute(maxLstat);
        }catch (EssException x){
            System.out.println("ERROR: " + x.getMessage());
        }

    }
    public void run(SchedulerJobInfo jobInfo) throws SchedulerJobException{
        new BIScheduler();
        System.out.println("JobID is:" + jobInfo.jobID());
        System.out.println("Instance ID is:" + jobInfo.instanceID());
        System.out.println("JobInfo to string is:" + jobInfo.toString());
    }
    public void cancel(){};

        public static void main(String[] args) {
        new BIScheduler();

    }
}

Once this is done, create a deployment profile to bundle the code as a jar file. Ensure that the deployment also bundles the 3 jar files mentioned above. Then deploy the jar file.

Now copy the deployed jar file to the {OracleBI}\web\javahost\lib directory (or a directory that you have mentioned as the lib path in the Java host config.xml). Now create an ibot and then in the advanced tab call the deployed jar file as shown below.

You can create ibots in such a way that once the java class run is completed, it would trigger another ibot to deliver a report based on an Essbase cube. This will ensure that the administrator is sure of the fact that the calculation has run successfully.

Now you should be able to run essbase calculations from BI Scheduler directly.  One can even run ODI packages using BI EE. I would cover that as well in future. Keep watching this space next week for a method to do write backs into Essbase. I would present a couple of methods and both of them can be used effectively in a prod like environment.

About these ads

5 Responses to “Oracle BI EE 10.1.3.4.1 – Scheduling Essbase/Planning Calculation Scripts – Action Framework & Custom Java Remote Procedure calls”

  1. essbase.ru said

    Hi
    Thank’s for u information.

    Can u provide how-to shedule Business Rules (not CalcScript) ?

  2. Cederash said

    Млин, спамеры просто достали уже этим своим примитивом!

  3. Ferinannnd said

    Почему подписка еще бесплатная? :))

  4. I am thankful for the new things I learned reading your post. Thanks.

  5. OBIEE beginner said

    In one of my requirement the report should display + before the column

    heading so that the column Collapse and Expand mechanism should happen

    Once If the user clicks the Grand Total column in the report, only he should be able to see the

    Grand total Row.The detailed rows should be hided. Once if the user clicks again on the same

    Grand total Column he should be able to get the detailed rows of the report. .( The same for

    sub totals aswell). Is there a way to implement it in OBIEE.

    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 151 other followers

%d bloggers like this: