Handling the request

Once you have derived your business-object-handler class, you must implement the business-object-handler method, doVerbFor(). It is the doVerbFor() method that provides request processing for the business objects that the connector supports. At startup, the connector framework calls getConnectorBOHandlerForBO() to obtain the business object handler implemented for each of the business object definitions that the connector supports.

Important:
All connectors must implement a business-object-handler method, doVerbFor(), that implements the Retrieve verb. This method and verb must be implemented even if your connector will not perform request processing.

This section provides the following information on how to implement the doVerbFor() method:

Basic logic for doVerbFor()

For a Java connector, the CWConnectorBOHandler class defines the doVerbFor() method, which is an abstract method defined. The doVerbFor() method typically follows a basic logic for request processing.

Figure 27 shows a flow chart of the method's basic logic.

Figure 27. Flow chart for basic logic of doVerbFor()


For an implementation of this basic doVerbFor() logic, see Implementing the doVerbFor() method.

When the connector framework receives a request, it calls the doVerbFor() method for the business-object-handler class associated with the business object definition of the request business object. To this doVerbFor() method, the connector framework passes the request business object. Table 32 summarizes the tasks that the doVerbFor() method performs once it has received a request business object from the connector framework.

Table 32. Tasks of the doVerbFor() method

Task of business object handler For more information
1. Determine the verb processing to perform, based on the active verb in the request business object. "Performing the verb action"
2. Obtain information from the request business object to build and send requests for operations to the application. "Processing business objects"

General recommendations on verb implementations

This section provides the following general recommendations for implementing your doVerbFor() method:

Verb stability

Verbs in a business object should remain stable throughout the request and response cycle. When a connector receives a request, the hierarchical business object that is returned to InterChange Server should have the same verbs as the original request business object, with the exception of verbs in child business objects that were not set in the original request.

Verbs in child business objects might or might not be set in request business objects:

Transaction support

An entire business object request must be wrapped in a single transaction. In other words, all Create, Update, and Delete transactions for a top-level business object and all of its children must be wrapped in a single transaction. If any failure is detected during the life of the transaction, the whole transaction should be rolled back.

For example, if a Create operation on a top-level business object succeeds, but the transaction for one of the child business objects fails, the connector application-specific component should roll back the entire Create transaction to the previous state. In this case, the connector's application-specific component should return failure from the verb method.

ObjectEventId attribute

The ObjectEventId attribute is used in the IBM WebSphere business integration system to identify an event-trigger flow in the system. In addition, it is used to keep track of child business objects across requests and responses, as the position of child business objects in a hierarchical business object request might be different from the position of the child business objects in the response business object.

Connectors are not required to populate ObjectEventId attributes for either a parent business object or its children. If business objects do not have values for ObjectEventId attributes, the IBM WebSphere business integration system generates values for them. When connectors generate ObjectEventId values, this is done by the source connector as part of the event-notification mechanism.

When processing request business objects, connectors should preserve ObjectEventId values in all levels of a hierarchical business object between the request business object and the response business object. If a connector method changes the values of child business object ObjectEventIds, the IBM WebSphere business integration system may not be able to correctly track the child business objects.

For information on generating ObjectEventIds in the event notification mechanism, see "Event identifier".

Copyright IBM Corp. 1997, 2003