A Configuring Auditing for Interoperability Transactions

This appendix contains the following topics:

A.1 Overview

Audited columns in a table can be updated by transactions that originate outside of JD Edwards EnterpriseOne through an interoperability model. When this occurs, JD Edwards EnterpriseOne creates an audit record for the transaction, but the system records only a portion of the audit information, such as the audited column, before and after values, and recorded columns. The audit information will not include a GUID, application ID, workstation name, or IP address, unless you configure the interoperability model to pass this data to the audit record.

Oracle provides audit APIs that enable the transfer of audit information from these interoperability types:

  • Business services

  • Java connector

  • COM connector

  • WSG or XPI

This table describes the audit record columns, the API used to pass the data to the columns, and the values that you enter as parameters for the API:

Audit Record Column API Value for API Parameter
GUID setGUID Enter an available GUID. If you do not enter a GUID, the API generates a new GUID.
ApplicationID setApplicationID Enter the application ID. If you do not enter an application ID, the API passes "INTEROP" for this value.
WorkstationName setWorkstationName Enter the workstation name. If you do not enter a workstation name, the API passes the local workstation name for this value.
IPAddress setIPAddress Enter the IP address. If you do not enter an IP address, the API passes the IP address of the local workstation.

Oracle provides two sets of these APIs to pass audit information from interoperability transactions. The set of APIs used depends on the interoperability model being employed, as described in this table:

Interoperability Model API Set Platforms
WSG or XPI, Java connector, and business services JAVA APIs JD Edwards EnterpriseOne supported platforms
COM Connector C APIs WIN 32 platforms

For more information about the APIs, see the JD Edwards EnterpriseOne Tools Release 8.98 API Reference Guide on My Oracle Support Web site.

A.2 Reference Implementations for Auditing

The instructions in this chapter use reference implementations to describe how to configure interoperability models to pass audit information. Reference implementations are samples of fully functional code that you can use as an example for setting up or testing these interoperability implementations:

  • Business services

  • Java connector

  • COM connector

  • WSG or XPI

Note:

Each section in this chapter includes the location of the resources and files for the reference implementations.

A.3 Configuring a Published Business Service to Pass Audit Information

This section provides an overview of configuring a published business service to pass audit information and discusses how to:

  • Configure RI_AuditAddressBookManager to pass audit information.

  • Configure RI_AuditInsertABStagingManager to pass audit information.

A.3.1 Overview

You can configure a published business service to pass audit information to an audit record. To do so, you must create a new published business service class that extends from an existing published business service class—the class that invokes a business function or database operation.

A.3.1.1 Using Reference Implementations to Test a Business Services Auditing Configuration

The tasks in this section use reference implementations to describe how to configure business services to pass audit information. You can use the reference implementations to configure and test an auditing configuration, which includes these high level steps:

  1. In Object Management Workbench (OMW), add the reference implementations to a project and then follow the instructions in this section that describe how to configure the reference implementations for auditing.

  2. Add the references implementations to a package and deploy them in a test environment.

    See "Working with Packages for Business Services" in the JD Edwards EnterpriseOne Tools Package Management Guide.

  3. Run the reference implementations.

Note:

Reference implementations are intended for test purposes only. Do not use them in a runtime environment.

A.3.2 Configuring RI_AuditAddressBookManager to Pass Audit Information

The RI_AddressBookManager reference implementation is an example of a published business service that adds an address book record to JD Edwards EnterpriseOne. This section describes how to use the RI_AuditAddressBookManager reference implementation to extend the RI_AddressBookManager so that audit information is passed to an audit record when an address book record is added to the system.

For more information about the RI_AddressBookManager reference implementation, see the JD Edwards EnterpriseOne Tools 8.98 Interoperability Reference Implementations Guide on My Oracle Support.

Oracle provides the JPR95001 – RI_AuditAddressBookManager reference implementation, which you can use to extend the RI_AddressBoookManager published business service to pass audit information.

