//    This is the function that will process an event either generated
        //  by the service, sent to it by another service on the same component,
        //  or as a message sent by a different component.
        public override bool processTransitions(InternalEvent ie)
        {
            bool done = false;

               // Since this function can be called from multiple threads,
               // we use a mutex to ensure only one state transition is
               // active at a time.
               mutex.WaitOne();

                // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("PingClient_PingClientFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ReportHeartbeatPulse().getID())
                    {
                        ReportHeartbeatPulse msg = new ReportHeartbeatPulse();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pPingClient_PingClientFSM.context.ReportHeartbeatPulseTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            mutex.ReleaseMutex();
            return done;
        }
 public void InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_InitTransition(InternalEvent ie)
 {
     transition_ = "InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_InitTransition";
     State.InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_InitTransition(this, ie);
     transition_ = "";
     return;
 }
Example #3
0
 /*
  * Checks to see if an event triggers an notification
  */
 public void processNotifications(string state, InternalEvent ie)
 {
     if (state.IndexOf(".") != -1)
     {
         state = state.Substring(state.LastIndexOf(".") + 1);
     }
     for (int i = 0; i < notifications.Count; i++)
     {
         if (notifications[i]._state == state)
         {
             if ((ie != null) && (notifications[i]._event.IndexOf(ie.getSource()) > 0))
             {
                 // ... this FSM was actually the CAUSE of the state change in the first place.
                 // In other words, detect the loop and don't send notification back to the
                 // original source of the transition.  This stops a parent from notifying
                 // a child, who in turn notifies the parent, who in turn notifies the child ad nauseum.
             }
             else
             {
                 // Ok... state change not caused by the target FSM, so send a notification to it.
                 notifications[i]._handler.invoke(new InternalEvent(notifications[i]._event, notifications[i]._source));
             }
         }
     }
 }
        //    This is the function that will process an event either generated
        //  by the service, sent to it by another service on the same component,
        //  or as a message sent by a different component.
        public override bool processTransitions(InternalEvent ie)
        {
            bool done = false;

               // Since this function can be called from multiple threads,
               // we use a mutex to ensure only one state transition is
               // active at a time.
               mutex.WaitOne();

                // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("InitToReadyEventDef") == 0 && (ie.getSource().CompareTo("AdditionClientServiceDef_additionClientFSM") != 0) && (!done))
                {
                    InitToReadyEventDef casted_ie = (InitToReadyEventDef) ie;
                        pAdditionClientServiceDef_additionClientFSM.context.InitToReadyEventDefTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_Ready") == 0 && (ie.getSource().CompareTo("AdditionClientServiceDef_additionClientFSM") != 0) && (!done))
                {
                        pAdditionClientServiceDef_additionClientFSM.context.InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("AdditionClientServiceDef_additionClientFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ReportAddition().getID())
                    {
                        ReportAddition msg = new ReportAddition();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pAdditionClientServiceDef_additionClientFSM.context.ReportAdditionTransition(msg);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_Init") == 0 && (ie.getSource().CompareTo("AdditionClientServiceDef_additionClientFSM") != 0) && (!done))
                {
                        pAdditionClientServiceDef_additionClientFSM.context.InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            mutex.ReleaseMutex();
            return done;
        }
Example #5
0
 public override void processInternalEvent(InternalEvent ie)
 {
     // Invoke the FSM transition for this event.  If no explicit transition
     // is defined, try a default transition...
     if (processTransitions(ie) == false)
     {
         defaultTransitions(ie);
     }
 }
Example #6
0
 public override void processInternalEvent(InternalEvent ie)
 {
     // Invoke the FSM transition for this event.  If no explicit transition
     // is defined, try a default transition...
     if (processTransitions(ie) == false)
     {
         defaultTransitions(ie);
     }
 }
 /// <summary>
 /// Pulls the next event off of the queue and gives it to the service.
 /// </summary>
 /// <returns>the event to be started - an empty event if no events waiting</returns>
 public InternalEvent invoked()
 {
     InternalEvent ie = new InternalEvent();
     lock (Lock) {
         if (internalEventQueue.Count != 0) {
             ie = internalEventQueue.Dequeue ();
         }
     }
     return ie;
 }
Example #8
0
        /// <summary>
        /// Pulls the next event off of the queue and gives it to the service.
        /// </summary>
        /// <returns>the event to be started - an empty event if no events waiting</returns>
        public InternalEvent invoked()
        {
            InternalEvent ie = new InternalEvent();

            lock (Lock) {
                if (internalEventQueue.Count != 0)
                {
                    ie = internalEventQueue.Dequeue();
                }
            }
            return(ie);
        }
Example #9
0
 /*
 * Checks to see if an event triggers an notification
 */
 public void processNotifications(string state, InternalEvent ie)
 {
     if (state.IndexOf(".") != -1)
         state = state.Substring(state.LastIndexOf(".")+1);
     for (int i=0; i < notifications.Count; i++)
     {
         if (notifications[i]._state == state)
         {
             // Note that we send a copy of the original internal event,
             // since processing the event will delete it and we might
             // still need the original for future notifications...
             if (ie != null)
                 notifications[i]._handler.invoke( new InternalEvent(notifications[i]._event, ie.getSource()) );
             else
                 notifications[i]._handler.invoke( new InternalEvent(notifications[i]._event, notifications[i]._source) );
         }
     }
 }
Example #10
0
    public override void processInternalEvent(InternalEvent ie)
    {
        bool done = false;

        //
        // When a component receives an internal event, it passes it
        // to the services to handling, children services first.  If the
        // event is not processed by normal transitions, it's passed
        // again to the services (children first) for default transitions.
        // A given event may only be processed by at most one service.
        //
        for (int i = serviceList.Count; i>0; i--)
        {
            if (!done) done = serviceList[i-1].processTransitions(ie);
        }
        for (int i = serviceList.Count; i>0; i--)
        {
            if (!done) done = serviceList[i-1].defaultTransitions(ie);
        }
    }
Example #11
0
 /*
 * Checks to see if an event triggers an notification
 */
 public void processNotifications(string state, InternalEvent ie)
 {
     if (state.IndexOf(".") != -1)
         state = state.Substring(state.LastIndexOf(".")+1);
     for (int i=0; i < notifications.Count; i++)
     {
         if (notifications[i]._state == state)
         {
             if ((ie != null) && (notifications[i]._event.IndexOf(ie.getSource()) > 0))
             {
                 // ... this FSM was actually the CAUSE of the state change in the first place.
                 // In other words, detect the loop and don't send notification back to the
                 // original source of the transition.  This stops a parent from notifying
                 // a child, who in turn notifies the parent, who in turn notifies the child ad nauseum.
             }
             else
             {
                 // Ok... state change not caused by the target FSM, so send a notification to it.
                 notifications[i]._handler.invoke(new InternalEvent(notifications[i]._event, notifications[i]._source));
             }
         }
     }
 }
Example #12
0
 /*
  * Checks to see if an event triggers an notification
  */
 public void processNotifications(string state, InternalEvent ie)
 {
     if (state.IndexOf(".") != -1)
     {
         state = state.Substring(state.LastIndexOf(".") + 1);
     }
     for (int i = 0; i < notifications.Count; i++)
     {
         if (notifications[i]._state == state)
         {
             // Note that we send a copy of the original internal event,
             // since processing the event will delete it and we might
             // still need the original for future notifications...
             if (ie != null)
             {
                 notifications[i]._handler.invoke(new InternalEvent(notifications[i]._event, ie.getSource()));
             }
             else
             {
                 notifications[i]._handler.invoke(new InternalEvent(notifications[i]._event, notifications[i]._source));
             }
         }
     }
 }
Example #13
0
        //    This is the function that will check for default transitions if
        //  no other transitions were satisfied.
        //
        public override bool defaultTransitions(InternalEvent ie)
        {
            bool done = false;

               // Since this function can be called from multiple threads,
               // we use a mutex to ensure only one state transition is
               // active at a time.
               mutex.WaitOne();

            // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("Send") == 0 && (ie.getSource().CompareTo("Transport_ReceiveFSM") != 0) && (!done))
                {
                    Send casted_ie = (Send) ie;
                        pTransport_ReceiveFSM.context.SendTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("BroadcastLocal") == 0 && (ie.getSource().CompareTo("Transport_ReceiveFSM") != 0) && (!done))
                {
                    BroadcastLocal casted_ie = (BroadcastLocal) ie;
                        pTransport_ReceiveFSM.context.BroadcastLocalTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("BroadcastGlobal") == 0 && (ie.getSource().CompareTo("Transport_ReceiveFSM") != 0) && (!done))
                {
                    BroadcastGlobal casted_ie = (BroadcastGlobal) ie;
                        pTransport_ReceiveFSM.context.BroadcastGlobalTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Send") == 0 && (ie.getSource().CompareTo("Transport_SendFSM") != 0) && (!done))
                {
                    Send casted_ie = (Send) ie;
                        pTransport_SendFSM.context.SendTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("BroadcastLocal") == 0 && (ie.getSource().CompareTo("Transport_SendFSM") != 0) && (!done))
                {
                    BroadcastLocal casted_ie = (BroadcastLocal) ie;
                        pTransport_SendFSM.context.BroadcastLocalTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("BroadcastGlobal") == 0 && (ie.getSource().CompareTo("Transport_SendFSM") != 0) && (!done))
                {
                    BroadcastGlobal casted_ie = (BroadcastGlobal) ie;
                        pTransport_SendFSM.context.BroadcastGlobalTransition();
                        done = true;
                }
            } catch (Exception e) {}

            mutex.ReleaseMutex();
            return done;
        }
 protected internal virtual void InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(Management_ReceiveFSMContext context, InternalEvent ie)
 {
     Default(context);
 }
                protected internal override void InternalStateChange_To_AccessControl_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(AccessControl_ReceiveFSMContext context, InternalEvent ie)
                {
                    AccessControl_ReceiveFSM ctxt = context.Owner;

                    #if TRACE
                    Trace.WriteLine(
                        "TRANSITION   : AccessControl_ReceiveFSM_SM.Receiving_Ready_Controlled_Available.InternalStateChange_To_AccessControl_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(, InternalEvent ie)");
                    #endif

                    context.State.Exit(context);
                    context.ClearState();

                    try
                    {
                        ctxt.initAction();
                        ctxt.processNotifications("Receiving_Ready_NotControlled_Available", ie);
                    }
                    finally
                    {
                        context.State = AccessControl_ReceiveFSM_SM.Receiving_Ready_NotControlled_Available;
                        context.State.Entry(context);
                    }

                    return;
                }
 protected internal virtual void InternalStateChange_To_AccessControl_ReceiveFSM_ReceivingTransition(AccessControl_ReceiveFSMContext context, InternalEvent ie)
 {
     Default(context);
 }
 public void InternalStateChange_To_AccessControl_ReceiveFSM_ReceivingTransition(InternalEvent ie)
 {
     transition_ = "InternalStateChange_To_AccessControl_ReceiveFSM_ReceivingTransition";
     State.InternalStateChange_To_AccessControl_ReceiveFSM_ReceivingTransition(this, ie);
     transition_ = "";
     return;
 }
Example #18
0
 // Classes to be overridden.
 public virtual void processInternalEvent(InternalEvent ie)
 {
 }
 public void InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(InternalEvent ie)
 {
     transition_ = "InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition";
     State.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(this, ie);
     transition_ = "";
     return;
 }
Example #20
0
 public virtual bool defaultTransitions(InternalEvent ie)
 {
     return false;
 }
                protected internal override void InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(Management_ReceiveFSMContext context, InternalEvent ie)
                {
                    Management_ReceiveFSM ctxt = context.Owner;

                    #if TRACE
                    Trace.WriteLine(
                        "TRANSITION   : Management_ReceiveFSM_SM.Receiving_Ready_NotControlled_NotAvailable_Shutdown.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(, InternalEvent ie)");
                    #endif

                    context.State.Exit(context);
                    context.ClearState();

                    try
                    {
                        ctxt.initializeAction();
                        ctxt.processNotifications("Receiving_Ready_NotControlled_NotAvailable_Init", ie);
                    }
                    finally
                    {
                        context.State = Management_ReceiveFSM_SM.Receiving_Ready_NotControlled_NotAvailable_Init;
                        context.State.Entry(context);
                    }

                    return;
                }
Example #22
0
 public virtual bool defaultTransitions(InternalEvent ie)
 {
     return(false);
 }
Example #23
0
 public virtual bool processTransitions(InternalEvent ie)
 {
     return(false);
 }
Example #24
0
 // Classes to be overridden.
 public virtual void processInternalEvent(InternalEvent ie)
 {
 }
Example #25
0
        //    This is the function that will process an event either generated
        //  by the service, sent to it by another service on the same component,
        //  or as a message sent by a different component.
        public override bool processTransitions(InternalEvent ie)
        {
            bool done = false;

               // Since this function can be called from multiple threads,
               // we use a mutex to ensure only one state transition is
               // active at a time.
               mutex.WaitOne();

            // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryEvents().getID())
                    {
                        QueryEvents msg = new QueryEvents();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pEvents_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryEventTimeout().getID())
                    {
                        QueryEventTimeout msg = new QueryEventTimeout();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pEvents_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CreateEvent().getID())
                    {
                        CreateEvent msg = new CreateEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pEvents_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CreateEvent().getID())
                    {
                        CreateEvent msg = new CreateEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pEvents_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CreateEvent().getID())
                    {
                        CreateEvent msg = new CreateEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pEvents_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new UpdateEvent().getID())
                    {
                        UpdateEvent msg = new UpdateEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pEvents_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new UpdateEvent().getID())
                    {
                        UpdateEvent msg = new UpdateEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pEvents_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CancelEvent().getID())
                    {
                        CancelEvent msg = new CancelEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pEvents_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CancelEvent().getID())
                    {
                        CancelEvent msg = new CancelEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pEvents_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("EventOccurred") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    EventOccurred casted_ie = (EventOccurred) ie;
                        pEvents_ReceiveFSM.context.EventOccurredTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("EventError") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    EventError casted_ie = (EventError) ie;
                        pEvents_ReceiveFSM.context.EventErrorTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Timeout") == 0 && (ie.getSource().CompareTo("Events_ReceiveFSM") != 0) && (!done))
                {
                    Timeout casted_ie = (Timeout) ie;
                        pEvents_ReceiveFSM.context.TimeoutTransition();
                        done = true;
                }
            } catch (Exception e) {}

            mutex.ReleaseMutex();
            return done;
        }
 protected internal virtual void InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_ReadyTransition(AdditionClientServiceDef_additionClientFSMContext context, InternalEvent ie)
 {
     Default(context);
 }
Example #27
0
 /// <summary>
 /// Adds the given event to the Queue.
 /// </summary>
 /// <param name="ie">The event waiting to be called.</param>
 public void invoke(InternalEvent ie)
 {
     lock (Lock) {
         internalEventQueue.Enqueue(ie);
     }
 }
Example #28
0
        //    This is the function that will check for default transitions if
        //  no other transitions were satisfied.
        //
        public override bool defaultTransitions(InternalEvent ie)
        {
            bool done = false;

               // Since this function can be called from multiple threads,
               // we use a mutex to ensure only one state transition is
               // active at a time.
               mutex.WaitOne();

            // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Resume().getID())
                    {
                        Resume msg = new Resume();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ResumeTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Reset().getID())
                    {
                        Reset msg = new Reset();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ResetTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new SetEmergency().getID())
                    {
                        SetEmergency msg = new SetEmergency();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.SetEmergencyTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ClearEmergency().getID())
                    {
                        ClearEmergency msg = new ClearEmergency();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ClearEmergencyTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryStatus().getID())
                    {
                        QueryStatus msg = new QueryStatus();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.QueryStatusTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Shutdown().getID())
                    {
                        Shutdown msg = new Shutdown();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ShutdownTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Standby().getID())
                    {
                        Standby msg = new Standby();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.StandbyTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new RequestControl().getID())
                    {
                        RequestControl msg = new RequestControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.RequestControlTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ReleaseControl().getID())
                    {
                        ReleaseControl msg = new ReleaseControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ReleaseControlTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryControl().getID())
                    {
                        QueryControl msg = new QueryControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.QueryControlTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryAuthority().getID())
                    {
                        QueryAuthority msg = new QueryAuthority();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.QueryAuthorityTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new SetAuthority().getID())
                    {
                        SetAuthority msg = new SetAuthority();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.SetAuthorityTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryTimeout().getID())
                    {
                        QueryTimeout msg = new QueryTimeout();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.QueryTimeoutTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CreateEvent().getID())
                    {
                        CreateEvent msg = new CreateEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.CreateEventTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CreateCommandEvent().getID())
                    {
                        CreateCommandEvent msg = new CreateCommandEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.CreateCommandEventTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new UpdateEvent().getID())
                    {
                        UpdateEvent msg = new UpdateEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.UpdateEventTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CancelEvent().getID())
                    {
                        CancelEvent msg = new CancelEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.CancelEventTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryEvents().getID())
                    {
                        QueryEvents msg = new QueryEvents();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.QueryEventsTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryEventTimeout().getID())
                    {
                        QueryEventTimeout msg = new QueryEventTimeout();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.QueryEventTimeoutTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Initialized") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Initialized casted_ie = (Initialized) ie;
                        pManagement_ReceiveFSM.context.InitializedTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Failure casted_ie = (Failure) ie;
                        pManagement_ReceiveFSM.context.FailureTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Timeout") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Timeout casted_ie = (Timeout) ie;
                        pManagement_ReceiveFSM.context.TimeoutTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("EventOccurred") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    EventOccurred casted_ie = (EventOccurred) ie;
                        pManagement_ReceiveFSM.context.EventOccurredTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("EventError") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    EventError casted_ie = (EventError) ie;
                        pManagement_ReceiveFSM.context.EventErrorTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("CommandCompleted") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    CommandCompleted casted_ie = (CommandCompleted) ie;
                        pManagement_ReceiveFSM.context.CommandCompletedTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("CommandExpired") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    CommandExpired casted_ie = (CommandExpired) ie;
                        pManagement_ReceiveFSM.context.CommandExpiredTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Send") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Send casted_ie = (Send) ie;
                        pManagement_ReceiveFSM.context.SendTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("BroadcastLocal") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    BroadcastLocal casted_ie = (BroadcastLocal) ie;
                        pManagement_ReceiveFSM.context.BroadcastLocalTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("BroadcastGlobal") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    BroadcastGlobal casted_ie = (BroadcastGlobal) ie;
                        pManagement_ReceiveFSM.context.BroadcastGlobalTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Resume().getID())
                    {
                        Resume msg = new Resume();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.ResumeTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Reset().getID())
                    {
                        Reset msg = new Reset();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.ResetTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new SetEmergency().getID())
                    {
                        SetEmergency msg = new SetEmergency();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.SetEmergencyTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ClearEmergency().getID())
                    {
                        ClearEmergency msg = new ClearEmergency();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.ClearEmergencyTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryStatus().getID())
                    {
                        QueryStatus msg = new QueryStatus();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.QueryStatusTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Shutdown().getID())
                    {
                        Shutdown msg = new Shutdown();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.ShutdownTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Standby().getID())
                    {
                        Standby msg = new Standby();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.StandbyTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new RequestControl().getID())
                    {
                        RequestControl msg = new RequestControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.RequestControlTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ReleaseControl().getID())
                    {
                        ReleaseControl msg = new ReleaseControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.ReleaseControlTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryControl().getID())
                    {
                        QueryControl msg = new QueryControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.QueryControlTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryAuthority().getID())
                    {
                        QueryAuthority msg = new QueryAuthority();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.QueryAuthorityTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new SetAuthority().getID())
                    {
                        SetAuthority msg = new SetAuthority();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.SetAuthorityTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryTimeout().getID())
                    {
                        QueryTimeout msg = new QueryTimeout();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.QueryTimeoutTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CreateEvent().getID())
                    {
                        CreateEvent msg = new CreateEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.CreateEventTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CreateCommandEvent().getID())
                    {
                        CreateCommandEvent msg = new CreateCommandEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.CreateCommandEventTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new UpdateEvent().getID())
                    {
                        UpdateEvent msg = new UpdateEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.UpdateEventTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new CancelEvent().getID())
                    {
                        CancelEvent msg = new CancelEvent();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.CancelEventTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryEvents().getID())
                    {
                        QueryEvents msg = new QueryEvents();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.QueryEventsTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryEventTimeout().getID())
                    {
                        QueryEventTimeout msg = new QueryEventTimeout();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_SendFSM.context.QueryEventTimeoutTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Initialized") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Initialized casted_ie = (Initialized) ie;
                        pManagement_SendFSM.context.InitializedTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Failure") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Failure casted_ie = (Failure) ie;
                        pManagement_SendFSM.context.FailureTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Timeout") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Timeout casted_ie = (Timeout) ie;
                        pManagement_SendFSM.context.TimeoutTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("EventOccurred") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    EventOccurred casted_ie = (EventOccurred) ie;
                        pManagement_SendFSM.context.EventOccurredTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("EventError") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    EventError casted_ie = (EventError) ie;
                        pManagement_SendFSM.context.EventErrorTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("CommandCompleted") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    CommandCompleted casted_ie = (CommandCompleted) ie;
                        pManagement_SendFSM.context.CommandCompletedTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("CommandExpired") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    CommandExpired casted_ie = (CommandExpired) ie;
                        pManagement_SendFSM.context.CommandExpiredTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Send") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    Send casted_ie = (Send) ie;
                        pManagement_SendFSM.context.SendTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("BroadcastLocal") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    BroadcastLocal casted_ie = (BroadcastLocal) ie;
                        pManagement_SendFSM.context.BroadcastLocalTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("BroadcastGlobal") == 0 && (ie.getSource().CompareTo("Management_SendFSM") != 0) && (!done))
                {
                    BroadcastGlobal casted_ie = (BroadcastGlobal) ie;
                        pManagement_SendFSM.context.BroadcastGlobalTransition();
                        done = true;
                }
            } catch (Exception e) {}

            mutex.ReleaseMutex();
            return done;
        }
                protected internal override void InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_InitTransition(AdditionClientServiceDef_additionClientFSMContext context, InternalEvent ie)
                {
                    AdditionClientServiceDef_additionClientFSM ctxt = context.Owner;

                    #if TRACE
                    Trace.WriteLine(
                        "TRANSITION   : AdditionClientServiceDef_additionClientFSM_SM.Ready.InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_InitTransition(, InternalEvent ie)");
                    #endif

                    context.State.Exit(context);
                    context.ClearState();

                    try
                    {
                        ctxt.serviceStartedAction();
                        ctxt.processNotifications("Init", ie);
                    }
                    finally
                    {
                        context.State = AdditionClientServiceDef_additionClientFSM_SM.Init;
                        context.State.Entry(context);
                    }

                    return;
                }
Example #30
0
        //    This is the function that will process an event either generated
        //  by the service, sent to it by another service on the same component,
        //  or as a message sent by a different component.
        public override bool processTransitions(InternalEvent ie)
        {
            bool done = false;

               // Since this function can be called from multiple threads,
               // we use a mutex to ensure only one state transition is
               // active at a time.
               mutex.WaitOne();

            // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
            }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
            {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
              	}
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
            }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
            }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
            {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryStatus().getID())
                    {
                        QueryStatus msg = new QueryStatus();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new SetEmergency().getID())
                    {
                        SetEmergency msg = new SetEmergency();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Failure casted_ie = (Failure) ie;
                        pManagement_ReceiveFSM.context.FailureTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Initialized") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Initialized casted_ie = (Initialized) ie;
                        pManagement_ReceiveFSM.context.InitializedTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ClearEmergency().getID())
                    {
                        ClearEmergency msg = new ClearEmergency();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new SetAuthority().getID())
                    {
                        SetAuthority msg = new SetAuthority();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Timeout") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Timeout casted_ie = (Timeout) ie;
                        pManagement_ReceiveFSM.context.TimeoutTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Failure casted_ie = (Failure) ie;
                        pManagement_ReceiveFSM.context.FailureTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Shutdown().getID())
                    {
                        Shutdown msg = new Shutdown();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Reset().getID())
                    {
                        Reset msg = new Reset();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new RequestControl().getID())
                    {
                        RequestControl msg = new RequestControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryStatus().getID())
                    {
                        QueryStatus msg = new QueryStatus();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new SetEmergency().getID())
                    {
                        SetEmergency msg = new SetEmergency();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Failure casted_ie = (Failure) ie;
                        pManagement_ReceiveFSM.context.FailureTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Resume().getID())
                    {
                        Resume msg = new Resume();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Standby().getID())
                    {
                        Standby msg = new Standby();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryStatus().getID())
                    {
                        QueryStatus msg = new QueryStatus();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new SetEmergency().getID())
                    {
                        SetEmergency msg = new SetEmergency();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Failure casted_ie = (Failure) ie;
                        pManagement_ReceiveFSM.context.FailureTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Reset().getID())
                    {
                        Reset msg = new Reset();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Shutdown().getID())
                    {
                        Shutdown msg = new Shutdown();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ClearEmergency().getID())
                    {
                        ClearEmergency msg = new ClearEmergency();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new RequestControl().getID())
                    {
                        RequestControl msg = new RequestControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ReleaseControl().getID())
                    {
                        ReleaseControl msg = new ReleaseControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new SetAuthority().getID())
                    {
                        SetAuthority msg = new SetAuthority();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Timeout") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Timeout casted_ie = (Timeout) ie;
                        pManagement_ReceiveFSM.context.TimeoutTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Failure casted_ie = (Failure) ie;
                        pManagement_ReceiveFSM.context.FailureTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Shutdown().getID())
                    {
                        Shutdown msg = new Shutdown();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Reset().getID())
                    {
                        Reset msg = new Reset();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available_StandbyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_AvailableTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Init") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_InitTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_FailureTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Shutdown") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_ShutdownTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_Emergency") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable_EmergencyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailable") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_NotControlledTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Standby") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_StandbyTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_Available") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled_AvailableTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
                    {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_Controlled") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready_ControlledTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving_Ready") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(ie);
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_Management_ReceiveFSM_Receiving") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                        pManagement_ReceiveFSM.context.InternalStateChange_To_Management_ReceiveFSM_ReceivingTransition(ie);
                        done = true;
                    }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryStatus().getID())
                    {
                        QueryStatus msg = new QueryStatus();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new SetEmergency().getID())
                    {
                        SetEmergency msg = new SetEmergency();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Failure") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Failure casted_ie = (Failure) ie;
                        pManagement_ReceiveFSM.context.FailureTransition();
                        done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Reset().getID())
                    {
                        Reset msg = new Reset();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("Management_ReceiveFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new Shutdown().getID())
                    {
                        Shutdown msg = new Shutdown();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pManagement_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            mutex.ReleaseMutex();
            return done;
        }
 public void InternalStateChange_To_AccessControl_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(InternalEvent ie)
 {
     transition_ = "InternalStateChange_To_AccessControl_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition";
     State.InternalStateChange_To_AccessControl_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(this, ie);
     transition_ = "";
     return;
 }
 public void InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(InternalEvent ie)
 {
     transition_ = "InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition";
     State.InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(this, ie);
     transition_ = "";
     return;
 }
 protected internal virtual void InternalStateChange_To_AccessControl_ReceiveFSM_Receiving_Ready_NotControlled_NotAvailableTransition(AccessControl_ReceiveFSMContext context, InternalEvent ie)
 {
     Default(context);
 }
        //    This is the function that will check for default transitions if
        //  no other transitions were satisfied.
        //
        public override bool defaultTransitions(InternalEvent ie)
        {
            bool done = false;

               // Since this function can be called from multiple threads,
               // we use a mutex to ensure only one state transition is
               // active at a time.
               mutex.WaitOne();

            // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("ManagementOCU_ManagementOcuFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ReportStatus().getID())
                    {
                        ReportStatus msg = new ReportStatus();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagementOCU_ManagementOcuFSM.context.ReportStatusTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("ManagementOCU_ManagementOcuFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ConfirmControl().getID())
                    {
                        ConfirmControl msg = new ConfirmControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagementOCU_ManagementOcuFSM.context.ConfirmControlTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("ManagementOCU_ManagementOcuFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ReportControl().getID())
                    {
                        ReportControl msg = new ReportControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagementOCU_ManagementOcuFSM.context.ReportControlTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("ManagementOCU_ManagementOcuFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new RejectControl().getID())
                    {
                        RejectControl msg = new RejectControl();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pManagementOCU_ManagementOcuFSM.context.RejectControlTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("MenuItemEntered") == 0 && (ie.getSource().CompareTo("ManagementOCU_ManagementOcuFSM") != 0) && (!done))
                {
                    MenuItemEntered casted_ie = (MenuItemEntered) ie;
                        pManagementOCU_ManagementOcuFSM.context.MenuItemEnteredTransition();
                        done = true;
                }
            } catch (Exception e) {}

            mutex.ReleaseMutex();
            return done;
        }
 /// <summary>
 /// Adds the given event to the Queue.
 /// </summary>
 /// <param name="ie">The event waiting to be called.</param>
 public void invoke(InternalEvent ie)
 {
     lock (Lock) {
         internalEventQueue.Enqueue (ie);
     }
 }
 protected internal virtual void InternalStateChange_To_Management_ReceiveFSM_Receiving_ReadyTransition(Management_ReceiveFSMContext context, InternalEvent ie)
 {
     Default(context);
 }
Example #37
0
 public virtual bool processTransitions(InternalEvent ie)
 {
     return false;
 }
 public void InternalStateChange_To_AdditionServerServiceDef_additionServerFSM_ReadyTransition(InternalEvent ie)
 {
     transition_ = "InternalStateChange_To_AdditionServerServiceDef_additionServerFSM_ReadyTransition";
     State.InternalStateChange_To_AdditionServerServiceDef_additionServerFSM_ReadyTransition(this, ie);
     transition_ = "";
     return;
 }