You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Server: route FiniteStateMachineDispatcher through the FiniteStateMachineState transition core #5224
Follow-up to the MD-1 state-machine builder consolidation.
Problem
FiniteStateMachineDispatcher (src/Opc.Ua.Server) is still a separate path for changing a state machine's state. The Di, Extrusion, MachineTool and Robotics companion servers use it.
It is meant for generated machines that have no StateTable or TransitionTable. It writes CurrentState and LastTransition directly. That differs from FiniteStateMachineState.DoTransition, PrepareTransition/CommitTransition, StateMachineBuilder<T> and ProgramRuntime, which all go through the machine's transition core. As a result, the dispatcher:
raises no TransitionEventType events,
does not increment StateRevision or otherwise act like a committed transition,
runs no guards and no OnBefore/OnAfter transition hooks, so builder callbacks (OnEnter/OnExit/OnTransition/When*) never fire on these machines.
What unifying it needs
State tables for generated machines. The core needs state and transition tables. Either the source generator emits them from the type model (HasTransition, FromState/ToState, HasCause), or Opc.Ua.Core.Types gets an API that injects them into FiniteStateMachineState.
Route the dispatcher through the core. With the tables in place, the dispatcher (or its callers) can use DoTransition/DoCause, or the dispatcher can be removed in favour of StateMachineBuilder<T>.
Accept the visible behaviour change. The four companion servers would start emitting TransitionEvents and bumping StateRevision. That is spec-conformant (OPC 10000-16), but clients and tests of those servers will see it. It needs a changelog and migration note.
Out of scope / already done
ProgramRuntime already commits through PrepareTransition/CommitTransition, so it needs no change.
The Fluent IStateMachineBuilder now forwards to StateMachineBuilder<T>.
Activity
Server: make StateMachines the one state-machine builder (#5225)