Skip to content

Conversation

@jakob-osl
Copy link
Contributor

What

I added a new action type to allow the dynamic creation of state machines as this could be very useful.

Example

// The state machine we'd like to spawn
local patient: CSM.StateMachineDescription = new {
    name = "PatientStateMachine"
    localContext {
        variables {
            new { name = "patientId"; value = "$patientId" }

        }
    }
    states {
        demo
    }
}

// in the state of some other state machine this might happen
...
  on {
        new {
            event = eNewPatient
            actions {
                new CSM.SpawnActionDescription {
                  stateMachine = patient
                }
            }
        }
      }
...

How

Created a new action type called spawn
Created a new action description called SpawnActionDescription which has a property of type StateMachineDescription

  • The state machine calling a spawn action will be the parent of the newly created state machine
  • It is possible to use event data in the StateMachineDescription as the extent of the event (which contains the event data) is passed along to the creation of the state machine (which then creates the contexts)

jakob-osl and others added 8 commits September 5, 2025 13:51
# Conflicts:
#	build.gradle.kts
#	src/main/java/at/ac/uibk/dps/cirrina/execution/command/CommandFactory.java
#	src/main/java/at/ac/uibk/dps/cirrina/execution/object/action/ActionBuilder.java
#	src/main/java/at/ac/uibk/dps/cirrina/execution/object/statemachine/StateMachine.java
#	src/main/java/at/ac/uibk/dps/cirrina/runtime/OnlineRuntime.java
#	src/main/java/at/ac/uibk/dps/cirrina/runtime/Runtime.java
#	src/main/resources/pkl/CollaborativeStateMachineDescription.pkl
# Conflicts:
#	src/main/java/at/ac/uibk/dps/cirrina/cirrina/Runtime.kt
#	src/main/resources/pkl/csm/Csml.pkl
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