Forum Stats

  • 3,757,480 Users
  • 2,251,236 Discussions
  • 7,869,840 Comments

Discussions

FDMEE Jython scripting

samacnt
samacnt Member Posts: 206
edited Jan 15, 2015 7:34AM in Financial Data Management

Hello all,

I am new to FDMEE, Classic FDQM. I am up to a task to convert some of the VB scripts from release 113 into Jython scripts which will be compatible with FDMEE in EPM 123.

When I try to  execute the Java APIs for FDMEE I am getting errors in the script, The environment is set properly as all the APIs are identified correctly by the Eclipse editor and I no longer get the NoClassDefinedException.

I tried executing getEPMOracleHome() from the FDMEE APIs but it is throwing an exception, basically I think somewhere I am missing the life cycle to implement FDMEE APIs in the Jython Code..

Can anyone tell me the life cycle to implement  these APIs or any Document which shows me how can I start FDMEE Coding in Jython?

Thanks

Arpan

Tagged:
Muhammad Jahanzeb

Answers

  • Hi Iarpan,

    Have you included the initialization code from the 'Using JAVA IDE to Develop Scripts' section of the FDMEE admin guide? If not you would get exceptions. If not you can add this to the start of your script in Eclipse:

    #Start Initialize Code
    #Required for Dev Mode. Not required in production script
    import java.math.BigDecimal as BigDecimal
    import java.sql as sql
    import com.hyperion.aif.scripting.API as API
    fdmAPI = API()
    conn = None
    conn = sql.DriverManager.getConnection("jdbc:oracle:thin:@server:1521:orcl", "user", "password");
    conn.setAutoCommit(False)
    fdmAPI.initializeDevMode(conn);
    print "SUCCESS CONNECTING TO DB"
    fdmContext = fdmAPI.initContext(BigDecimal(1720))
    #End Initialize Code Required for Dev Mode. Not required in production script
    

    HTH

    Regards

    Craig

    samacntMuhammad Jahanzeb
  • Francisco Amores
    Francisco Amores Member Posts: 1,693 Bronze Crown
  • samacnt
    samacnt Member Posts: 206

    Though I could make some progress I am still getting errors with the above piece of code

    I could successfully connect with database with above piece of code but I am still getting error for the line number 12.

    it says:

    java.lang.AbstractMethodError: java.lang.AbstractMethodError:com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.isClosed()Z

    Can you help?

  • samacnt
    samacnt Member Posts: 206

    The thing is I am yet to successfully execute any of the FDMEE APIs available, though I can connect successfully with the database with the piece of code you shared

    Is there anything that is needed to be done to get this done, am I missing anything in the environment setup

  • Francisco Amores
    Francisco Amores Member Posts: 1,693 Bronze Crown

    1720 is the loadID.

    Make sure that you passed a valid load if.

    You can check process ids in many places like process details page or logs folder.

    BTW, the code Craig posted is for Oracle but your exception shows SQL Server.

    Please can you paste your script here?

    Regards

  • samacnt
    samacnt Member Posts: 206

    Hello Francisco,

    This is the code that is giving me error:

    if __name__ == '__main__':

    print "hello"

    import java.math.BigDecimal as BigDecimal 

    import java.sql as sql 

    import com.hyperion.aif.scripting.API as API 

    fdmAPI = API() 

    conn = None 

    conn = sql.DriverManager.getConnection("jdbc:sqlserver://localhost\\MSSQLSERVER;user=sa;[email protected]"); 

    conn.setAutoCommit(False) 

    fdmAPI.initializeDevMode(conn); 

    print "SUCCESS CONNECTING TO DB" 

    fdmContext = fdmAPI.initContext(BigDecimal("2"))

    print "hello"

    and this is the output/error that am getting now

    hello

    SUCCESS CONNECTING TO DB

    Traceback (most recent call last):

      File "C:\FDMEE\SCRIPTS\Src\Test2.py", line 12, in <module>

        fdmContext = fdmAPI.initContext(BigDecimal("2"))

        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196)

        at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1454)

        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:388)

        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:338)

        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)

        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)

        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185)

        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160)

        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:281)

        at com.hyperion.aif.scripting.API.initContext(API.java:817)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

    com.microsoft.sqlserver.jdbc.SQLServerException: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'AIF_PROCESSES'.

    The Load ID that you can see is an id I could generate after executing a data load process through FDMEE, not sure if this is exactly what should I be giving there..

    Thanks

    Arpan

This discussion has been closed.