Business Object Document Change processing pattern

The Business Object Document Change processing pattern adds, changes, or deletes a business object. This processing pattern is similar to the SOI Change pattern. In the SOI Change pattern implementation, Change requests map to existing WebSphere Commerce controller commands. The request Business Object Document is converted into the name-value pair parameters that are passed to the controller command. This enables reuse of existing business logic as a service. One limitation of this implementation is that the SOI Change request can only have one action. Because this design pattern uses BOD processing commands, the limitation of one action in the Change request is lifted. The other major difference is that the BOD Change pattern uses service data objects (SDO) to pass data, instead of name-value pairs. For the Change request processing pattern, the logic is divided into three command types:

The following steps describe the detailed flow of the Change processing pattern:

  1. The Change noun controller command divides the BOD and calls read() to resolve the root objects of the nouns to change. The root object is the primary record of the business object.

  2. The validate() method is called to perform any common validation required.

  3. An access control check is performed to ensure the current user has permission to change the specified noun.

  4. The Change noun part task commands are instantiated and for each command, the validate() method is executed to report potential errors that can occur during processing.

    1. The Change noun part command will read any information required and validate the input.

  5. The Change noun part task command is executed to perform the change.

    1. The Change noun part applies the changes.

    2. The Change noun part saves any changes made to data objects retrieved in the current instance of the command.

  6. The post change noun part command is instantiated and executed.

    1. More data is read in the findObjects() method.

    2. Other data may be changed in the applyChanges() method.

    3. Any changes are saved in the saveObject() method.

  7. The save is called on the object retrieved in step 1.

  8. The response is created and returned.