import ExternalTypes.dzn; interface Module { in Result Initialize(); in void Terminate(); behavior { bool x = true; enum State { Uninitialized, Operational, }; State state = State.Uninitialized; [state.Uninitialized] { on Initialize: { [x] { reply(Result.Ok); state = State.Operational; } [x] { reply(Result.Fail); state = State.Operational; } } on Terminate: {} } [state.Operational] { on Terminate: state = State.Uninitialized; } } }