Creating a business object

To create a supported business object, perform the following steps:

  1. Locate the Component that represents the event and transaction. If necessary, create one.
  2. Use the PeopleSoft Application Designer to create a Component Interface from the Component in step 1.
  3. Use PeopleSoftODA or Business Object Designer to create a corresponding PeopleSoft-specific business object. For more information about business objects, see "Business object attribute properties" and "Business object application-specific information". For more information about PeopleSoftODA, see Generating business object definitions using PeopleSoftODA.
  4. Add the PeopleSoft-specific business object to the list of the connector's supported business objects. For business-object subscription information specific to your integration broker, see the broker's implementation guide.

Use the PeopleSoft Application Designer to create a class structure from a Component Interface. The business object that corresponds to the Component Interface requires these classes to process the data; it is part of the PeopleSoft API.

To assist you in creating and using the generated classes, this section covers:

Generating APIs

To generate APIs from a Component Interface, do the following:

  1. Open the Component Interface in the Application Designer.
  2. Select the PeopleSoft APIs menu from the Build menu.
  3. Select only the Java option, specifying the destination as:
    $ProductDirS/connectors/PeopleSoft/dependencies
     
    
    %ProductDir%\connectors\PeopleSoft\dependencies
     
    
  4. Compile the generated classes and verify that they are in the following directories:
    $ProductDir directory:
     
    

    Component Interface class files

    /connectors/PeopleSoft/dependencies/PeopleSoft/Generated/CompIntfc
     
    

    Session-specific class files

    /connectors/PeopleSoft/dependencies/PeopleSoft/Generated/PeopleSoft
     
    
    %ProductDirS% directory:
     
    

    Component Interface class files

    \connectors\PeopleSoft\dependencies\PeopleSoft\Generated\CompIntfc
     
    

    Session-specific class files

    \connectors\PeopleSoft\dependencies\PeopleSoft\Generated\PeopleSoft
     
    

For a more detailed explanation of the API-generating process, including screen shots, see "Building the API files".

Example APIs

If you use the PeopleSoft APIs menu (a submenu of the Build menu) to create a class structure from the example EMER_CONTACT_PROFILE Component Interface, you have the following:

The generated methods that the connector uses are:

getFieldName() Method

Each of the generated classes contains the getFieldName() method, which enables the connector to get the data value of each simple field of the Component Interface, and load it into the corresponding business object attribute.

For example, as illustrated in the right half of Figure 7, there are seven fields listed as FINDKEYS for the EMER_CONTACT_PROFILE Component. These fields include EMPLID, NAME, and DEPTID. To get data from these fields, the connector uses the getEmpId(), getName(), and getDeptId() methods. After obtaining the values, the connector loads them into the EmpId, ContactName, and DeptId business object attributes.

To return the value of simple fields in a Collection, the connector first returns the Collection, and then returns the fields in it. For example, to get the values in the CONTACT_NAME and SAME_ADDRESS_EMPL fields of the EMERGENCY_CNTCT Collection, the connector first executes the getEmergencyCntct() method. Then it executes the getContactName() and getSameAddressEmpl() methods. For more information, see "getCollectionName() Method".

setFieldName() Method

Each of the generated classes contains the setFieldName() method, which enables the connector to set the data value of each simple field of the Component Interface based on the value of its corresponding business object attribute.

For example, to load data from the EmpId, ContactName, and DeptId business object attributes into the EMPLID, NAME, and DEPTID fields, the connector uses the setEmpId(), setName(), and setDeptId() methods.

getCollectionName() Method

To return the Collection of emergency contacts for a given employee, the connector uses the getEmergencyCntct() method in the EmerContactProfile class. The way that the connector handles the multiple rows depends on the setting of application-specific information at the business-object level.

For information about the EFFDT parameter, see "Application-specific information at the business object level".

To return the Collection of phone types and phone numbers for each of an employee's emergency contacts, the connector uses the getEmergencyPhone() method in the EmerContactProfileEmergencyCntct class. After obtaining all Records, the connector loads them into the business object's array attribute, EmergencyPhone[n].

CurrentItem() Method

When retrieving the records in a Collection, the connector uses the CurrentItem() method in the EmerContactProfile class to return only the record with the latest effective date. The connector uses this method only if the EFFDT parameter of the business-object level application-specific information evaluates to true.

Item(index) Method

When retrieving the records in a Collection, to return only the record with the specified record number, the connector uses the Item(index) method in the EmerContactProfile class. The connector uses this method only if the EFFDT parameter of the business-object level application-specific information evaluates to false. By default, this method returns the first row retrieved.

Copyright IBM Corp. 1997, 2003