This table describes the components of JPR95001 –RI_AuditAddressBookManager and the location of these components in the JD Edwards EnterpriseOne installation directory:

Reference Implementation Component Description Location
RI_AuditAddressBookManager A published business service class that extends the AddressBookManager reference implementation so that it inserts an address book record with audit information. B9\STAGINGA\java\source\oracle\e1\bssv\JPR95001
auditAddAddressBook A method in the RI_AuditAddressBookManager that is used to insert an address book record with audit information. This method uses the addAddressBook method of the RI_AddressBookManager class to insert the address book record. Same as previous.
RI_AuditAddAddressBook The value object class that contains get and set methods for the GUID, application ID, workstation name, and IP address. B9\STAGINGA\java\source\oracle\e1\bssv\JPR95001\valueobject

To configure the RI_AuditAddressBookManager reference implementation to pass audit information:

  1. Create a new value object class that extends the value object class of the existing published business service class.

    For example:

    public class RI_AuditAddAddressBook extends RI_AddAddressBook implements⇒
     Serializable
    

    In this example, RI_AuditAddAddressBook is the new value object class.

    RI_AddAddressBook is the value object class of the RI_AddressBookManager published business service class.

  2. In the RI_AuditAddAddressBook value object, add fields for the GUID, application ID, workstation name, and IP address audit information.

    Generate accessors (get and set methods) for these fields.

  3. Create a new published business service class to extend the existing published business service class.

    For example:

    public class RI_AuditAddressBookManager extends RI_AddressBookManager{
    }
    

    In this example, RI_AuditAddressBookManager is the new published business service class that is extending the existing published business service, RI_AddressBookManager.

    RI_AddressBookManager adds an address book record. RI_AuditAddressBookManager is the class that uses the RI_AddressBookManager class to insert an address book record into the address book table with audit information.

  4. Add the new published business service method that adds an address book record with audit information.

    This new method uses the published method of the existing published business service class to add the address book record. Make the new value object class, which was created to pass the audit information, a parameter of this method.

    For example:

            public RI_ConfirmAddAddressBook 
           auditAddAddressBook(RI_AuditAddAddressBook vo) throws 
          BusinessServiceException
    

    In this example, auditAddAddressBook is the method that is used to add an address book record with the audit information. This method uses the addAddressBook method of the RI_AddressBookManager class to add the address book record.

    The new value object, RI_AuditAddAddressBook, is passed as a parameter of the auditAddAddressBook method. The return value of the auditAddAddressBook method is RI_ConfirmAddAddressBook, which indicates whether the address book record was added successfully or errors occurred.

  5. In the new published business service class, RI_AuditAddressBookManager, create the context. This is where all the audit information is set.

    For example:

    context = startPublishedMethod(context, "addAddressBook",vo);
    
  6. Add code that checks whether a GUID is provided in the request, and if not, generates a GUID in the class.

    For example:

      if(vo.getGuid()== null || vo.getGuid().equals("")) {
                    guid = UniqueKeyGenerator.getNextGuid();
                }
         else {
                       guid = vo.getGuid();
                }
    
  7. Set the audit fields in the context object.

    For example:

    context.setGUID(guid);
            context.setApplicationID(vo.getApplicationID());
          context.setWorkstationName(vo.getWorkstationName());
          context.setIPAddress(vo.getIpaddress());
    
  8. Call the published business service method in the existing business service class and return the response.

    For example:

         RI_ConfirmAddAddressBook confirmVO = this.addAddressBook(context, 
         connection, vo);  
        finishPublishedMethod(context, "auditAddAddressBook");   
        return confirmVO;    
    

    In this example, the RI_AuditAddressBookManager is calling the addAddressBook method of the RI_AddressBookManager to add an address book record with audit information, which is set in the context object. The return value confirmVO indicates whether the record was added successfully or errors occurred.

A.3.3 Configuring RI_AuditInsertABStagingManager to Pass Audit Information

