Action Node
Process object tokens through MATLAB function or nested activity diagram
Since R2024a
Description
An action node represents a specific action to execute within an activity diagram. This action is realized either through a MATLAB® function or a nested activity diagram.
Action nodes process incoming object tokens to produce new object tokens. Input object tokens are consumed through input pins, and newly generated object tokens exit through the output pins of an action node.
Action nodes begin execution only when all pre-conditions are met. That is, input pins must hold a minimum number of object tokens specified during pin configuration, and all incoming control flows must offer a control token.
For a roadmap of the activity diagram topics, see Describe System Behavior Using Activity Diagrams.
Action Node Queue Behavior
When an action node begins execution, it consumes object tokens from its input pins. Based on the value of the multiplicity parameter, the action node removes a certain, minimum number of tokens from each input pin during execution. The action node then passes these token values on to the MATLAB function or nested activity diagram where new output object tokens are generated for continued use in the activity.
While an action node consumes object tokens, more tokens may arrive at its input pins. These new tokens are not used because the action node is already occupied. The new tokens are queued in the input pin, which has these characteristics:
First in, first out — Object tokens that enter first are queued first for exiting the pin.
Blocking queue — If a new object token arrives when the queue is already full, it is blocked from entry until at least one token in the queue enters the action node to make space. While the new object token is waiting to enter the queue, it is said to be in the pending state.
The capacity of an input pin is determined by its multiplicity, defined in the Token Multiplicity parameter.
Once an action node generates output object tokens, they exit through the output pin. The output pin of an action node has these characteristics:
Multiplicity of one — The output pin of an action node can hold only one object token at a time.
Overwriting queue — If a new object token exits when the output pin already contains a token, then the new token replaces the old token.
Create an Action Node
You can create an action node on the activity diagram canvas in two ways:
Drag and drop the Action Node block from the palette on the left to any location on the canvas.
Hold down the left mouse button at the desired location on the canvas and drag in any direction. A blue outline of a node appears on the canvas. Select Create Action from the horizontal menu that appears below the outline.
Parameters
Version History
Introduced in R2024a