Skip to content

Initial Node

Mikołaj Milewski edited this page Apr 5, 2025 · 1 revision

Overview

The Initial Node represents the starting point of an Activity or Structured Activity Node. It is a special type of Node that has no incoming Flows and is automatically activated when the Activity/Structured Activity Node executes.

An Initial Node consists of:

  • Name, uniquely identifying the Initial Node within the Activity,
  • Outgoing Control Flows, passing Control Token to the next Nodes.

Definition

In UML, an Initial Node is represented as a filled circle:

flowchart

initial@{ shape: circle, label: " " }
initial --> action1
action1(SomeAction)
initial --> action2
action2(AnotherAction)
Loading

Equivalent Stateflows notation of an Initial Node:

Lambda style

    /* fragment of Activity definition */
    .AddInitial(b => b
        .AddControlFlow("SomeAction")
        .AddControlFlow("AnotherAction")
    )
    .AddAction("SomeAction",
        async c => {
            /* logic for the action */
        }
    )
    .AddAction("AnotherAction",
        async c => {
            /* logic for the action */
        }
    )

Typed style

    public class SomeAction : IActionNode
    {
        public async Task ExecuteAsync()
        {
            /* logic for the action */
        }
    }

    public class AnotherAction : IActionNode
    {
        public async Task ExecuteAsync()
        {
            /* logic for the action */
        }
    }

    /* fragment of Activity definition */
    .AddInitial(b => b
        .AddControlFlow<SomeAction>()
        .AddControlFlow<AnotherAction>()
    )
    .AddAction<SomeAction>()
    .AddAction<AnotherAction>()

Using lambda style and typed style doesn't change anything for Initial Node - it is not referenced by name nor type, simple AddInitial() call declares it.

Usage

The Initial Node is the entry point of an Activity and Structured Activity Nodes and is executed when Activity / Structured Activity Node is initialized. It is not mandatory though: Activity can define no logic on initialization, but react to incoming Tokens using Input Node or to incoming Events using Accept Event Action Nodes.

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

Clone this wiki locally