The RI_AddressBookStagingManager reference implementation is an example of a published business service that adds an address book record directly to the interoperability table.

This section describes how to configure the RI_AuditInsertABStagingManager class to extend RI_AddressBookStagingManager, so that audit information is passed with the address book record that is added to the interoperability table.

For more information about the AddressBookStagingManager reference implementation, see the JD Edwards EnterpriseOne Tools Interoperability Reference Implementations Guide.

Oracle provides the JPR95002 – RI_AuditInsertABStagingManager reference implementation, which you can use to extend the RI_AddressBoookStagingManager published business service to pass audit information.

This table describes the components of JPR95002 –RI_AuditInsertABStagingManager and the location of these components in the JD Edwards EnterpriseOne installation directory:

Reference Implementation Description Location
RI_AuditInsertABStagingManager A published business service class that extends the AddressBookStagingManager reference implementation so that it inserts a record with audit information into the interoperability table. B9\STAGINGA\java\source\oracle\e1\bssv\JPR95002
auditInsertAddressBookStaging A method in the RI_AuditInsertABStagingManager that is used to insert an address book record with audit information into the interoperability table. This method uses the insertAddressBookStaging method of the RI_AddressBookStagingManager class to insert the address book record. Same as previous.
RI_AuditInsertAddressBookStaging The value object class that contains get and set methods for the GUID, application ID, workstation name, and IP address. B9\STAGINGA\java\source\oracle\e1\bssv\JPR95002\valueobject

To configure RI_AuditInsertABStagingManager to pass audit information:

  1. Create a new value object that extends the value object of the existing published business service, which in this case is RI_AddressBookStagingManager.

    For example:

    public class RI_AuditInsertAddressBookStaging extends 
    RI_InsertAddressBookStaging implements Serializable
    

    RI_AuditInsertAddressBookStaging is the new value object.

    RI_InsertAddressBookStaging is the value object of the RI_AddressBookStagingManager published business service.

  2. In the RI_AuditInsertAddressBookStaging value object, add fields for the GUID, application ID, workstation name, and IP address.

    Generate accessors (get and set methods) for these fields.

  3. Create a new published business service that extends the existing published business service.

    For example:

    public class RI_AuditInsertABStagingManager extends 
    RI_AddressBookStagingManager {
    }
    

    RI_AddressBookStagingManager is the existing published business service that inserts an address book record into the interoperability table.

    RI_AuditInsertABStagingManager is the new published business service that uses the RI_AddressBookStagingManager class to insert an address book record with audit information into the interoperability table.

  4. Add a new published method that inserts an address book record with audit information into the interoperability table.

    This method uses the published method of the parent published business service to insert the address book record. Make the newly created value object a parameter of this method.

    For example:

    public RI_ ConfirmInsertAddressBookStaging 
         auditInsertAddressBookStaging(RI_AuditInsertAddressBookStaging vo) throws 
         BusinessServiceException
    

    In this example, auditInsertAddressBookStaging is the method that is used to insert an address book record with audit information into the interoperability table. This method uses the insertAddressBookStaging method in the RI_AddressBookStagingManager to insert the address book record.

    The new value object, RI_AuditInsertAddressBookStaging, is passed as a parameter. The return value of the auditInsertAddressBookStaging method is RI_ ConfirmInsertAddressBookStaging – which indicates whether the address book record was successfully inserted into the interoperability table or errors occurred.

  5. In the new published business service, RI_AuditInsertABStagingManager, create the context.

    This is where you set the audit information.

    For example:

    context = startPublishedMethod(context, "auditInsertAddressBookStaging", 
                vo);
    
  6. Add code that checks whether a GUID is provided in the request, and if not, generates a GUID in the class.

    For example:

      if(vo.getGuid()== null || vo.getGuid().equals("")) {
                    guid = UniqueKeyGenerator.getNextGuid();;
                }
                else {
                    guid = vo.getGuid(); 
                }
    
  7. Set the audit fields in the context object.

    For example:

    context.setGUID(guid);
            context.setApplicationID(vo.getApplicationID());
          context.setWorkstationName(vo.getWorkstationName());
          context.setIPAddress(vo.getIpaddress());
    
  8. Call the method of the existing business service class and return the response.

    For example:

            RI_ConfirmInsertAddressBookStaging confirmVO = 
            this.insertAddressBookStaging(context, connection, vo);
           finishPublishedMethod(context, "auditInsertAddressBookStaging");         
           return confirm;
    

