Skip to content

Data Store Node

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

Overview

Data Store Node represents a storage mechanism in an Activity. Every Token that has passed to it is stored and always passed on to output Flows - as a result those Flows are considered always activated.

A Data Store Node consists of:

  • Name, uniquely identifying the Data Store Node within the Activity,
  • Incoming Flows, passing input Tokens into the node,
  • Outgoing Flows, passing output Tokens outside the node.

Definition

In UML, a Data Store Node is represented as a rectangle:

flowchart

initial@{ shape: circle, label: " " }
initial --> producer
producer(DataProducer)
producer -->|Data| store
store[DataStore]
store -->|Data| processor
processor(DataProcessor)
time@{ shape: hourglass, label: "Every hour" }
time --> processor
Loading

Equivalent Stateflows notation of a Data Store Node:

Lambda style

    /* fragment of Activity definition */
    .AddInitial(b => b
        .AddControlFlow("DataProducer")
    )
    .AddAction("DataProducer",
        async c => {
            /* logic that produces data */
        },
        b => b.AddFlow<Data>(DataStoreNode.Name)
    )
    .AddDataStore(b => b
        .AddFlow<Data>("DataProcessor")
    )
    .AddAction("DataProcessor",
        async c =>
        {
            /* processing logic */
        }
    )
    .AddTimeEventAction<EveryHour>(b => b
        .AddControlFlow("DataProcessor")
    )

Using lambda style means that the Data Store Node is defined by its name and logic, with flows specified using a fluent builder.

Typed style

    public class StoreData : IDataStoreNode
    {
        public async Task ExecuteAsync()
        {
            /* logic to store data */
        }
    }

    public class NextNode : IActionNode
    {
        public async Task ExecuteAsync()
        {
            /* subsequent logic */
        }
    }

    /* fragment of Activity definition */
    .AddDataStore<StoreData>(b => b
        .AddFlow<Data, NextNode>()
    )
    .AddAction<NextNode>()

Using typed style means that the Data Store Node is represented by a class implementing the IDataStoreNode interface.

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