Sends a business object to InterChange Server.
Syntax
int gotApplEvent(BusinessObject &busObj);
Parameters
Return values
An integer that indicates the outcome status of the event delivery. Compare this integer value with the following outcome-status constants to determine the status:
Notes
The gotApplEvent() method sends the busObj business object to the connector framework. The connector framework does some processing on the event object to serialize the data and ensure that it is persisted properly. It then makes sure the event is either sent to the ICS through IIOP or written to a queue (if you are using queues for event notification).
Before sending the business object to the connector framework,
gotApplEvent() checks for the following conditions and returns the
associated outcome status if these conditions are not met:
Condition | Outcome status |
---|---|
Is the status of the connector active; that is, it is not in a "paused" state? When the connector's application-specific component is paused, it no longer polls the application. | BON_CONNECTOR_NOT_ACTIVE |
Is there any subscription for the event? | BON_NO_SUBSCRIPTION_FOUND |
The poll method should check the return code from gotApplEvent() to ensure that any errors that are returned are handled appropriately. For example, until the event delivery is successful, the poll method should not remove the event from the event table.
Examples
SubscriptionHandlerCPP * theSubHandler = GenGlobals::getTheSubHandler(); // Determine whether there are subscribers to the event if (theSubHandler->isSubscribed(obj_name, obj_verb) != TRUE) { // log message // delete event from event table // add event to archive table continue; } // Prepare to retrieve data into the business object pObj = new BusinessObject(obj_name); pObj->setVerb("Retrieve"); // Set key in business object // Call the business object handler doVerbFor() // to retrieve data if (pObj->doVerbFor() == BON_FAIL) { // Log error message if retrieve fails retcode = BON_FAIL; break; } // Call gotApplEvent() to send the business object pObj->setVerb(obj_verb); theSubHandler->gotApplEvent(*pObj); if ((theSubHandler->gotApplEvent(*pBusObj)) == BON_FAIL) { // Log error message retcode = BON_FAIL; break; }
See also
See also the description of the BusinessObject Class and the pollForEvents() method.