A.4 Configuring a Java Connector to Pass Audit Information

This section provides an overview and discusses:

  • How to reuse audit data for multiple business functions.

  • Reference implementation resources.

  • How to run the Java connector reference implementation to test auditing.

A.4.1 Overview

This section describes how to configure and run the Purchase Order with Audit Feature reference implementation to pass audit information. Refer to the sample code in this section when you configure auditing for a transaction that occurs through a Java connector.

A.4.1.1 Example: Calling a Business Function with Audit Parameters

The following code sample is an example of a dynamic Java connector calling a business function that performs a purchase order, and it shows the parameters required for passing audit information. Step 4 contains the input values for a purchase order business function and step 5 contains the audit data set for the purchase order.

//Step 1: Login:
int sessionID = Connector.getInstance().login("user", "pwd", "env", "role");

//Pre-condition: Create the SpecDictionary or BSFNSpecSource
BSFNSpecSource specSource = new OneworldBSFNSpecSource(sessionID);

//The dynamic Java connector enables you to use hash tables to enter parameter⇒
 values. This example code illustrates how to use the HashMap class to enter⇒
 parameter values:

Map input = new HashMap();

//The dynamic Java connector enables you to use hash tables to retrieve output⇒
 values. This example code illustrates how to use the Hash table class to retrieve⇒
 output values:

Map output = addressbook.getValues();

// Step 2: Look up the business function method from SpecDictionary or BSFNSpec⇒
Source:
BSFNMethod bsfnMethod = (BSFNMethod)specSource.getBSFNMethod("F4311EndDoc");

// Step 3: Create the executable method from the business function metadata:
ExecutableMethod purchaseorder = bsfnMethod.createExecutable();

// Step 4: Set parameter values:

purchaseorder.setValues(inputParams);
purchaseorder.setValue("mnJobNumber","");
purchaseorder.setValue("mnOrderNumberAssigned","");
purchaseorder.setValue("szRelatedOrderType","");
purchaseorder.setValue("szComputerID","");
purchaseorder.setValue("cUseWorkFiles","");
purchaseorder.setValue("mnProcessID","");
purchaseorder.setValue("mnTransactionID","");

//Step 5: Set GUID,ApplicationID,WorkstationName,IPAddress for Audit

purchaseorder.setGUID("10.139.193.107.3434235324223423");
purchaseorder.setApplicationID("INTEROP")
purchaseorder.setWorkstationName("DENOSCL244");
purchaseorder.setIPAddress("10.139.193.107");

