gotApplEvent()

Sends a business object to the connector framework.

Syntax

public int gotApplEvent(BusinessObjectInterface theBusObj);
 

Parameters

theBusObj
Is the business object instance being sent to the connector framework.

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:

CxStatusConstants.SUCCEED
The connector framework successfully delivered the business object to the connector framework.
CxStatusConstants.FAIL
The event delivery failed.
CxStatusConstants.CONNECTOR_NOT_ACTIVE
The connector is paused and therefore unable to receive events.
CxStatusConstants.NO_SUBSCRIPTION_FOUND
No subscriptions exist for the event that the business object represents.

Notes

The gotApplEvent() method sends the theBusObj 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).

WebSphere InterChange Server

If the integration broker is InterChange Server, the connector framework sends the event (as a business object) to InterChange Server across its configured delivery transport mechanism (such as JMS or CORBA IIOP).

Other integration brokers

If the integration broker is a WebSphere message broker (WebSphere MQ Integrator, WebSphere MQ Integrator Broker, or WebSphere Business Integration Message Broker) or WebSphere Application Server, the connector framework sends the event (as an XML message) to WebSphere MQ Integrator Broker across its configured delivery transport mechanism of a JMS queue.

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. CONNECTOR_NOT_ACTIVE
Is there a subscription for the event? NO_SUBSCRIPTION_FOUND
Note:
Because gotApplEvent() makes sure that the business object and verb to be sent have a valid subscription, you do not need to call isSubscribed() immediately before calling gotApplEvent().
WebSphere InterChange Server

Usually, you call the gotApplEvent() method from the pollForEvents() thread. InterChange Server uses the pollForEvents() method to request the connector to send subscribed events to it. The connector uses the gotApplEvent() method to send business objects to the connector framework, which in turn routes them to InterChange Server in response.

The connector uses the pollForEvents() method to poll the event store for subscribed events to send to the integration broker. Within pollForEvents(), the connector uses the gotApplEvent() method to send an event (represented as a business object) to the connector framework. The connector framework then routes this business object to the integration broker. Therefore, 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 store. Instead, the poll method should update the event record's status to reflect the results of the event delivery based on the return code of gotApplEvent().

The gotApplEvent() method initiates an asynchronous execution of an event. Asynchronous execution means that the calling code does not wait for receipt of the event, nor does it wait for a response.

Note:
To initiate a sychronous execution of an event, use the executeCollaboration() method. Sychronous execution means that the calling code waits for the receipt of the event, and for a response.

See also

executeCollaboration(), isSubscribed(), pollForEvents()

See also the description of the BusinessObjectInterface interface.

Copyright IBM Corp. 1997, 2003