Prev | Next |
Specifying Action Sequence with Control Flows
Actions are executed within the context of an Activity, and the order in which the Actions are executed is largely controlled by the use of special connectors called Control Flows. These connectors are directed lines drawn between Actions and act essentially as a conduit for control tokens - allowing the tokens to flow from one Action to the next in the direction of the arrow. An Action cannot commence its work until all incoming Control Flows have received a token; once they have and the Action is executed a token is said to be placed on the outgoing Control Flow, which implies it will travel to the next Action in the sequence. Control Flow relationships are available from the 'Activity' pages of the Diagram Toolbox

There are also Control Nodes that can be used with Control Flows to orchestrate the way the Flows work with the use of Forks, Joins, Decisions and Merges. There are three specialized nodes: Initial, Final and Flow Final, that act as the start and finish of the flow respectively. The Final (formally Activity Final) node is used to indicate that when a token arrives the entire Activity terminates, whereas the Flow Final will consume incoming tokens but will have no effect on the enclosing Activity.

Interrupting Normal Flow
There are a number of circumstances during the execution of an Activity when a modeler might want to specify a way of stopping the behavior in a part of an Activity. For example, in a real-world scenario a user might get part way though using a machine function such as calibrating a centrifuge, and then decide that they want to end a particular part of the calibration process. This scenario might be provided by a
on the interface. The SysML allows this situation to be modeled using an Interruptible Region and an Interrupting Edge. The notation allows the Interruptible Region to be drawn to include a number of elements such as Actions and other Nodes. Typically, when something unusual occurs an Event is fired in the Activity and received by an Accept Signal Action; this element has no incoming control flows and a single outgoing Interrupting Edge, which targets an Action that resides outside the Region.In this diagram, an engineer has modeled the process used for performing a speed calibration for a centrifuge. The centrifuge calibration process can be interrupted for various reasons; for example, if the centrifuge has become unstable or the operator is called away to perform other duties. An Accept Event Action is used to show that the Activity has a mechanism to listen for a required interruption within a specified Region of the Activity. The special Interrupt Flow connector then targets an Action outside the Region, which is used to shut down the centrifuge; finally this flows to the calibration Activity being terminated.