Create the required connector or connectors in the Application Server. In this particular example, create a connector for the File eWay and another for the Oracle Applications eWay.
Navigate to the Application Server Admin Console at htt://localhost:4848.
Configure the parameters for your connectors under Resources > Connector > Connector Connection Pool and Resources > Connector > Connector Resources.
Launch NetBeans.
From the File menu, select Enterprise > EJB Module.
Create a new EJB project OracleAppsInvokeEJB
Launch the Oracle wizard by right—clicking on the OracleAppsInvokeEJB project and selecting New.
Select Other > SOA > Oracleapps OTD Wizard.
Click Next.
Enter the Oracle Applications database connection information, and click Next.
Select the Oracle Applications Business Function and Module for the project, and click Next.
Enter a name for the OTD.
An OTD and a JAR file containing the code corresponding to the above selected database objects are generated. The OTD is generated in the project at the location src/java/otds. The JAR file is added to the project libraries.
Create a JCA-driven MDB by navigating to the File menu, and selecting New Project > Enterprise.
Enter the required information for the JCA-driven MDB.
Select File Inbound RAR as the Inbound JCA.
Edit the Inbound File JCA configuration parameters in the following two dialogue windows.
An MDB is created.
In the generated MDB, drag Oracle Applications from the palette to invoke Oracle Applications.
Drag and drop the File JCA onto the onContents() of the MDB, and enter the parameters for the File eWay JCA Adapter declarations.
The Resource JNDI Name should be the same as that declared in the GlassFish Application Server (for example, Resources > Connector > Connector Resources)
Select the File OTD that is generated and click Finish.
The resulting Java template is created.
Drag and drop the Oracle Applications JCA onto the onContents() of the MDB, and enter the parameters for the Oracle Applications JCA Adapter declarations.
The Resource JNDI Name should be the same as that declared in the GlassFish Application Server (for example, Resources > Connector > Connector Resources)
Select the Oracle Applications OTD that is generated and click Finish.
The resulting Java template is created.
Implement the following Java code to the _execute_sample method:
private void _execute_sample(byte[] data, String encoding, com.stc.connector.fileadapter.appconn.FileClientApplication fileOTD,otdFinBudget. OtdFinBudgetOTD oraOTD) throws java.lang.Exception { int counter = 0; int budget_count = 0; int budget_error_count = 0; int request_ID = -1; String org_ID = "204"; // Set eWayID String eWayID = "B"; // Set GroupID String GroupID = "B"; // Set ObjectID String ObjectID = "B"; fileOTD.setText("1. =====> Insert record into Budget SB Staging table .."); fileOTD.write(); oraOTD.getSB_GL_BUDGET_INTERFACE().insert(); oraOTD.getSB_GL_BUDGET_INTERFACE().setBUDGET_ENTITY_ID (new java.math.BigDecimal("1000")); oraOTD.getSB_GL_BUDGET_INTERFACE().setBUDGET_ENTITY_NAME("RP_Opnames"); oraOTD.getSB_GL_BUDGET_INTERFACE().setBUDGET_VERSION_ID (new java.math.BigDecimal("1002")); oraOTD.getSB_GL_BUDGET_INTERFACE().setBUDGET_NAME("CORPORATE 1996"); oraOTD.getSB_GL_BUDGET_INTERFACE().setCURRENCY_CODE("USD"); oraOTD.getSB_GL_BUDGET_INTERFACE().setFISCAL_YEAR (new java.math.BigDecimal("1996")); oraOTD.getSB_GL_BUDGET_INTERFACE().setUPDATE_LOGIC_TYPE("A"); oraOTD.getSB_GL_BUDGET_INTERFACE().setSET_OF_BOOKS_ID (new java.math.BigDecimal("1")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD_TYPE("Month"); oraOTD.getSB_GL_BUDGET_INTERFACE().setDR_FLAG("Y"); oraOTD.getSB_GL_BUDGET_INTERFACE().setACCOUNT_TYPE("A"); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD1_AMOUNT (new java.math.BigDecimal("100")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD2_AMOUNT (new java.math.BigDecimal("200")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD3_AMOUNT (new java.math.BigDecimal("300")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD4_AMOUNT (new java.math.BigDecimal("400")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD5_AMOUNT (new java.math.BigDecimal("500")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD6_AMOUNT (new java.math.BigDecimal("600")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD7_AMOUNT (new java.math.BigDecimal("700")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD8_AMOUNT (new java.math.BigDecimal("800")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD9_AMOUNT (new java.math.BigDecimal("900")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD10_AMOUNT (new java.math.BigDecimal("1000")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD11_AMOUNT (new java.math.BigDecimal("1100")); oraOTD.getSB_GL_BUDGET_INTERFACE().setPERIOD12_AMOUNT (new java.math.BigDecimal("1200")); oraOTD.getSB_GL_BUDGET_INTERFACE().setCODE_COMBINATION_ID (new java.math.BigDecimal("17378")); oraOTD.getSB_GL_BUDGET_INTERFACE().setSEGMENT1("01"); oraOTD.getSB_GL_BUDGET_INTERFACE().setSEGMENT2("760"); oraOTD.getSB_GL_BUDGET_INTERFACE().setSEGMENT3("7420"); oraOTD.getSB_GL_BUDGET_INTERFACE().setSEGMENT4("0000"); oraOTD.getSB_GL_BUDGET_INTERFACE().setSEGMENT5("000"); oraOTD.getSB_GL_BUDGET_INTERFACE().setSB_EWAY_ID(eWayID); oraOTD.getSB_GL_BUDGET_INTERFACE().setSB_GROUP_ID(GroupID); oraOTD.getSB_GL_BUDGET_INTERFACE().setSB_OBJECT_ID(ObjectID); oraOTD.getSB_GL_BUDGET_INTERFACE().insertRow(); fileOTD.setText("2. =====> Counting record in Budget staging table ..."); fileOTD.write(); oraOTD.getSB_BUDGET_UTILS_PKG_FN_CNT_GL_BUDGET_INT().setP_GROUP_ID(GroupID); oraOTD.getSB_BUDGET_UTILS_PKG_FN_CNT_GL_BUDGET_INT().setP_OBJECT_ID(ObjectID); oraOTD.getSB_BUDGET_UTILS_PKG_FN_CNT_GL_BUDGET_INT().setP_EWAY_ID(eWayID); oraOTD.getSB_BUDGET_UTILS_PKG_FN_CNT_GL_BUDGET_INT().setP_CODE("A"); oraOTD.getSB_BUDGET_UTILS_PKG_FN_CNT_GL_BUDGET_INT().execute(); budget_count = oraOTD.getSB_BUDGET_UTILS_PKG_FN_CNT_GL_BUDGET_INT(). getRETURN_VALUE1().intValue(); fileOTD.setText(" returned Budget Count = ".concat( Integer.toString( budget_count ))); fileOTD.write(); fileOTD.setText("\nDone with Step 2"); fileOTD.write(); } |