Skip to content

feat: adding state machine instantiation#81

Merged
Frnd-me merged 8 commits intoCollaborativeStateMachines:developfrom
Frnd-me:develop
Feb 2, 2026
Merged

feat: adding state machine instantiation#81
Frnd-me merged 8 commits intoCollaborativeStateMachines:developfrom
Frnd-me:develop

Conversation

@Frnd-me
Copy link
Contributor

@Frnd-me Frnd-me commented Jan 27, 2026

Pull Request

Description

Adding required CSML entry point:

version = "4.0.0"
collaborativeStateMachine {
  stateMachines {
    ["oneMachine"] = machines.one
    ["twoMachine"] = machines.two
    ["threeMachine"] = machines.three
    ["fourMachine"] = machines.four
  }
  persistent { ["b"] = "false"; ["c"] = "false" }
}
instantiate {
  ["one"] = "oneMachine"
  ["two"] = "twoMachine"
  ["three"] = "threeMachine"
  ["four"] = "fourMachine"
}
instanceData {
  ["one"] { ["target"] = "'two'" }
}
instanceSubscriptions {
  ["one"] { "two" }
}

Where collaborativeStateMachine describes the static collaborative state machine (class).

Instances of state machine classes are specified using instantiate, where the key represents the instance name and the value represents the state machine class name.

Each instance can be supplied with instance data via instanceData, where the map value is a context.

Instance (event) subscriptions are specified using instanceSubscriptions, where the values must be instance names.

Additionally, event subscription has been extended:

  • Global events are received regardless of event subscriptions.
  • External events are received when subscribed to the external events raised by a state machine instance.
  • When raising an event, a target instance name can be specified (expression); if it is specified, it must match the target state machine instance name, any non-matching state machine instance ignores it.
  • Internal events are now propagated to the parent first and then tunnel down through a nested hierarchy.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code style update
  • Refactoring
  • Build-related changes
  • CI-related changes

How has this been tested?

All tests pass.

@Frnd-me Frnd-me changed the title feat: introducing csml entry point description feat: adding state machine instantiation Jan 29, 2026
@Frnd-me Frnd-me merged commit b3baed9 into CollaborativeStateMachines:develop Feb 2, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant