You can use an Interaction element to insert an Interaction diagram as a child of a Class element. The Interaction element can contain a diagram of any of these types:
An Interaction element in Enterprise Architect is treated as a behavior of the classifier it is encapsulated within. It can have parameters and return types, which are modeled using the 'Behavior' tab of the Interaction element's 'Properties' dialog. The element is interpreted as a method of the containing Class in the generated code (see the Generate Code From Behavioral Model topic).
An Interaction element can also be set as the classifier for an Interaction Occurrence in a Sequence diagram, or for a Call Behavior Action in an Activity diagram. Establishing such an association (between a behavior and a behavior call) facilitates adding arguments that can be individually mapped to the associated behavior's parameters.
- The behavioral code generation engine expects the Sequence diagram and all its associated Messages and Combined Fragments to be encapsulated within an Interaction element (such as setupUSB in this example)
(The IO Class is available in the EAExample model, under 'Systems Engineering Model | Implementation Model | Software')
- The 'Interaction' icon is listed on the 'Additional' page of the 'Interaction' Toolbox, but should only be added to elements through the element context menu on the diagram or in the Browser window