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 getBOHandlerforBO() to obtain the business object handler implemented for each of the business object definitions that the connector supports.
This section provides the following information on how to implement the doVerbFor() method:
For a C++ connector, the BOHandlerCPP class defines the doVerbFor() method, which is a virtual method defined. The doVerbFor() method typically follows a basic logic for request processing.
Figure 25 shows a flow chart of the method's basic logic.
Figure 25. 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 26 summarizes the tasks that the doVerbFor() method
performs once it has received a request business object from the connector
framework.
Table 26. 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" |
This section provides the following general recommendations for implementing your doVerbFor() method:
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:
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.
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".