Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Code Generation from Decision Models
It is possible to generate the method code of a Class from an Activity element, based on the logic defined in its Decision Table, by placing the Activity as a child of the Class element from which the code is generated.
Set up Class and generate code
Step |
Action |
See also |
---|---|---|
1 |
Create an Activity with a Decision Table. |
Decision Table Editor |
2 |
Make the Activity element a child of a Class element. |
Drop from Project Browser |
3 |
Select the Class and press to open the 'Generate Code' dialog, and generate the code. |
Generate a Single Class |
4 |
Press to view the generated source code. |
Decision Table code templates
Code Generation from a Decision Table automatically applies these EASL code generation templates:
- Behavior Body
- Decision Table
- Decision Logic
- Decision Condition
- Decision Action
Notes
- Currently C++ is the only language implemented in the EASL templates for Decision Table code generation
- You can use ActivityParameters to define method parameters
- You can add Attributes to the Activity element to define local variables
- The Decision Tables facility is available in the Business and Software Engineering and the Ultimate editions of Enterprise Architect
Learn more
- EASL Code Generation Macros (Behavioral Templates)
- Activity Parameter Nodes
Learning Center topics
- Alt+F1 | Enterprise Architect | Modeling Basics | Decision Tables | Decision Code Generation