namespace dzn { interface IAxis { enum State { Ready, Error }; in bool EnableSignalInjection(); in bool DisableSignalInjection(); out void stateReady(); out void stateError(); behaviour { State state = State.Ready; on EnableSignalInjection: reply(true); on EnableSignalInjection: reply(false); on DisableSignalInjection: reply(true); on DisableSignalInjection: reply(false); on optional: stateReady; on optional: stateError; } } interface IAxisProvided { enum State { Ready, Error }; in bool EnableSignalInjection(); in bool DisableSignalInjection(); in bool IsSignalInjectionAllowed(); out void stateReady(); out void stateError(); behaviour { on EnableSignalInjection: reply(true); on EnableSignalInjection: reply(false); on DisableSignalInjection: reply(true); on DisableSignalInjection: reply(false); on IsSignalInjectionAllowed: reply(true); on IsSignalInjectionAllowed: reply(false); on optional: stateReady; on optional: stateError; } } component Axis { provides IAxis axis; requires IAxisProvided axisProvided; behaviour { on axis.EnableSignalInjection(): { bool allowed = axisProvided.IsSignalInjectionAllowed(); bool result = true; if (allowed) { result = axisProvided.EnableSignalInjection(); } reply(allowed && result); } on axis.DisableSignalInjection(): { bool result = axisProvided.DisableSignalInjection(); reply(result); } on axisProvided.stateError(): axis.stateError(); on axisProvided.stateReady(): axis.stateReady(); } } }