/// <summary> /// Get the transition object from the store or null if not found /// </summary> /// <param name="store">The store to search</param> /// <param name="eventMsg">The message to insert in the transition object</param> /// <returns>The transition object from the store or null if not found</returns> private ISpStateTransition GetTransitionFromStore(Dictionary <int, ISpStateTransition> store, ISpEventMessage eventMsg) { return(WrapErr.ToErrorReportException(50204, () => { ISpStateTransition t = SpTools.GetTransitionCloneFromStore(store, eventMsg); if (t != null) { this.LogTransition(t, eventMsg); } return t; })); }
/// <summary> /// Allows derived classes to convert the message id to string if they are using strongly /// typed convetible enums. By default this level just calls int.ToString(). It will also /// make the logs more readeable /// </summary> /// <param name="id">The message id to convert to string</param> /// <returns></returns> protected string GetCachedMsgTypeId(int id) { return(SpTools.GetIdString(id, this.msgIdCache, this.idConverter.MsgTypeId)); }
/// <summary> /// Allows derived classes to convert the type to string if they are using strongly /// typed convetible enums. By default this level just calls int.ToString() so you /// would end up with a name chaine some like '2.4.12' /// </summary> /// <param name="id">The id to convert to string</param> /// <returns></returns> protected string GetCachedStateId(int id) { return(SpTools.GetIdString(id, this.stateIdCache, this.idConverter.StateId)); }
/// <summary> /// Allows derived classes to convert the event id to string if they are using strongly /// typed convetible enums. By default this level just calls int.ToString(). It will also /// make the logs more readeable /// </summary> /// <param name="id">The id to convert to string</param> /// <returns></returns> protected string GetCachedEventId(int id) { return(SpTools.GetIdString(id, this.eventIdCache, this.idConverter.EventId)); }
/// <summary> /// Register a state transition from the result of state processing. /// </summary> /// <param name="eventId">The id converter of the event as the result of state processing</param> /// <param name="transition">The transition object</param> public void RegisterOnResultTransition(ISpToInt eventId, ISpStateTransition transition) { SpTools.RegisterTransition("OnResult", eventId, transition, this.onResultTransitions); }