SCXML and State Machine Code generation support


Does exporting SCXML support the following?

  • Core Constructs eg. onEntry, onExit, etc.
  • Executable Content eg. raise , log, if, etc
  • Data Model and Data Manipulation eg. datamodel, script, content, etc.
  • External Communications eg. send, cancel, invoke, etc.

The guide here also mentions five triggers (On Entry, Do, On Event, On Exit and Include), two of which I couldn’t find. Entry, Do activity, and Exit are there but On Event and Include seem to be missing. The guide also explains them to be Actions, however, the State Specification dialog creates Activities for them instead of Actions. The exported SCXML does not contain tags.

Is this feature not fully implemented yet?


Keep in mind that not all triggers have to be internal, which is the case with Entry, Do and Exit; they reflect on state itself.

But there are also external influences:


‘Press stop’ is actually a trigger here. It is only after that trigger that the state changes from playing (internal ‘do’ activity being reading a disc) to the Stopped state.

I can’t help you with the SCXML part because I never used that before


So I made an export of the small example I shared above, should have thought about that sooner :wink:

<scxml version="1.0" xmlns="">
	<state id="Playing CD">
		<transition event="Stop" target="Stopped" type="external"/>
	<state id="Stopped"/>

My in-experience still stands of course but based on this I’d say that the functionality of SCXML seems limited. It most certainly doesn’t seem to support my Do state.

I think this might be the best way to examine this: set up an example State Machine diagram, export it and then check the XML code. You can easily load that using a program such as Notepad.

Hope this can still be useful!


Yes, that was my conclusion upon checking the exported SCXML, too. I just hoped that something slipped (a setting, a switch, or anything) my attention and these things were supported in VP. Now I have to look for a tool that does support them and recreate the state machine there. I’m kinda :confounded: and :frowning_face:


I looked more into this and quite frankly I don’t think VP is to blame for anything.

For example, look at the Wikipedia page for SCXML, they show an example which is decently comparable to what I did above: their stopwatch is ‘ready’ and transitions into ‘running’.

But notice how the SCXML code doesn’t mention anything about resetDisplay, ensureTimer or any of the embedded routines? So quite frankly I don’t think you’ll fare better with another tool, I’m starting to think that this is all set up by design and therefor works as intended.


I’m not “blaming” it from anything. VP is excellent when designing the state machine. I’m simply stating that when it comes to exporting the state machine to SCXML, VP lacks certain features. A couple of them, to be honest.

The state machine example on Wikipedia is as simple as clogs are (er, no pin intended :slight_smile: ). There are tons of other things that could go into an SCXML and which can be used by an SCXML processor. Check the stuff that’s described/exampled here. These are the things I miss from the exported file.

As for not faring better with another tool, that’s something yet to be seen. I’ve found no candidates for it until now. My colleague is using some QT-based “wonder” that actually does work as expected (it manages and exports the mentioned properties to SCXML). But it has a UI that is best described as “user-hostile” instead of acceptable (and even mentioning user-friendly on the same page would be a blasphemy). After working in VP for years even the graphics of that app is a no-go for me.

I’ve posted this question to see if I was lame for not being able to figure out how to do it or if it was not possible in the first place, no berating was intended. I know that one tool cannot be perfect in every aspect. I’m just a bit sad to see that my favorite one does not excel in this one the way it used to. That’s all.