Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Behavioral Models

Banner

Enterprise Architect’s powerful system engineering capability can be used to generate code for software, system and hardware description languages directly from behavioral models, such as StateMachine, Sequence (Interaction) and Activity diagrams. The supported languages include C(OO), C++, C#, Java, VB.Net, VHDL, Verilog and SystemC.

Software code can be generated from StateMachine, Sequence and Activity diagrams, and hardware description languages from StateMachine diagrams (using the Legacy State Machine templates).

Generate code from behavioral diagrams using the EAExample project

Step

Action

See also

1

Open the EAExample.eap file by selecting the 'Start > Help > Help > Open the Example Model' ribbon option.

2

From the Browser window, select any of these Packages:

Software Language Examples:

  • Example Model > Software Engineering > Java Model With Behaviors

Generate the Account and Order classes

  • Example Model > Systems Engineering > Implementation Model > Software > C#

Generate the DataProcessor Class

  • Example Model > Systems Engineering > SysML Example > Implementation Model > Software > C++

Generate the IO Class

  • Example Model > Systems Engineering > SysML Example > Implementation Model > Software > Java

Generate the IO Class

  • Example Model > Systems Engineering > SysML Example > Implementation Model > Software > VBNet

Generate the IO Class

Hardware Language Examples:

  • Example Model > Systems Engineering > SysML Example: Portable  Audio Player > Implementation Model > Hardware > SystemC

Generate the PlayBack Class

  • Example Model > Systems Engineering > SysML Example: Portable  Audio Player > Implementation Model > Hardware > VHDL

Generate the PlayBack Class

  • Example Model > Systems Engineering > SysML Example: Portable  Audio Player > 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 Unified and Ultimate editions of Enterprise Architect
  • Hardware code generation from StateMachine models is available in the Unified and Ultimate editions of Enterprise Architect
  • For C(OO), on the 'C Specifications' page of the 'Preferences' dialog 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; if the behavioral constructs refer to external elements outside the current Package, you must add an Import connector from the current Package to the Package containing the external elements
  • Code synchronization is not supported for behavioral code

Learn more