Previous | UML Classes | Table of Contents | UML Packages | Next |
A loop node is a structured activity node that represents a loop with setup, test, and body sections.
•
StructuredActivityNode (from CompleteStructuredActivities , StructuredActivities) on page 425.
Each section is a well-nested subregion of the activity whose nodes follow any predecessors of the loop and precede any successors
of the loop. The test section may precede or follow the body section. The setup section is executed once on entry to the loop,
and the test and body sections are executed repeatedly until the test produces a false value. The results of the final execution
of the test or body are available after completion of execution of the loop.
Issue 9191 -add default value
• isTestedFirst : Boolean [1] If true, the test is performed before the first execution of the body. If false, the body is
executed once before the test is performed. Default value is false.
Package StructuredActivities
Issue 8740 -replace ActivityNode by ExecutableNode
• setupPart : ExecutableNode [0..*]The set of nodes and edges that initialize values or perform other setup computations for the loop.
• bodyPart : ExecutableNode [0..*]The set of nodes and edges that perform the repetitive computations of the loop. The body section is executed as long as the test section produces a true value.
• test : ExecutableNode [0..*] The set of nodes, edges, and designated value that compute a Boolean value to determine if another execution of the body will be performed.
• decider : OutputPin [1] An output pin within the test fragment the value of which is examined after execution of the test to determine whether to execute the loop body.
Package CompleteStructuredActivities
Issue 8255 -add subsets and ordered constraints
8733 -replace ‘copied’ with ‘moved’ 8490 -remove ‘owned by the loop’ from ‘loopVariable’ description and remove subsets constraint
add {ordered} constraint on ‘bodyOutput’
• result : OutputPin [0..*] {ordered} A list of output pins that constitute the data flow output of the entire loop. {Subsets Action::output}
• loopVariable : OutputPin [0..*] {ordered} A list of output pins that hold the values of the loop variables during an execution of the loop. When the test fails, the values are moved to the result pins of the loop.
• bodyOutput : OutputPin [0..*] {ordered} A list of output pins within the body fragment the values of which are moved to the loop variable pins after completion of execution of the body, before the next iteration of the loop begins or before the loop exits.
• loopVariableInput : InputPin[0..*] {ordered}A list of values that are moved into the loop variable pins before the first iteration of the loop. {Subsets Action::input}
Issue 8491 - add constraint and package subheading
Package CompleteStructuredActivities
[1] Loop variable inputs must not have outgoing edges.
Issue 8497 - add constraint
[2] The bodyOutput pins are output pins on actions in the body of the loop node
Issue 8939 - add constraint
[3] The result output pins have no incoming edges.
No part of a loop node is executed until all control-flow or data-flow predecessors of the loop node have completed execution.
When all such predecessors have completed execution and made tokens available to inputs of the loop node, the loop node captures
the input tokens and begins execution.
First the setup section of the loop node is executed. A front end node is a node within a nested section (such as the setup
section, test section, or body section) that has no predecessor dependencies within the same section. A control token is offered
to each front end node within the setup section. Nodes in the setup section may also have individual dependencies (typically
data flow dependencies) on nodes external to the loop node. To begin execution, such nodes must receive their individual tokens
in addition to the control token from the overall loop.
A back end node is a node within a nested section that has no successor dependencies within the same section. When all the
back end nodes have completed execution, the overall section is considered to have completed execution. (It may be thought
of as delivering a control token to the next section within the loop.)
When the setup section has completed execution, the iterative execution of the loop begins. The test section may precede or
follow the body section (test-first loop or test-last loop). The following description assumes that the test section comes
first. If the body section comes first, it is always executed at least once, after which this description applies to subsequent
iterations.
When the setup section has completed execution (if the test comes first) or when the body section has completed execution
of an iteration, the test section is executed. A control token is offered to each front end node within the test section.
When all back end nodes in the test section have completed execution, execution of the test section is complete. Typically
there will only be one back end node and it will have a Boolean value, but for generality it is permitted to perform arbitrary
computation in the test section.
When the test section has completed execution, the Boolean value on the designated decider pin within the test section is
examined. If the value is true, the body section is executed again. If the value is false, execution of the loop node is complete.
When the setup section has completed execution (if the body comes first) or when the iteration section has completed execution
and produced a true value, execution of the body section begins. Each front end node in the body section is offered a control
token. When all back end nodes in the body section have completed execution, execution of the body section is complete.
Within the body section, variables defined in the loop node or in some higher-level enclosing node are updated with any new
values produced during the iteration and any temporary values are discarded.
No specific notation.
Loop nodes are introduced to provide a structured way to represent iteration.
Loop nodes are new in UML 2.0.