Update Invoking Enterprise Business Services

Constructing the ABCS 12-27 application only if the original request message explicitly requests a response by setting the ResponseCode attribute in the Create message. Response Content Payload The payload type of the response verb is always based on the payload type of the Create Request operation. It is implemented as a different type to support user customization if needed.

12.8.2 Update

The Update verb indicates a request to a service provider to update an object using the payload provided in the Update message. It is used in operations that are intended for updating one or more properties of a business object or array of business objects. Operations that use the Update verb must create or update content and should not be an orchestration of other operations. When to Use the Update Verb Similar to Create, a business process invokes an Update operation mainly in cases in which the source event that triggers the invocation is not the updating of the object in the requesting system. If both the service requester and service provider have the same object, then Sync would be a more appropriate verb to use. However, use of Sync would be conditional to the service provider having an implementation of a Sync operation. An example of an Update operation is a receiving system updating a purchase order line with the quantity of items received, or an order capture system updating the customer record with customer address and other information. The content included in the business payload of an EBM using the Update verb is assumed to be only the fields that must be updated in the target application. The Update verb uses the ActionCode property of the business components and common components to communicate processing instructions to the target system. This is necessary for hierarchical, multilevel objects when the update happens at a child level. The ActionCode property exists in an EBO for all components that have a multiple cardinality relationship with its parent. The possible values for the ActionCode are Create, Update, and Delete. It is intended for use only in conjunction with the Update verb to communicate the processing action to be applied to that business component. Note that the ActionCode applies only if the object has child business components-if not, an ActionCode is not needed and the verb alone is sufficient to convey this information. A use case for ActionCode is a case in which a requisition is updated in a self-service requisitioning system, and this updated information must be communicated to the Purchasing system, which also maintains a copy of the requisition. Assume that a user updates a requisition and does the following actions in a single transaction: ■ Updates the description in the requisition header ■ Adds a new requisition line line number 4 ■ Modifies the item on a requisition line line number 3 ■ Deletes a requisition line line 2 ■ Modifies the accounting distribution of a requisition line, and adds a new accounting distribution line 1 12-28 Developers Guide for Oracle Application Integration Architecture Foundation Pack The content of the DataArea business payload in the instance XML document that communicates the preceding changes is shown in Example 12–12 . Example 12–12 DataArea Business Payload in the instance XML Document UpdateRequisition actionCode=Update Root Action Code not processed DescriptionNew DescriptionDescription RequisitionLine actionCode=Update Indicates that some property or association of this line is being updated. In this example, the accounting distribution Percentage has been updated for Line 1, and a new AccountingDistribution line has been added Identification ID1ID Identification RequisitionAccountingDistribution actionCode=UPDATE Identification ID1ID Identification AccountingDistribution Percentage15Percentage AccountingDistribution RequisitionAccountingDistribution RequisitionAccountingDistribution actionCode=ADD Identification ID3ID Identification AccountingDistribution Percentage15Percentage AccountingDistribution RequisitionAccountingDistribution RequisitionLine RequisitionLine actionCode=DELETE Indicates this line has been deleted Identification ID2ID Identification RequisitionLine RequisitionLine actionCode=UPDATE Identification ID3ID Identification ItemReference Identification ID1001ID Identification ItemReference RequisitionLine RequisitionLine RequisitionLine actionCode=ADD Indicates this line has been added Identification ID4ID Identification ItemReference Identification ID1005ID Identification ItemReference RequisitionLine UpdateRequisition Constructing the ABCS 12-29 Content Payload The payload of an operation that uses an Update verb is typically the entire EBO and in general every business object has only two messages with an Update operation single and list. Situations may occur in which subsets of an EBO must be updated, in which case multiple update messages may possibly exist, each with a distinct payload. An example is a possible UpdateSalesOrderLineEBM message with a payload that contains only SalesOrderLine. Verb Attributes The Update verb has an optional ResponseCode attribute that is intended to communicate the payload that is expected in the response message to the Update request. The possible values for the ResponseCode are restricted to either ID response payload is expected to be the Identifier of the object that was created or OBJECT response payload is expected to be the entire object that was created. Corresponding Response Verb The Update verb has a paired UpdateResponse verb that is used in the response message for each Update EBM. The response is expected to be provided by the target application only if the original request message explicitly requests a response by setting the ResponseCode attribute in the Update message. The payload of the response is either the ID or the entire object that was updated, depending on the ResponseCode specified in the Update request. Response Content Payload The payload type of the response verb is always based on the payload type of the Update Request operation. It is implemented as a different type to support user customization if needed.

12.8.3 Delete