The business adapter

The business adapter implements the IEventBusinessAdapter interface.

This interface prescribes one method as follows.
public DataObjectCollection getDataObjects(Serializable transObj, String busObjKey, 
     String busEntity)
The method requires the following input parameters:
  • Serializable transObj: Contains the business object passed to ProcessController bean during the call from the business system. Typically, it contains the business object participating in the business transaction or the transaction object itself. If the Event Manager processing is not triggered by a transaction, this parameter is empty.
  • String busObjKey: Contains the primary key of the business object within the business system. If processing is triggered by calling the ProcessController bean, this value is set to the value passed into processTask() method. If the EventDetectionScheduleController triggers the processing, this value is retrieved from the PROCESSCON_INST_PK field in the PROCESSCONTROL table.
  • String busEntity: Contains a logical name of the business object within business system. If processing is triggered by calling the ProcessController bean, this value is set to the value passed into processTask() method. If the EventDetectionScheduleController triggers the processing, this value is retrieved from the NAME field in the PRODENTITY table, by looking up the PRODENTITY_ID field in the PROCESSCONTROL table.

This method must return the DataObjectCollection object or null. This return type allows the adapter to return multiple business objects.

In the case, where the EventDetectionScheduleController triggered the processing, the adapter typically returns only one object. The adapter retrieves the business object from the business system, creates the new DataObjectCollection object, adds one business object to the DataObjectCollection object and then returns it.

In the case where a transaction triggered the processing, the adapter can use the information in the transObj, passed as an input parameter, to decide which type of objects should be retrieved from the business system. Each object must be added as EventDataObj to the DataObjectCollection with the appropriate busEntity and busObjKey information. For example, if the business transaction is ContractUpdate, the adapter may want to retrieve information for all the parties modified during the transaction. Each party data object, together with the party primary key and entity name, should be added as EventDataObj to DataObjectCollection and returned to the caller. If the adapter is not retrieving any data object and simply needs to pass transaction object transObj to the rule, it still should be added to DataObjectCollection as EventDataObj. If the adapter returns with an empty DataObjectCollection, Event Manager will not be able to proceed.

To add business object information to the DataObjectCollection, use the following method:

public boolean add(Serializable busDataObj, String busEntity, String busObjKey)

Once the adapter is implemented, it needs to be registered with Event Manager in the ADAPTERDEF table, which contains information about the adapter implementation, such as vendor information and the fully qualified name of the adapter class. The ID of the adapter should then be added to the ENTITYEVENTCAT record as a foreign key to the entity event category that uses this adapter. The value from the DWL_PROD_TP_CD field of the PRODENTITY table, which corresponds to the PRODENTITY_ID of that entity event category, should be used as the busSysID input parameter when calling the ProcessController bean. To find out more about calling the ProcessController bean, see Calls to Event Manager from the business system.