wiki:landing_pages:ea
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wiki:landing_pages:ea [2016/11/06 11:56] – [Watch the code generator in action] pmueller | wiki:landing_pages:ea [2023/07/20 16:52] (current) – [Enterprise Architect HowTo] webmin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{description> | + | ~~NOTOC~~ |
- | + | ||
====== Generate production quality code from state diagrams created with Enterprise Architect ====== | ====== Generate production quality code from state diagrams created with Enterprise Architect ====== | ||
- | Sinelabore// | + | Sinelabore// |
- | With its new C++, Python and Java backend it is also a perfect tool for developers of server or desktop applications. | + | |
Key Features: | Key Features: | ||
Line 18: | Line 15: | ||
* Optionally generating trace code | * Optionally generating trace code | ||
* Generated code creates no trouble when using static code checkers | * Generated code creates no trouble when using static code checkers | ||
- | |||
==== Watch the code generator in action ==== | ==== Watch the code generator in action ==== | ||
The following example shows how the code generator works by means of a simple microwave oven. | The following example shows how the code generator works by means of a simple microwave oven. | ||
- | {{ : | + | {{ : |
Requirements: | Requirements: | ||
Line 36: | Line 32: | ||
The sate machine below shows a possible solution. | The sate machine below shows a possible solution. | ||
- | {{ : | + | {{ : |
Line 54: | Line 50: | ||
{{: | {{: | ||
- | In the examples folder you will find the complete code ready to be tested and expanded by you. | + | In the examples folder you will find the complete code ready to be tested and expanded by you. |
- | === Supported State Machine Elements === | + | ==== Supported State Machine Elements |
The code-generator supports a subset of the design elements provided by Enterprise Architect. The supported elements are: | The code-generator supports a subset of the design elements provided by Enterprise Architect. The supported elements are: | ||
* Hierarchical states | * Hierarchical states | ||
Line 68: | Line 64: | ||
* Regions on various levels | * Regions on various levels | ||
- | Find out more about the code generator | + | ==== Find out more about the code generator |
* How sinelabore supports [[wiki: | * How sinelabore supports [[wiki: | ||
* How to [[wiki: | * How to [[wiki: | ||
* Read section " | * Read section " | ||
+ | * How easy it is to add attributes and operations to the stateful class like shown below. Operations are mapped to C-functions. Attributes to members of the instance data of the state machine. This allows to add entry/exit code functions or other helper functions. Even the body code can be easily added with EA if you want. Presently attributes and operations are only generated in the C-backend. | ||
+ | {{ : | ||
[[wiki: | [[wiki: | ||
+ | |||
+ | |||
+ | |||
+ | {{description> | ||
+ | |||
+ | |||
+ | ====== Enterprise Architect HowTo ====== | ||
+ | |||
+ | Below some tips and tricks are listed that simplify the state-chart creation using Enterprise Architect. If you have further hints let us know and we add them here. For a short intro on on how to use EA with the codegen go on reading [[wiki: | ||
+ | |||
+ | :?: ** Where to put the events to:** | ||
+ | |||
+ | :!: States should be put “below” the class containing the state diagram. See next figure. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | :?: ** How to define the path to the state machine:** | ||
+ | |||
+ | :!: Since version 9.0 of Enterprise architect it looks like that always a view package is required. This package must appear in the path you specify on the codegen command line. In the figure above the path to the state machine is -t " | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | :?: ** I always get the error message ‘Can' | ||
+ | |||
+ | :!: Most probably you have not selected to root element (e.g. Model in the figure above) before exporting the XMI file. Select the root model element and then export to XMI. | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | :?: ** How to specify multiple lines entry/ | ||
+ | |||
+ | |||
+ | :!: There are some different ways. | ||
+ | |||
+ | The codegen can take the activity name as code. But only one line can be specified then. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | It is also possible to specify multiple lines of action code in the behaviour field. The name of the action is not used anymore as code line if code is found in the behavior field. | ||
+ | |||
+ | The third way is to use the code field. It has syntax highlighting activated which is nice. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | :?: ** Where do I find the " | ||
+ | |||
+ | :!: In recent versions of EA the export to XMI is available under '' |
wiki/landing_pages/ea.txt · Last modified: 2023/07/20 16:52 by webmin