2 Replies Latest reply on Jan 14, 2019 8:54 PM by Jeo123

    Data extract issue using HFM JAVA API




      I am trying to perform data extract using JAVA API in HFM We are in the process of converting VB code to JAVA. I am stuck with one of the method which is being used in old system. It is EnumDescendants. Can you please help me?


      I have few more questions.


      1) Also is there any way we can pass level to extract the data.

      For e.g. I want to extract data for all Level 1 account members.


      2) How can I retrieve the entities by OGP (Org by period) using new JAVA API.




        • 1. Re: Data extract issue using HFM JAVA API

          I don't know the Java API, but within HFM you request 'Base' members in the Entity, ICP, Account, or Custom dimensions. HFM does not have a concept of "Level 1" for these dimensions.


          If you have OrgByPeriod you must use 'Node' rather than 'Entity', and the function must pass the Parent Entity, Scenario, Year, and Period parameters.


          - Chris

          • 2. Re: Data extract issue using HFM JAVA API

            If I'm reading your post correctly, you're trying to replace the EnumDescendents function from the legacy API's correct?  The functionality for that has been consolidated into the MetadataFilter object.  This works along side the MetadataView Options.  The code below is a section from a program of mine.  This would get you all descendants of TOTAL_COMPANY.  There are several additional filters I've set, the details of which can be found in the HFM Java Doc.


            metadataOM = new MetadataOM(sessionInfo);

            MetadataFilter MDfilter = new MetadataFilter();



            MetadataViewOption MDview = new MetadataViewOption();










            RecordSetRange range = new RecordSetRange();





            List<Member> memList;







            memList = metadataOM.getMembers(MDfilter, MDview);



            Memlist can then be iterated through for whatever you need.



            As for your other questions, Data Extract relies on passing a point of view.  Rather than trying to figure out how to do it via the Java API, the better approach would first be to make sure you can define your POV in the application.  After that, you can create that same POV easily in Java. 


            When using the extract functionality and passing multiple members for a dimension, you can either use a List such as A#{[Base]} or as a semi colon delimited list.  It's the same way the front end POV select works over the web.  You can either manually select members(equal to the semicolon delimited list format) or just pass a single list. As Chris mentioned, since HFM doesn't have a Level 1 memberlist, you can't do Level 1, but you can do Base.  You would have to build the logic into your java program if you wanted that(so possibly do something like check to see if the children of an account were base and if so, add it to the semi-colon delimited list).


            I don't have an Org By Period application, so I can't give you specifics on how you would get the information specific to that, but the MetadataView object has an OrgByPeriodFilter.  You'd have to dig through the Java Doc a bit to try and figure out how to use it though.