Welcome to
www.SmartStateStudio.com

XMI2SM
State Machine Code From XML Metadata Interchange (XMI)
 


About XMI2SM

ApeSoft xmi2sm is state machine code generation software from UML state diagrams defined in XML metadata interchange (XMI) format. xmi2sm can accept state diagram defined in any standard UML tool like (Rational Rose, Poseidon etc) which supports XMI format.

Xmi2sm is more than just generating the equivalent classes for each ‘state’ in the diagram. It is shipped with a robust state machine library for handling the state transitions and messaging. The state machine library used is exactly same as the industry accepted SmartState library (from ApeSoft) which is widely in use in various domains.

Xmi2sm generates 100% compile-able code in following languages

  • Java
  • C++
  • ANSI C
  • C# (.Net)
Thus the software design and the code always stay synchronized and any design changes will not have any development cost associated.

Feature & Functionality

Xmi2sm supports the following features (in XMI)

  • Multiple transitions to and from a state.
  • Transitions with a guard condition.
  • Multiple transitions with same message but different guard conditions from a state.
  • Super States and Sub States.
  • Concurrent state machines.
  • State with History information.

Xmi2sm does not support the following UML elements in state chart (in XMI)

  • Fork (can be achieved by orthogonal state)
  • Join
  • Choice (Can be achieved by having multiple transitions having different guard conditions)
  • Junction
  • Terminate (Final State is supported)
  • Entry Point
  • Exit Point
  • doActivity in states (onEntry and onExit is supported)

The Architecture


The generated classes are concrete classes which specializes the smart framework library classes. The framework uses the concept of messaging for transitions. When the state handler object is initialized it initializes all the initial states. Based upon receiving the messages from the context, usually, it applies this message to each active state and concurrent states. Depends on the message and its parameters (wParam & lParam are used), it carries out the necessary actions as specified by the user in the effect block. Then it delegate the work of state transition to the framework if needed. Additional data for the guard conditions can be passed through the wParam and lParam arguments. They can hold the address of an object or a primitive data type.

The state classes are lightweight, se it doesn't hold any specific data related to the context. Also all the states possible for the context as defined in the model are created initially and kept. This improves the performance at run time. Se the objects are lightweight it will not be a problem in resource consumption.

It is possible to send internal messages within the state classes which enables a state change depends on some conditions which context need not be aware of.

The generated classes are of-course not thread safe, because it doesn't make much sense to do that. But in multi threaded environment where the messages are pumped from various threads, it is possible to make use of a Queue manager class which is supplied along with the library to keep the messages in the thread safe queue and apply one after the other to the state handler. User may write their own logic for solving this situation if the supplied Queue manager is not sufficient.


XMI Supported UML Tools

One can use any UML tool of choice to design state charts. Please make sure the XMI file format export is supported by the software. Xmi2sm expects the state chart in XMI format. Please refer www.omg.org/technology/documents/formal/xmi.htm for more information about XMI.

Some of the leading UML tools which supports XMI are


Additional information
Please install trial version of XMI2SM and read the User Guide packaged to know more about XMI2SM. You may find additional information in the following link:

About State pattern (Context, State, Transition)

If you are looking for a complete solution with state chart designer tool please see our flagship product SmartState.