Pages

Tuesday, September 27, 2016

HFM Java API Part 1: Getting Started

Ok, Kscope16 went by and the conference was awesome. My summer holiday is also far gone and it was nice even though the weather could have been better (but hey, I live in Finland, not in Spain or Florida so some fluctuations are expected). After getting back to work in August I have been very busy helping a couple of customers who have gone live with their new HFM 11.1.2.4 environments or are in the process of doing so. But now it's time to update the blog again!

I did a presentation about the new HFM Java API in Kscope16 and was glad to hear that many developers are already using it to achieve some cool things - like Ricardo and Rodrigo of DEVEPM.com with their ODI KM (how's the paper doing guys? ;). I decided to release my short "Getting Started" document to public to make it slightly easier for to people to pick up JDeveloper and get their first project built using the Java API.

Link: Set Up New HFM API Project In JDeveloper (PDF document)

After getting the IDE ready you can start developing code for your Java program. In the next post I will concentrate on the coding part and show you examples of common tasks in HFM such as extracting data and running consolidations.

9 comments :

  1. Hey, the article is underway! Its on OTN for review! Please expect "Integrating ODI with HFM 11.1.2.4 – Metadata Knowledge Modules" very soon :)

    ReplyDelete
  2. In the manageDataOM class you can clear data using the clearData method; i am confused by the arguments required for sSliceToClear - I can't figure out if in the format of A#{IncomeStatement.[Base]) or something else...

    ReplyDelete
  3. I have used the following slice definitions to consolidate data using the API. I assume that the syntax should be the same for other functions using "slices" too. I think you should test if the Clear function requires all dimensions to be defined or not.

    "Slices" for consolidation:
    S#Actual.Y#2007.P#June;July;August.E#EastRegion
    S#Actual.Y#2007.P{[Third Generation]}.E#Geographical

    Another slice for extracting data:
    S#Actual.Y#2007.P#January.W#Periodic.E#{[Base]}.V#.A#{[Base]}.I#{[Base]}.C1#{[Base]}.C2#{[Base]}.C3#{[Base]}.C4#{[Base]}"

    ReplyDelete
    Replies
    1. I ended up doing this in the sdk-demo and it worked

      public class DataClear {
      public DataClear() {
      super();
      }//end Super

      public void clearDataSlice() throws HFMException {
      Application application = new Application();
      SessionInfo session = application.open();

      try {
      ManageDataOM managedataOM = new ManageDataOM(session);
      ClearDataOptions cleardataOptions = new ClearDataOptions();

      cleardataOptions.setSSliceToClear("S#Actual.Y#2005.P#January.A#[None].E#[None]");
      cleardataOptions.setBClearData(true);
      cleardataOptions.setBClearRatesAndSystemData(false);
      cleardataOptions.setBEnableDetailedLogging(false);

      managedataOM.clearData(cleardataOptions);


      } finally {
      application.close(session);
      } //end try finally

      }//end clearDataSlice
      }//end DataClear

      Delete
  4. Hi Henri,
    Thank for putting this up, really appreciate it. Just a quick question...would it be possible to connect to the HFM server using the HFM API from our local systems...say my computer is on the same network as the HFM box on the Exalytics Environment....can I connect to it using the HFM API libraries from my computer or would I need to go to the HFM box to setup my code....if yes, how.

    ReplyDelete
  5. Hi Henri,
    Can you please tell me how can I get all active or running session id in HFM using JAVA API?

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Hi Henri,

    Happy Christmas, I have a question that you maybe able to help with. I have coded a Web Service (using JAX-RS) that returns the HFM metadata, what I don't seem to be able to handle is the HFMException, this is being caught by the Tomcat Server. I would like to capture it within the JAX-RS framework. Any help would be much appreciated.
    Kind regards
    Graham Day

    ReplyDelete

Note: Only a member of this blog may post a comment.