Chapter 6. Business object handlers 67
hierarchy. To do this, the connector might need to create, update, and delete
application entities as follows:
– If child entities exist in the application, they are modified as needed.
– Any child business objects contained in the hierarchical business object
that do not have corresponding entities in the application are added to the
application.
– Any child entities that exist in the application but that are not contained in
the business object are deleted from the application.
Standard processing for the Update verb
The following steps outline the standard processing for an Update verb:
1. Creates a new business object of the same type as the request business
object. This new business object is the response business object, which will
hold the retrieved copy of the request business object.
2. Retrieves a copy of the request business object from the application.
Recursively retrieves the data for the entire entity from the application using
the primary keys from the request business object:
– For a flat business object, retrieves the single application entity.
– For a hierarchical business object, uses the Retrieve operation to descend
into the application business object, expanding all paths in the business
object hierarchy.
3. Places the retrieved data in the response business object. This response
business object is now a representation of the current state of the entity in the
application. The Update operation can now compare the two hierarchical
business objects and update the application entity appropriately.
4. Updates the simple attributes in the application entity to correspond to the
top-level source business object.
5. Compares the response business object (that were created in step 2) with the
request business object. Performs this comparison down to the lowest level of
the business object hierarchy. Recursively updates the children of the
top-level business object, following these rules:
– If a child business object is present in both the response business object
and the request business object, recursively updates the child by
performing the Update operation.
– If a child business object is present in the request business object, but not
in the response business object, recursively creates the child by
performing the Create operation.
– If a child business object is not present in the request business object, but
is present in the response business object, recursively deletes the child