Previous UML Classes Table of Contents UML Packages Next


12.3.27 ExpansionRegion

ExtraStructuredActivities


   An expansion region is a structured activity region that executes multiple times corresponding to elements of an input collection.

*Generalizations

   StructuredActivityNode (from CompleteStructuredActivities , StructuredActivities) on page 425

*Description

Issue 8482 -replace ‘input pins’ with ‘inputs’

   An expansion region is a strictly nested region of an activity with explicit input and outputs (modeled as ExpansionNode s). Each input is a collection of values. If there are multiple inputs, each of them must hold the same kind of collection, although the types of the elements in the different collections may vary. The expansion region is executed once for each element (or position) in the input collection.

Issue 8483 -remove first sentence

   8488 -remove phrase ‘at runtime’

   The number of output collections can differ from the number of input collections. On each execution of the region, an output value from the region is inserted into an output collection at the same position as the input elements. If the region execution ends with no output, then nothing is added to the output collection. When this happens the output collection will not have the same number of elements as the input collections, the region acts as a filter. If all the executions provide an output to the collection, then the output collections will have the same number of elements as the input collections.

   The inputs and outputs to an expansion region are modeled as ExpansionNode s. From outside of the region, the values on these nodes appear as collections. From inside the region the values appear as elements of the collections. Object flow edges connect pins outside the region to input and output expansion nodes as collections. Object flow edges connect pins inside the region to input and output expansion nodes as individual elements. From the inside of the region, these nodes are visible as individual values. If an expansion node has a name, it is the name of the individual element within the region.

Issue 8485 -add sentence at the end of the paragraph on effect of input pins

   Any object flow edges that cross the boundary of the region, without passing through expansion nodes, provide values that are fixed within the different executions of the region Input pins, introduced by merge with CompleteStructuredActivities , provide values that are also constantduring the execution of the region.

   Attributes

Issue 9191 -add default value

   Associations

   • outputElement : ExpansionNode [0..*] An object node that accepts a separate element of the output collection during each of the multiple executions of the region. The values are formed into a collection that is available when the execution of the region is complete.

   Constraints

   [1] An ExpansionRegion must have one or more argument ExpansionNode s and zero or more result ExpansionNode s.

   Semantics

Issue 8241 - replaced ‘concurrency’ with ‘mode’

   8484 - superseded by 8486 resolution

   8486 - add third sentence and remove ‘multiple’ from last sentence in paragraph

   When an execution of an activity makes a token available to the input of an expansion region, the expansion region consumes the token and begins execution. The expansion region is executed once for each element in the collection. If there are multiple inputs, a value is taken from each for each execution of the internals of the region. The mode attribute controls how the executions proceed:

   Notation

   An expansion region is shown as a dashed rounded box with one of the keywords parallel, iterative, or streaming in the upper left corner.

   Input and output expansion nodes are drawn as small rectangles divided by vertical bars into small compartments. (The symbol is meant to suggest a list of elements.) The expansion node symbols are placed on the boundary of the dashed box. Usually arrows inside and outside the expansion region will distinguish input and output expansion nodes. If not, then a small arrow can be used as with Pins (see Figure 12.124 on page 419).



   Figure 12.82 - Expansion region

   As a shorthand notation, the list box pin notation may be placed directly on an action symbol, replacing the pins of the action ( Figure 12.83 ). This indicates an expansion region containing a single action. The equivalent full form is shown in Figure 12.84.

Figure 12.83 - Shorthand notation for expansion region containing single node

Figure 12.84 - Full form of previous shorthand notation

*Presentation Options

    The notation in Figure 12.85maps to an expansion region in parallel mode, with one behavior invoked in the region, as shown below.


   Figure 12.85 - Notation for expansion region with one behavior invocation

*Examples

    Figure 12.86 shows an expansion region with two inputs and one output that is executed in parallel. Execution of the region does not begin until both input collections are available. Both collections must have the same number of elements. The interior activity fragment is executed once for each position in the input collections. During each execution of the region, a pair of values, one from each collection, is available to the region on the expansion nodes. Each execution of the region produces a result value on the output expansion node. All of the result values are formed into a collection of the same size as the input collections. This output collection is available outside the region on the result node after all the parallel executions of the region have completed.

   «parallel»

Figure 12.86 - Expansion region with 2 inputs and 1 output

    Figure 12.86 shows a fragment of a Fast Fourier Transform (FFT) computation containing an expansion region. Outside the region, there are operations on arrays of complex numbers. S, Slower, Supper, and V are arrays. Cut and shuffle are operations on arrays. Inside the region, two arithmetic operations are performed on elements of the 3 input arrays, yielding 2 output arrays. Different positions in the arrays do not interact, therefore the region can be executed in parallel on all positions.

   Issue 8241 -change ‘concurrent’ to ‘parallel’ 8487 -duplicate of 8241

   S: Array<Complex>

   V: Array<Complex>

   Slower: Array<Complex> Supper: Array<Complex>







   root:Complex

   «parallel»

   nxtodd:Complex

   Snodd: Array<Complex>

   Sneven: Array<Complex>



   S’: Array<Complex>

   Figure 12.87 - Expansion region

   The following example shows a use of the shorthand notation for an expansion region with a single action. In this example, the trip route outputs sets of flights and sets of hotels to book. The hotels may be booked independently and in parallel with each other and with booking the flight.


   Figure 12.88 -Examples of expansion region shorthand

   Specify Trip Route below can result in multiple flight segments, each of which must be booked separately. The Book Flight action will invoke the Book Flight behavior multiple times, once for each flight segment in the set passed to BookFlight.


   Figure 12.89 - Shorthand notation for expansion region

   Expansion regions are introduced to support applying behaviors to elements of a set without constraining the order of application.

*Changes from previous UML

   ExpansionRegion replaces MapAction, FilterAction, and dynamicConcurrency and dynamicMultiplicity attributes on ActionState. Dynamic multiplicities less than unlimited are not supported in UML 1.5.