Example
This section provides an example of the Commonality: Specialization pattern. The example consists of three use-case descriptions: Perform Task, Generate Pick List, and Generate Invoicing Basis (see Figure 17.3). The abstract use case Perform Task models how a task is performed in general, that is, how it is selected, the fact that it is performed (but not how; this is left to be defined in specializing use cases), and what happens to the task when it is completed. The other two use cases are specializations of Perform Task. Generate Pick List models how the information about what items to be picked in a warehouse is compiled, whereas Generate Invoicing Basis models how the information about all noninvoiced orders is compiled and sent to the Financial System actor. (For the registration of tasks, see Chapter 28, "Future Task.")
Apart from the Future Task blueprints, the Report Generation blueprints are also useful in this example.
For examples of the Commonality: Reuse pattern, see Chapter 29, "Item Look-Up," and Chapter 27, "Access Control." For examples of the Commonality: Addition pattern, see Chapter 31, "Login and Logout," and Chapter 19, "Concrete Extension or Inclusion." For an example using sub-sections for extracted subflows as in the Commonality: Internal Reuse pattern, see Chapter 21, "Large Use Case."
Figure 17.3 The Generate Pick List use case and the Generate Invoicing Basis use case are specializations of the Perform Task use case, which models how a task is performed in general.
Use Case: Perform Task
Brief Description
When initiated by a Task Manager, the use case retrieves a pre-registered task and, based on the registered information, performs it.
The use case is abstract.
Basic Flow
Start of the Flow
The use case starts when the Task Manager requests it. The use case collects all the tasks that are to be performed at this time and that have not been registered as active, failed, or postponed. The task with the highest priority is selected and marked as active.
Performance of the Task
The use case performs the task.
End of the Flow
If the task is performed successfully, it is removed.
The use case ends.
Alternative Flows
Failure of Task
If the performance of the task fails, the use case changes the status of the task to failed and stores it again together with the reason for failure. The use case ends.
No Task
If there is no task to be performed, the use case ends.
Use Case: Generate Pick List
Brief Description
The Generate Pick List use case, which is a specialization of the Perform Task use case, generates a list of items to be picked in the warehouse when compiling a shipment. The generated list is sent to a Warehouse Worker.
Basic Flow
Start of the Flow
The use case starts as described in the Perform Task use case.
Performance of the Task
The selected task being a generate pick list task, the use case collects all the orders that have been assigned to this pick list.
For each of these orders, the use case retrieves where in the warehouse the ordered items are to be found.
The use case calculates the total number of each ordered item.
The use case prints a list to the Warehouse Worker with all the items, the quantity of each item, and the location in the warehouse where each item is to be found.
The use case marks the collected orders as collected.
End of the Flow
The use case ends as described in the Perform Task use case.
Alternative Flows
Location Not Found
If the location of an item cannot be found, all orders containing the item are marked as special and removed from the shipment. The use case continues with the remaining orders.
No Order
If no order is assigned to the pick list, the performance of the task fails.
Use Case: Generate Invoicing Basis
Brief Description
The Generate Invoicing Basis use case, which is a specialization of the Perform Task use case, generates a basis for invoicing that is sent to the Financial System actor.
Basic Flow
Start of the Flow
The use case starts as described in the Perform Task use case.
Performance of the Task
The selected task being a generate invoicing basis task, the use case collects all the orders that are marked as shipped.
For each of these orders, the use case retrieves the customer's name and address, as well as the order number and the ordered value, including discounts and tax. The collected information is sent to the Financial System.
The Financial System acknowledges the invoicing information. The use case marks the collected orders as invoiced.
End of the Flow
The use case ends as described in the Perform Task use case.
Alternative Flows
No Order
If no orders are marked as shipped, no information is sent to the Financial System.
Information Not Retrievable
If the required information cannot be retrieved from an order, the status of the order is set to manual invoicing. The use case continues with the remaining orders.
No Acknowledgement
If no acknowledgement is received within two minutes, or if a message stating that something went wrong is received from the Financial System, the status of the orders is left unchanged and the performance of the task fails.