Adding a Composite Child Graph

This use case describes the creation of a new lineItem and ItemNote and attaching it to an existing Order.

The following diagram illustrates the addition of a new Item and Note to the Order created in the previous use case:
  1. The client looks up the existing order, creates a new Item with an attached ItemNote and adds the new Item to the existing Order.
  2. 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.
  3. 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).
  4. 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.
  5. During cache merge processing the surrogate keys provided in the client attributes for the new Item and ItemNote are preserved in the cache.
  6. Cache changes are downloaded to the client.


addingCompositeGraphItem