|
|
|
|
|
|||||
|initialize() |---------> |
| | | | | | | | |||||
| | |*[for each orderline] |initialize() |--------------------> |
| | | | | | |||||
| | | | |inStock:=chek() |--------------> |
| | | | |||||
| | | | |[inStock] |add |--------------> |
| | | | |||||
| | | | | | |reorder:=reorder() |_ _ _ _ _ | ||||||
| | | | | | | | |
||||||
| | | | | | |<--------- | | | |||||
| | |[not inStock] hold() |<-------------------- |
|<-------------- | | | | | |||||
| | |----------------------- | |----------------- | |-----------------> | | | |||||
verify() |
|
The OrderWindow object sends an initialize message to the Order object, which in turn sends an initialize message to each OrderLine object.
The OrderLine object sends a message to the Item object to check available stock. If the item is in stock, then it ts added.
The Item object sends a message to itself to check the reorder point on the item and if needs to reorder it sends a message to the ReorderItem to be reordered and returns to OrderLine. If the item is not in stock, the OrderLine object sends a message to the order, placing it on hold.