Search code examples
oopumlanalysisuse-case

Use case diagram: Does an included use case have to be triggered by the base use case?


If I have an actor invoked use case such as "Create Absence" and every time the actor creates an absence they will need to "Search For Employee" is it correct to model this using an includes relationship?

This is the thing that is not clear in all explanations of includes, does the included use case have to be triggered automatically by the base or can it be used to show that every time an absence is created the user will always search for an employee.

Alternatively should both of these be modelled as actor invoked and with no includes relationship between them?


Solution

  • The standard is clear, from formal/2017-12-05 § 18.1.3.3 Includes page 641 :

    Include is a DirectedRelationship between two UseCases, indicating that the behavior of the included UseCase (the addition) is inserted into the behavior of the including UseCase (the includingCase).

    All of the behavior of the included UseCase is executed at a single location in the included UseCase before execution of the including UseCase is resumed.

    so :

    • does the included use case have to be triggered automatically by the base : yes, even the way to say is not perfect because the included UC is not triggered but its behavior inserted

    • can it be used to show that every time an absence is created the user will always search for an employee: no, if UC Create Absence includes UC Search For Employee then user will not search after but during.

    • is it correct to model this using an includes relationship?: no then

    • Alternatively should both of these be modelled as actor invoked and with no includes relationship between them? : yes then, note you can have a post condition in UC Create Absence saying the actor will have to Search For Employee