UML Use Case Diagram – How to Show ‘Or Includes’ Relationship

umluse-case

I haven't come across this issue before and can't find it in my Schaum's Outline UML book and was wondering if someone here could help.

I'm making a use case diagram for e-commerce, and in it I want to describe that in order to add a book to your shopping basket, you have to either search products (using the websites search engine) or browse products (using navigation).

But the thing is that it can be either one, and not both.

Is there a way to show that adding a product to the basket needs to include either this or that? Because otherwise it would look like it needs to include both.

Or should I join the two use cases (search products and browse products) into one?

Best Answer

The most important is that it is clear from the use case description that a choice must be made between the search and the browse functionality.

In your diagram, the 'add to basket' use case should <<include>> both the 'search products' and 'browse products' use cases (assuming that the choice for searching or browsing is made from the 'add to basket' use case). If you really want to show that those included use cases are mutually exclusive, you can add a UML constraint { mutually exclusive } linked to the inclusion arrows, but that is completely optional.