umlactivity-diagrammodel-driven-development

UML Activity Diagram: Create Link Object Action Example


I am looking for a toy example of the usage of a "create link object action" with at least one other link action in a UML activity diagram. I can find definitions of what this action does but no examples - so I only have a guess as to what it does.

For instance, "Executable UML: A Foundation for Model-Driven Architecture" suggests a "create link" action does the following "relate A to B across association." I imagine this example creates a look up table?


Solution

  • A link is the instance of an association, and a link object is the instance of an association class:

    16.7.6: Link object Actions operate on link objects, which are instances of AssociationClasses.

    We are far from system design, where the organisation of activities is specified in broad terms and the details are implemented in a programming language. Here we are in low-level actions that are meant for visual programming.

    Looking at the definition of this action in the UML 2.5.1 specs:

    A CreateLinkObjectAction is a specialized CreateLinkAction for creating a link object (an instance of an AssocationClass). A CreateLinkObjectAction has the same semantics for link creation as a CreateLinkAction, except that its endData must be for an AssociationClass and the new link is a link object that is placed on the result OutputPin. If a link object matching the given endData already exists, and all the Association ends are unique, then this is placed on the result OutputPin, and no new link object is created.

    So in your toy example, you'd need to refer to a class diagram with an association class, for example:

    A class Purchase Order associated with class product, the association class being line item

    In this case, your toy example would have a CreateLinkObjectAction called add product to order with two input pins: one for the PurchaseOrder, one for a selected Product, and an output pin for the newly created line. The output pin might feed another action such as determine quantity. As a source of inspiration, but to fine tune and complete, it could look like:

    Diagram corresponding to the description above