Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Chapter 9 - Modeling Flow-Based Behavior... > 9.3 Actions--The Foundation of Activ... - Pg. 208

208 CHAPTER 9 Modeling Flow-Based Behavior with Activities 9.3 ACTIONS--THE FOUNDATION OF ACTIVITIES As described previously, an activity decomposes into a set of actions that describe how the activity executes and transforms its inputs to outputs. There are several different categories of actions in SysML described during this chapter, but this section provides a summary of the fundamental behavior of all actions. SysML activities are based on token-flow semantics related to Petri-Nets [42, 43]. Tokens hold the values of inputs, outputs, and control that flow from one action to another. An action processes tokens placed on its pins. A pin acts as a buffer where input and output tokens to an action can be stored prior to or during execution; tokens on input pins are consumed, processed by the action, and placed on output pins for other actions to accept. Each pin has a multiplicity that describes the minimum and maximum number of tokens that the action consumes or produces in any one execution. If a pin has a minimum multiplicity of zero, then it is optional, marked by the keyword optional in guillemets. Otherwise, it is said to be required. The action symbol varies depending on the type of action, but typically it is a rectangle with round corners. The pin symbols are small boxes flush with the outside surface of the action symbol and may contain arrows indicating whether the pin is an input or output. Once a pin is connected to a flow and the direction of flow becomes obvious, the arrow notation in the pin may be elided. Figure 9.3 shows a typical action, called a1, with a set of input and output pins. One input pin and one output pin are required; that is, they have a lower multiplicity bound greater than zero. The other two pins are optional; that is, they have a lower multiplicity bound of zero. The action also has one incoming control flow and one outgoing control flow; see Section 9.6 for a detailed description of control flows. An action will begin execution when tokens are available on all its required inputs, including its control inputs as described next. The following rules summarize the requirements for actions to begin and end execution: n n n The first requirement is that the action's owning activity must be executing. Given that, the basic rules for whether an action can execute are as follows: ­ The number of tokens available at each required input pin is equal to or greater than its lower multiplicity bound. ­ A token is available on each of the action's incoming control flows. Once these prerequisites are met, the action will start executing and the tokens at all its input pins are available for consumption. required input [1] «optional» input [0..1] a1 required output [1..*] «optional» output [0..*] FIGURE 9.3 An action with input and output pins and input and output control flow.