Clone this wiki locally
The following describes the SCXML generator and importer implemented in Umple. For more information about SCXML itself: http://www.w3.org/TR/scxml/
The SCXML Generator uses umple generation templates to generate scxml code from umple source code.
The source code for the generator can be found here:
- nested states
- entry/exit actions
- do activities
- guarded transitions
- transition actions
Could not implement:
- Timed transitions: there is no notion of delay in scxml
- Events with parameters: we need to better understand scxml datamodels and correctly implement the translation of executable content before we can make this work.
- Queued and Pooled state machines: those properties are specific to umple state machines and cannot be translated to scxml
Note: Although we generate actions and do activities, please note that the resulting scxml document does not conform to w3c standards. This is because umple state machines use java to define actions and do activies. However, depending on the datamodel used, scxml documents can only define executable content with ECMAScript languages only. For more information: http://www.w3.org/TR/scxml/#profiles.
The source code for the SCXML Importer can be found in the following files:
In those files, the following classes contain most of the logic for the importer:
- ScxmlImportHandler: the class that other classes representing scxml elements inherit from.
- ImportStateMachine: the class representing the state machine. It is instantiated when the parser encounters a
- ImportStateMachineState: the class representing a state in the state machine. It is instantiated when the parser encounters a
- ImportTransition: the class that represents a transition. It is instantiated when the parser encounters a
- ImportAction: the class that represents an entry or exit action. It is instantiated when the parser encounters an
The following tags are parsed by the importer:
The following are not parsed right now:
- Executable content: http://www.w3.org/TR/scxml/#executable
- Data model content: http://www.w3.org/TR/scxml/#data-module
- External communications: http://www.w3.org/TR/scxml/#external-module
Suggested improvements on the implementation:
- Properly translate the executable content from and to Umple with the proper scxml datamodel and scripting language.
- Implementation of parallel states in Umple (http://www.w3.org/TR/scxml/#parallel)
- Implementation of the history pseudo state in Umple (http://www.w3.org/TR/scxml/#history)
- Find a way to correctly translate
<final>tags from scxml to Umple (http://www.w3.org/TR/scxml/#final)