Business Object Document Process processing pattern
The Business Object Document Process pattern performs a single action on a single noun. Based on the information within that noun, a Process controller will control the actions of the business logic. This Process controller will read common data across the actions within the request, instantiate the task command implementations for those actions, and execute them.
This pattern is a much simplified version of the pattern required for processing the Change request. The key difference between Process and Change is that the Process action must act upon the entire noun. Unlike the Change pattern, where each Change action expression will act upon an identified changeable part of the noun, the Process applies to the entire noun specified in the request.
The advantage of this design pattern over the previous message mapping approach is that the previous approach only could support one action expression per BOD request, because the SOI implementation mapped an action to a controller command. By using the BOD command framework, the Process design pattern can support multiple action expressions working on the same noun or different nouns. Each action code is mapped to a Process noun action task command implementation, by appending "+action_code" to the INTERFACENAME column of the CMDREG table when registering the command implementation.
The following describes the detailed flow of the BOD Process processing pattern:
- The Process noun controller command breaks down the BOD and calls the read() to resolve the root object of the nouns to change.
- The validate() method is called to perform any common validation required.
- An access control check is performed to ensure the current user can perform the action code specified on the noun specified.
- The Process noun action task commands (there may be more than one) are
instantiated, and for each command, the validate method is executed to report
potential errors that may occur during processing.
- The Process noun action command will read any information required and validate whether the input is valid for the operation.
- The Process noun action task commands (there may be more than one) are
executed to perform the change.
- The Process noun action task command applies the changes.
- The Process noun action task command saves any changes made to data objects retrieved in the current instance of the command.
- The save is called on the object retrieved in step 1.
- The response is created and returned.