DrSensor / scdlang

(status: soon revived as different project) Statechart Description Language (just an experiment, need to be rewritten)
Universal Permissive License v1.0
101 stars 2 forks source link

Generate state transition table #24

Open DrSensor opened 5 years ago

DrSensor commented 5 years ago

Generate two-dimensional transition table as:

and render it using

How it looks like 👇

Current State Event1 Event2 [guard] Event2 —
initial — — — State1 / entry, activity
State1 / activity, exit State2 / entry, action, activity State1 / entry, activity finish —
State2 / activity — — — finish / action

The table above is called Two-dimensional state tables with some modification to suits Statecharts format.

Resources
brucou commented 5 years ago

I was a bit confused by your transition table. A transition table should have a shot of before and after. So I put before(control state, extnded state, input) and after (control state, extended state, output). But you seem to put two events? I guess there may be another column for the guard? But two events in the same row I don't understand the semantics of it if any.

Let's discuss it in #24

So... I checked the book Constructing the User Interface with Statecharts by Ian Horrocks, and indeed he puts all the events in columns. But then you better have lots of horizontal space...

So, he has this table:

Imgur

or this one:

Imgur

where he makes use of numbers to avoid writing the labels of the control states.

And lastly he has this, where events are on a row:

Imgur

But yeah now that I have checked the wikipedia link, I understand your table better. There should be a way of formatting this properly. There are rarely more than three events on an origin state going to the same target state, so on a long screen it might still be possible to display everything on a row?