// Step 6: Execute the business function:
try {

BSFNExecutionWarning warning=purchaseorder.execute(sessionID);

A.4.2 Reusing Audit Data for Multiple Business Functions

When a third party application runs multiple business functions within one transaction, you can reuse the same audit data that was passed in the first business function call for all subsequent business function calls within the same transaction.

The sample code in this section shows how the salesorder business function is programmed to use the same GUID as the purchaseorder business function. In this example, if you do not configure the salesorder business function to use the same audit values, the API generates default audit information, which includes a new GUID, the word "INTEROP" for the application ID, the local workstation name, and the IP address of the local workstation.

In this example, to configure the other audit parameters, replace GUID with the application ID, workstation name, or IP address.

Step 1: 

ExecutableMethod purchaseorder = bsfnMethod.createExecutable();
... .

ExecutableMethod saleseorder = bsfnMethod.createExecutable();

... 

BSFNExecutionWarning warning=purchaseorder.execute(sessionID);

Step 2:

String firstguid = purchaseorder.getGUID();

Step 3:
 
salesorder.setGUID(firstguid);

BSFNExecutionWarning warning=purchaseorder.execute(sessionID);

A.4.3 Reference Implementation Resources

The files that you need to configure and test the Java Connector reference implementation for auditing are available in a zip file (AuditPurchaseOrderSample.zip) that you can download from the Update Center on the My Oracle Support Web site.

The zip file also contains a ReadMe file that provides additional instructions on how to configure and run this reference implementation.

A.4.4 Running the Java Connector Reference Implementation to Test Auditing

This section provides a sample program that runs the purchaseorder business function with audit parameters. The steps in this section use the Java Connector reference implementation to test the passing of audit information from a Java Connector interoperability transaction.

To run the Java Connector reference implementation to test auditing:

  1. Create a Java file with the name ExecuteBSFN_RI.java and paste the code from the sample program below.

  2. Update the code with valid JD Edwards EnterpriseOne credentials for login.

  3. Update the code with the correct values for the purchaseorder business function parameters.

  4. Add the dependent jars for imported classes.

  5. Compile the Java file and run it.

Example: Sample program for testing auditing for a Java connector transaction:


package javaconn.ri.sample;

import java.util.HashMap;
import java.util.Map;

import com.jdedwards.system.connector.dynamic.callmethod.BSFNExecutionWarning;
import com.jdedwards.system.connector.dynamic.callmethod.ExecutableMethod;
import com.jdedwards.system.connector.dynamic.callmethod.RequiredParameterNotFound⇒
Exception;
import com.jdedwards.system.connector.dynamic.spec.source.BSFNSpecSource;
import com.jdedwards.system.connector.dynamic.spec.source.OneworldBSFNSpecSource;
import com.jdedwards.system.connector.dynamic.Connector;
import com.jdedwards.system.connector.dynamic.spec.source.*;
import com.jdedwards.system.connector.dynamic.spec.SpecFailureException;
import com.jdedwards.system.connector.dynamic.ServerFailureException;
import com.jdedwards.system.connector.dynamic.SystemException;
import com.jdedwards.system.connector.dynamic.ApplicationException;

public class ExecuteBSFN_RI {
        int sessionID;
        BSFNSpecSource specSource = null;
        private ExecutableMethod poeEndDoc;
        private ExecutableMethod poeBeginDoc;
        ExecutableMethod poeEditDoc;
        public ExecuteBSFN_RI() {
                super();
                // TODO Auto-generated constructor stub
        }
        public void initialize(){
                try {
                        sessionID = Connector.getInstance().login("JDE", "JDE", "JDV812","*ALL");
                        specSource = new OneworldBSFNSpecSource(sessionID);
                } catch (ServerFailureException e) {
                        
                        e.printStackTrace();
                } catch (SpecFailureException e) {
                        
                        e.printStackTrace();
                }
        }
        public boolean executeBiginDoc() throws SpecFailureException,ServerFailure⇒
Exception
        {
                Map inputParams = new HashMap();
        Map outputParams = new HashMap();
        
        inputParams.put("szOrderType", "OP");
        
        String szBusinessUnit = "            ";
        szBusinessUnit = szBusinessUnit.substring(0, 12 - "M30".length()) + "M30";
        
        BSFNMethod method = specSource.getBSFNMethod("F4311FSBeginDoc");
        poeBeginDoc = method.createExecutable();

        poeBeginDoc.setValues(inputParams);
        
        poeBeginDoc.setValue("szBranchPlant",szBusinessUnit);
        poeBeginDoc.setValue("jdOrderDate", "03/04/2007");
        poeBeginDoc.setValue("szUserID", "JDE");
        poeBeginDoc.setValue("mnSupplierNumber", "4242");
        poeBeginDoc.setValue("cHeaderActionCode", "A");
        poeBeginDoc.setValue("cProcessEdits", "1");
        poeBeginDoc.setValue("cUpdateOrWriteToWorkFile", "2");
        poeBeginDoc.setValue("szProgramID", "CORBA");


        poeBeginDoc.setValue("szPurchaseOrderPrOptVersion", "ZJDE0001");
        poeBeginDoc.setValue("szComputerID","DTP-DDHOLAKI-WF");
        
        try {
                BSFNExecutionWarning warning = poeBeginDoc.execute(sessionID);
            if (warning!=null) {
                System.out.println(warning.toString());
            } else {
                System.out.println("BeginDoc execution Finished");
            }
        }
        catch (ApplicationException e) {
            e.printStackTrace();
            if (e instanceof RequiredParameterNotFoundException){
                String paramName = ((RequiredParameterNotFoundException)e).get⇒
ParamName();
                System.out.println("showError(paramName)");;
            }
            return false;
        } catch (SystemException e) {
            e.printStackTrace();
            System.exit(1);
        }
        
        return true;
                
        }
        public void executeEditDoc() throws SpecFailureException,ServerFailureException
        {
                Map inputParams = new HashMap();
        Map outputParams = new HashMap();
        
        inputParams.put("szUnformattedItemNumber", "1001");
        inputParams.put("mnQuantityOrdered", "976");
        inputParams.put("mnUnitPrice", "0.0");
        inputParams.put("szLineType",null);
        inputParams.put("szTransactionUoM",null);
        
        BSFNMethod method = specSource.getBSFNMethod("F4311EditLine");
        poeEditDoc = method.createExecutable();
        
        poeEditDoc.setValues(inputParams);
        
        poeEditDoc.setValue("mnJobNumber", poeBeginDoc.getValue("mnJobNumber"));
        System.out.println("done");
        poeEditDoc.setValue("szBranchPlant", poeBeginDoc.getValue("szBranch⇒
Plant"));
        poeEditDoc.setValue("szComputerID", poeBeginDoc.getValue("szComputerID"));
        poeEditDoc.setValue("cUpdateOrWriteWorkFile","2");
        poeEditDoc.setValue("szOrderType", poeBeginDoc.getValue("szOrderType"));
        poeEditDoc.setValue("cDetailActionCode", "1");
        poeEditDoc.setValue("mnProcessID", poeBeginDoc.getValue("mnProcessID"));
        poeEditDoc.setValue("mnTransactionID", poeBeginDoc.getValue("mnTransaction⇒
ID"));
        poeEditDoc.setValue("mnSupplierNumber", poeBeginDoc.getValue("mnSupplier⇒
Number"));
        
        
        try {
                BSFNExecutionWarning warning = poeEditDoc.execute(sessionID);
            if (warning!=null) {
                System.out.println(warning.toString());
            }
        } catch (ApplicationException e) {
            e.printStackTrace();
        } catch (SystemException e) {
            e.printStackTrace();
            System.exit(1);
        }

        }
        public void executeEndDoc() throws SpecFailureException,ServerFailureException
        {

        BSFNMethod method = specSource.getBSFNMethod("F4311EndDoc");
        String methodName = method.getName();
        System.out.println("Method name is "+methodName);
        BSFNParameter[] paraList = method.getParameters();
        for (int i=0; i<paraList.length;i++)
        {
        BSFNParameter para = paraList[i];
        String name=para.getName();
        System.out.println("Name is "+name);
        }
        
//       Step 3: Create the executable method from the business function metadata:
        ExecutableMethod poeEndDoc = method.createExecutable();
        try
        {
//          Set GUID,ApplicationID,WorkstationName and IPAddress
                poeEndDoc.setGUID("3344556677");
                poeEndDoc.setApplicationID("TestRI");
                poeEndDoc.setWorkstationName("test-workstation");
                poeEndDoc.setIPAddress("10.10.10.10");

                poeEndDoc.setValue("mnJobNumber",poeBeginDoc.getValue("mnJobNumber"));
        poeEndDoc.setValue("mnOrderNumberAssigned",poeBeginDoc.getValue("mnOrder⇒
Number"));
        poeEndDoc.setValue("szRelatedOrderType",poeBeginDoc.getValue("szOrder⇒
Type"));
        poeEndDoc.setValue("szComputerID",poeBeginDoc.getValue("szComputerID"));
        poeEndDoc.setValue("cUseWorkFiles","2");
        poeEndDoc.setValue("mnProcessID",poeBeginDoc.getValue("mnProcessID"));
        poeEndDoc.setValue("mnTransactionID",poeBeginDoc.getValue("mnTransaction⇒
ID"));
        
//       Step 5: Execute the business function:
        
try {
                
                        BSFNExecutionWarning warning = poeEndDoc.execute(sessionID);
                
            if (warning!=null) {
                System.out.println(warning.toString());
            }    
        } catch (ApplicationException e) {
                e.printStackTrace();
        } catch (SystemException e) {
    e.printStackTrace();
    System.exit(1);
        }
        // Step 6: Get return parameter values:
        System.out.println("GUID: "+poeEndDoc.getGUID());
        System.out.println("Application Name: "+poeEndDoc.getApplicationID());
        System.out.println("WorkstationName: "+poeEndDoc.getWorkstationName());
        System.out.println("IP Address: "+poeEndDoc.getIPAddress());
        System.out.println("mnOrderNumberAssigned "+poeEndDoc.getValueString("mnOrder⇒
NumberAssigned"));
        }
        finally
        {
//      Log off and shut down connector if necessary:
        Connector.getInstance().logoff(sessionID);
        Connector.getInstance().shutDown();
        }
        }
        /**
         * @param args
         */
        public static void main(String[] args) {
                ExecuteBSFN_RI ri = new ExecuteBSFN_RI();
                try {
                        ri.initialize();
                        ri.executeBiginDoc();
                        ri.executeEditDoc();
                        ri.executeEndDoc();
                } catch (SpecFailureException e) {
                        e.printStackTrace();
                } catch (ServerFailureException e) {
                        e.printStackTrace();
                }

        }
}

A.5 Configuring a COM Connector to Pass Audit Information

This section provides an example of a generated COM function wrapper for auditing and reference implementation resources.

A.5.1 Example of a Generated COM Function Wrapper with Audit Parameters

The following sample code is an example of a generated COM function wrapper in Visual Basic. This example includes parameters for passing the GUID, application ID, workstation name, and IP address audit values. It creates business and connector objects.

Refer to the SalesOrderEntry sample included with the COM interoperability software for a complete working example of this functionality.

This sample code contains the connCFR object created from the IConnector3 interface, which is used to call audit APIs:

' Connection into the OneWorld Environment
Dim jdeConnector As New JDECOMCONNECTOR2Lib.Connector
'Connector interface with roles
Dim connRole As JDECOMCONNECTOR2Lib.IConnector2
'Connector interface for CFR
Dim connCFR As JDECOMCONNECTOR2Lib.IConnector3
' Object needed for error callbacks
Dim WithEvents soeOWInterface As JDECOMCONNECTOR2Lib.OneWorldInterface
' Sales Order Entry Business Object
Dim soeObject As SALESORDERENTRyLib.JDESalesOrderEntry
' Parametersets for soe MBF calls
Dim soeBeginDoc As SALESORDERENTRyLib.D4200310H
Dim soeEndDoc As SALESORDERENTRyLib.D4200310G
Dim soeEditLine As SALESORDERENTRyLib.D4200310F
Dim soeClearWF As SALESORDERENTRyLib.D4200310I

Dim lngAccessNumber As Integer

Dim GUID As String
Dim appID As String
Dim compNam As String
Dim ipAddress As String

Private Sub frmSalesOrder_Load

Set connRole = jdeConnector
Set connCFR = jdeConnector
lngAccessNumber = connRole.Login("JDE", "JDE", "JDV812", "*ALL")

soeObject = jdeConnector.CreateBusinessObject("SalesOrderEntry.JDESalesOrder⇒
Entry", lngAccessNumber)

soeOWInterface = jdeConnector.CreateBusinessObject("OneWorld.FunctionHelper.1",⇒
 lngAccessNumber)

connCFR.setGUID("000-aaaa-cccc")
connCFR.setAppID("P4210")
connCFR.setWorkStationName("Comp")
connCFR.setIPAddress("1.1.1.1")

soeObject.F4211FSEndDoc(soeEndDoc, soeOWInterface, jdeConnector, lngAccessNumber)

GUID = connCFR.getGUID()
appID = connCFR.getAppID()
compNam = connCFR.getWorkStationName()
ipAddress = connCFR.getIPAddress()

End Sub

Note:

You must explicitly set the GUID, application ID, workstation name and IP address to blank or a new value in the sample application for every sales order created. If you do not set these values, the system uses the values of the first sales order for all subsequent sales orders created. This happens if a single instance of a connector is used to create multiple sales orders.

The following sample code shows how to generate a new GUID for every business function call. If you pass NULL for the GUID, then the system generates a new GUID:

connCFR.setGUID("")
connCFR.setAppID("P4210")
connCFR.setWorkStationName("Comp")
connCFR.setIPAddress("1.1.1.1")

soeObject.F4211FSEndDoc(soeEndDoc, soeOWInterface, jdeConnector, lngAccessNumber)

A.5.2 Reference Implementation Resources

The files and resources for configuring and testing a COM connector reference implementation are located in the Update Center on the My Oracle Support Web site.

A.6 Configuring WSG or XPI to Pass Audit Information

An adapter service for a JD Edwards EnterpriseOne business function or database operation contains an audit data section. This section contains these fields for passing audit information to an audit table:

  • GUID

  • Application ID

  • Workstation Name

  • IP Address

If audit information is not passed at runtime through the adapter service, then the system generates the audit data.

A.6.1 Adapter Services for EnterpriseOne Business Functions: Auditing Configuration

The business function template in the EnterpriseOne Adapter is embedded with an Audit Data section to pass audit information when you are running the adapter service. Therefore, no special configuration is needed to implement auditing.

A.6.1.1 Multiple Business Functions Within a Single Transaction in a Flow

In a typical scenario, if a flow contains multiple business function adapter services, the audit data is shared across all business function calls within the flow. If custom audit data needs to be passed, include the audit data—which includes a GUID, application ID, workstation name, and IP address—in the flow input, and map the values to the audit data fields in the Audit Data section of the business function adapter in the flow.

The audit fields in the flow service set the audit information for the business function adapter service. If the flow contains multiple adapter services, then all the services will share the single audit information that is provided as the flow input. If multiple adapter services are in a flow, you do not need to map the audit fields in the flow service input document to the Audit Data section of every adapter service. Mapping the audit fields to the first adapter service passes the data to the other adapter services in that flow.

A.6.2 Adapter Services for EnterpriseOne Database Operations: Auditing Configuration

Adapter services for database operations are developed as standalone services that will not be part of any flow. Therefore, there is no need to consider sharing auditing data for multiple adapter services, unlike business function adapter services. The database select service template does not contain an Audit Data section because data is not manipulated for a database select operation.

A.6.3 Reference Implementation Resources

Oracle provides sample files, or reference implementations, that you can use to configure and test an auditing configuration for a WSG or XPI adapter service.

The reference implementations are delivered in this package: PSFT_E1_Adapter_GUID_Samples.zip.

This zip file is available in the Update Center on the My Oracle Support Web site. You must install this package to work with the samples.