This flow shows the process logic for this collaboration template's
Create verb:
Flow
- A DataStore collaboration object is triggered by the receipt of a SampleObject
business object from a source collaboration object.
- The SampleObject business object is copied into a high-level object called
DataStoreSampleObject. This object is passed into the IBM® WebSphere® Business
Integration Data Handler for XML. By default, it contains the application
specific information needed by the data handler. The data handler outputs
a string, which contains an XML representation of the SampleObject business
object passed into the collaboration object.
- The DataStore collaboration object builds an application specific business
object called SerialObject, which includes two attributes:
- ObjectData, which is set equal to the XML output from the data handler.
- ObjectKey, which is created from the key information in the SampleObject
business object and the value of the DataStore collaboration object's OBJECT_KEY property
(by default, uniqueId). This attribute holds the unique key used to store
the object in the database.
- The completed SerialObject is sent to the To port of the DataStore collaboration
object, which is bound to a JDBCConnector. The JDBCConnector uses the application
specific information in the SerialObject to store it in the database. If the
object already exists in the database, a ServiceCall exception is thrown and
the Create operation fails.
Note: Avoid the use of non-unique keys because
multiple objects with identical keys can be created in the database causing
unpredictable behavior of record retrievals, updates, and deletes. Also, although
it is possible for different instances of the DataStore collaboration to store
different types of objects in the same table of the database (if the keys
for all objects are unique), store different types of objects in different
tables in the database.