The following diagram illustrates the addition of a new Item and Note
to the Order created in the previous use case:
- The client looks up the existing order, creates a new Item
with an attached ItemNote and adds the new Item to the existing Order.
- Since this modifies an existing graph and does not create a
new one, the graph contained in the replay message cannot be assumed to be
complete, so SAP Mobile Server merges the
partial MBO graph contained in the operation replay message with the graph
currently contained in the cache.
- When creating the merged MBO graph, two MBO nodes are
identified in the operation replay graph which are not present in the cached
graph such that the merged graph consists of the cached graph plus two
additional MBO nodes (the new Item and ItemNote nodes).
- The merged MBO graph is assembled and bound to the
parameters of the Order update operation, and the update operation is
invoked. If the update operation is configured for entity-level refresh, the
findByPrimaryKey operation is invoked to retrieve the current graph from the
EIS so that it can be merged into the cache. In this case the primary key
required by the findByPrimaryKey operation is derived from the
clientAttributes rather than from the results of the update operation.
- During cache merge processing the surrogate keys provided in
the client attributes for the new Item and ItemNote are preserved in the
cache.
- Cache changes are downloaded to the client.