Customization > SySim- SysML model execution > Working with a SySim model execution > Concepts and Reference > SysML state machine event handling (SySim)
  
SysML state machine event handling (SySim)
Your SysML model may model state machine event handling in different ways:
If you have used a method for modeling state machine event handling that is supported by SySim, SySim should be able to interact with that event handling.
If you have used a method for modeling state machine event handling that is not supported by SySim, to work with SySim you will have to change your SysML model to use a supported method of state machine event handling.
SySim can work with the following methods for modeling state machine event handling in a SysML model:
Polling a value through an Event Action Block that detects a change to an input port value.
In this scenario, the Trigger Type of the Event Action Block is Change and through its Change Expression and Guard Condition properties it detects a change to an input port and creates a trigger in the state machine. When a change in value is detected, SySim calls RunToCompletion so that the state machine can process it.
In the Traffic Lights - SySim model, the Running sequential state (SySim Custom Controls::Controller.Controller::Running) has an example of an Event Action Block whose Trigger Type is Change, the change expression detects True on an input port named InputFromButton and sets the ped_wait variable to True.
Use of Events.
In this scenario, any action can send an Event to any port. The Event is forwarded to any attached port which determines the Operation to call (if any) to handle it. An Event can be sent in the following ways:
Through an Action in a state machine.
Through an Operation Body.
Through a detected change. A Tag Definition on a port can define a condition that triggers a defined Event (in the Tag Definition) to be generated.
Use of required/provided Interfaces for UML standard ports.
In this scenario, a UML port uses an Interface that owns an Operation that is implemented by a Block. This Operation is used as a trigger in the state machine through an Event Action Block whose Trigger Type is Call.
SySim cannot work with the following methods for modeling state machine event handling in a SysML model:
Use of Event Item Flows.
In this scenario, a SysML Event Item Flow (a message on a Connector or Binding Connector) sets the IO Item on an Item Flow to an Event whose parameter is typed to match the ports that are connected by the link.
Concepts and Reference