-
Notifications
You must be signed in to change notification settings - Fork 1
Action Node
Action Node represents a single step or action in an Activity. It is one of the fundamental building blocks of the Activity in Stateflows framework.
Action Nodes can have multiple incoming and outgoing Flows to accept input and pass on output Tokens.
An Action Node consists of:
- Name, uniquely identifying the Action Node within the Activity,
- Logic, code that is invoked when the Action Node is executed,
- Incoming Flows, passing input Tokens into the node,
- Outgoing Flows, passing output Tokens outside the node.
In UML, an Action Node is represented as a rectangle with rounded corners:
stateDiagram-v2
ActionNode --> NextNode : Result
Equivalent Stateflows notation of an Action Node:
/* fragment of Activity definition */
.AddAction("ProcessData",
async c =>
{
/* logic to process data */
},
b => b.AddFlow<Result>("NextNode")
)
.AddAction("NextNode",
async c =>
{
/* subsequent logic */
}
)Using lambda style means that the Action Node is defined by its name and logic, with flows specified using a fluent builder.
public class ProcessData : IActionNode
{
public async Task ExecuteAsync()
{
/* logic to process data */
}
}
public class NextNode : IActionNode
{
public async Task ExecuteAsync()
{
/* subsequent logic */
}
}
/* fragment of Activity definition */
.AddAction<ProcessData>(b => b
.AddFlow<Result, NextNode>()
)
.AddAction<NextNode>()Using typed style means that the Action Node is represented by a class implementing the
IActionNodeinterface.
Home page Support Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0. © by Mikołaj Milewski, 2025
Overview
Installation
Behaviors
State Machines
Building blocks
States
State
Composite State
Orthogonal State
Final State
Pseudostates
Choice
Junction
Fork
Join
Transitions
Transition
Default Transition
Internal Transition
Concepts
Evaluation of Transitions
Activities
Building blocks
Nodes
Action Node
Decision Node
Merge Node
Initial Node
Final Node
Input Node
Output Node
Fork Node
Join Node
Accept Event Action Node
Send Event Action Node
Data Store Node
Structured Activity Node
Iterative Activity Node
Parallel Activity Node
Flows
Data Flow
Control Flow
Concepts
Implicit fork and join
Actions