itemisCREATE / statecharts

YAKINDU Statechart Tools (http://www.statecharts.org)
Eclipse Public License 1.0
174 stars 84 forks source link

Add event buffers for cycle based statecharts #3113

Closed terfloth closed 4 years ago

terfloth commented 4 years ago

Cycle-based statechart execution can not handle events raised on the statechart during execution of a RTC step (the runCycle method). This is a major problem within multi state machine models. Here the concrete order of RTC-execuion of the involved state-machines becomes relevant. The resulting behavior is not intuitive for the user.

To overcome this problem event buffers are required. These fulfill the same purpose as event queues for event driven execution. The difference is that according to the execution model an event buffer (or vector) is used instead of a queue. The following aspects must be considered:

  1. We distinguish between an internal event buffer and an in event buffer.
  2. Events derived from foreign out events must be handled as in events even though they are part of the internal scope

This pattern also helps to overcome the limitations of downstream visibility of internal events.