Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatch eventless #77

Merged
merged 4 commits into from
Nov 2, 2018
Merged

Conversation

sstiller
Copy link
Contributor

@sstiller sstiller commented Nov 2, 2018

Add handling for eventless transitions if there is no matching transition for an event

  • c2c5d09 Make the event parameter of dispatch() optional, now an eventless transition can be executed even if there is no useful event. See bad naming for eventless transitions #40 (comment)
  • 29a572c Check eventless transitions even if we have no matching event.
    This is needed if the data model is changed from outside the SM.
    In the standard, this is not really defined:

Note that this specification does not define any way to modify the data model except by, , and possibly platform-specific elements of executable content. In particular, no means is defined for external entities to modify the data model. In this sense the data model is local to the SCXML session and the SCXML Processor checks for eventless transitions (i.e. ones that are triggered based only on the state of the data model) only after entering a state or processing an event. However in some deployments it may be possible for external entities to modify the data model. For example, if SCXML is implemented in JavaScript in a browser, the scope of a document's data model is always accessible through the main window object and thus JavaScript code elsewhere in the window can modify the data model independent of the SCXML interpretation algorithm. Such a situation can lead to race conditions and unpredictable behavior

But if we look at the mainEventLoop in https://www.w3.org/TR/scxml/#AlgorithmforSCXMLInterpretation we can see, that the eventless transitions are executed even if there is no transition for the current event.

@sstiller
Copy link
Contributor Author

sstiller commented Nov 2, 2018

It needs to be integrated into Visual Studio - I don't have VS.
Could someone please do it ;-)

@jp-embedded
Copy link
Owner

nice!

As you mention, this is probably a minor, because you have to modify the model outside the SM to see the issue. But nice fix, because of course the SM should work according to the standard.

Yes, the VS is quite a pain. But now we have cmake, the VC files could maybe be generated using cmake.

I will merge in, and fix VC

@jp-embedded jp-embedded merged commit 9d09a54 into jp-embedded:master Nov 2, 2018
@sstiller sstiller deleted the dispatch-eventless branch November 3, 2018 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants