Generate From Behavioral Models

code_from_behave

Enterprise Architect's system engineering capability supports code generation from the following UML behavioral diagrams:

Topic

Link

State Machine diagrams(SW & HW).

 

State Machine diagrams

Interaction (Sequence) diagrams (SW).

 

Interaction (Sequence) diagrams

Activity diagrams (SW).

 

Activity diagrams

You can generate code in various software (SW) and hardware (HW) languages, including C(OO), C++, C#, Java, VB.Net, VHDL, Verilog and SystemC.

How to

To experiment with code generation from these diagrams, using the EAExample project provided with your Enterprise Architect installer

Step

Action

See also

1

Open the EAExample.eap file by selecting the Help | Open Example Model menu option.

 

 

2

From the Project Browser, select any of the following packages:
 
Software Language Examples:

Project Models > System Model > Implementation Model (PSM) > Java Model With Behaviors    Generate the Account and Order classes
Project Models > Systems Engineering Model > Implementation Model > Software > C#    Generate the DataProcessor Class
Project Models > Systems Engineering Model > Implementation Model > Software > C++    Generate the IO Class
Project Models > Systems Engineering Model > Implementation Model > Software > Java    Generate the IO Class
Project Models > Systems Engineering Model > Implementation Model > Software > VBNet  Generate the IO Class

 

Hardware Language Examples:

Project Models > Systems Engineering Model > Implementation Model > Hardware > SystemC     Generate the PlayBack Class
Project Models > Systems Engineering Model > Implementation Model > Hardware > VHDL     Generate the PlayBack Class
Project Models > Systems Engineering Model > Implementation Model > Hardware > Verilog     Generate the PlayBack Class

 

 

3

When completed, press ( Ctrl+E ) to open the generated source code.

You should see methods generated in the code.

 

 

Notes

Software code generation from behavioral models is available in the Business and Software Engineering, Systems Engineering and Ultimate editions of Enterprise Architect
Hardware code generation from State Machine models is available in the Systems Engineering and Ultimate editions of Enterprise Architect
For C(OO), please ensure that, on the C Specifications page of the Options dialog, you have set the Object Oriented Support option to True
To be able to generate code from behavioral models, all behavioral constructs should be contained within a Class
Code synchronization is not supported for behavioral code

Learn more

 

Learning Center topics

(Alt+F1) | Software Engineering | Behavioral Code Generation