Prev Next

Interaction

A UML Interaction element.

Description

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:

  • Sequence
  • Communication
  • Timing

An Interaction Element containing a Sequence diagram as modeled in Sparx Systems Enterprise Architect.

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.

Notes

  • 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)

    Part of a Project Browser hierarchy showing a UML Class element that owns an Interaction element which defines a UML Sequence diagram.

    (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 Project Browser

Toolbox icon

Interaction element

Learn more