IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > Oracle E-Business Suite > Overview of IBM WebSphere Adapter for Oracle E-Business Suite > Technical overview > Outbound processing > Outbound operations

Update operation

In an Update operation, the source business object is compared to a business object that is retrieved from the database using the primary keys specified in the top-level, source business object.

When updating a hierarchical business object, the adapter performs the following actions:

  1. Uses the primary key values of the source business object to retrieve the corresponding entity from the database. The retrieved business object is an accurate representation of the current state of the data in the database.

    If the retrieval fails, indicating that the top-level business object does not exist in the database, the adapter returns the RecordNotFoundException exception, and the update fails.

    If the retrieval succeeds, the adapter compares the retrieved business object to the source business object to determine which child business objects require changes in the database. The adapter does not, however, compare values in the source business object's simple attributes to those in the retrieved business object. The adapter updates the values of all non-key simple attributes.

    If all the simple attributes in the top-level business object represent keys, the adapter cannot generate an update query for the top-level business object. In this case, the adapter logs a warning and continues.

  2. Recursively updates all single-cardinality children of the top-level business object.

    If ownership is true and the child is present in the source business object but not in the retrieved business object, the adapter recursively creates the child in the database.

    The adapter handles single-cardinality children contained with ownership in one of the following ways:

    • If the child is present in both the source and the retrieved business objects, instead of updating the existing child in the database, the adapter deletes the existing child and creates the child.

    • If the child is present in the source business object but not in the retrieved business object, the adapter recursively creates the child in the database.

    • If the child is present in the retrieved business object but not in the source business object, the adapter recursively deletes the child from the database.

    For single-cardinality children contained without ownership, the adapter attempts to retrieve every child that is present in the source business object from the database. If it successfully retrieves the child, the adapter populates the child business object but does not update it, because the adapter never modifies single-cardinality children contained without ownership. If the retrieval fails, the adapter returns an ObjectNotFound exception.

  3. Updates all simple attributes of the retrieved business object, except those whose corresponding attribute in the source business object is not specified.

    Because the business object being updated must be unique, the adapter verifies that only one row is processed as a result. If more than one row is returned, the adapter returns an error.

  4. Processes each multiple-cardinality child of the retrieved business object in one of the following ways:

    • If the child exists in both the source and the retrieved business object arrays, the adapter recursively updates it in the database.

    • If the child exists in the source array but not in the array of the retrieved business object, the adapter recursively creates it in the database.

    • If the child exists in the array of the retrieved business object but not in the source array, the adapter recursively deletes it from the database unless the application-specific information for the attribute that represents the child in the parent has the KeepRelationship property set to True. In this case, the adapter does not delete the child from the database.


NULL data and the Update operation

The adapter can update a record from a database table when the column value is NULL.

For example, a Customer business object might have these columns: custid, ccode, fname, and lname, where custid and ccode form composite keys. Composite keys are primary keys that refer to more than one attribute and are used to define the uniqueness of the business object. You can update a Customer record for which the value of ccode is NULL. The adapter would generate an update query for the Update operation as:

update customer set fname=?, lname=? where custid=? and ccode is null

The adapter treats an empty complex column as null value irrespective of setting it to null or unset.

Outbound operations


Related concepts:

Create operation

Retrieve operation

RetrieveAll operation

ApplyChanges operation

Delete operation

Execute operation

Exists operation

Invoke operation

Publish operation


Related reference:

Fault business objects