Interpreting the Code for the Component Interface SDK Sample (C++)
The following listings of code are taken from the C++ sample program, sdk_bus_exp.cpp. (The code has been edited for length.)
-
Include all the headers.
#ifdef PS_WIN32 #include "stdafx.h" #endif #include "cidef.h" #include "apiadapterdef.h" #include "PSApiExternalLib.h" #include "PSApiAdapterInter.h" #include "PeopleSoft_PeopleSoft_i.h" #include <stdio.h> #include <stdlib.h> #include <iostream.h> #include <wchar.h> -
Declare the PeopleSoft session handle.
HPSAPI_SESSION hSession; -
Declare all the required objects. Only one active period and one active detail record are possible at any time.
Collection Object Level Item Object for Collection hSdkBusExpCollection
Root (SDK_BUS_EXP)
hSdkBusExp
hSdkBusExpPerCollection
Level 1 (SDK_BUS_EXP_PER)
hSdkBusExpPer
hSdkBusExpDtlCollection
Level 2 (SDK_BUS_EXP_PER_DTL)
hSdkBusExpDtl
Collection ObjectLevelItem Object for CollectionhSdkBusExpCollectionRoot (SDK_BUS_EXP)hSdkBusExphSdkBusExpPerCollectionLevel 1 (SDK_BUS_EXP_PER)hSdkBusExpPerhSdkBusExpDtlCollection Level 2 (SDK_BUS_EXP_PER_DTL)hSdkBusExpDtl
The function executeMethod is used to launch the appropriate method depending upon the user input (nMethodIn).
The component interface C++ SDK sample has 25 options:
SDK Option1 through 5 SDK_BUS_EXP_PER collection.6 through 25SDK_BUS_EXP_DTL collection
| SDK Option | Where Executed |
|---|---|
|
1 through 5 |
On the component interface. |
|
6 through 15 |
SDK_BUS_EXP_PER collection |
|
16 through 25 |
SDK_BUS_EXP_DTL collection |
Options 1 through 4 and options 6 through 25 are similar in behavior to those described in the product documentation for PeopleCode API Reference for a component Interface and its collections.
Option 5, InsertBusExpDtlDefaults, is the user-defined method of the SDK_BUS_EXP component interface. This method is defined in PeopleCode inside the component interface definition.
The logic used in the corresponding options of these collections is identical.