[ Team LiB ] |
![]() ![]() |
Expansion RegionsWith activity diagrams, you often run into situations in which one action's output triggers multiple invocations of another action. There are several ways to show this, but the best way is to use an expansion region. An expansion region marks an activity diagram area where actions occur once for each item in a collection. In Figure 11.9, the Choose Topics action generates a list of topics as its output. Each element of this list then becomes a token for input to the Write Article action. Similarly, each Review Article action generates a single article that's added to the output list of the expansion region. When all the tokens in the expansion region end up in the output collection, the region generates a single token for the list that's passed to Publish Newsletter. Figure 11.9. Expansion region
In this case, you have the same number of items in the output collection as you do in the input collection. However, you may have fewer, in which case the expansion region acts as a filter. In Figure 11.9, all the articles are written and reviewed in parallel, which is marked by the «concurrent» keyword. You can also have an iterative expansion region. Iterative regions must fully process each input element one at a time. If you have only a single action that needs multiple invocation, you use the shorthand of Figure 11.10. The shorthand assumes concurrent expansion, as that's the most common. This notation corresponds to the UML 1 concept of dynamic concurrency. Figure 11.10. Shorthand for a single action in an expansion region
![]() |
[ Team LiB ] |
![]() ![]() |