0
votes

MAKE RESERVATIONS is the activity and it states the following:

A customer contacts a reservation officer about a car rental.

The customer quotes the start and end dates needed, the preferred vehicle, and the pickup office.

The reservation officer looks up a prices file and quotes a price. The customer agrees to the price.

The vehicle availability is checked to see if an appropriate vehicle is available for the required time at the required office.

If the requested vehicle is available at the nominated pickup office, then it is reserved for the customer. An entry is made in the vehicle availability registering the reservation.

The reservation officer issues a rental number to the customer. A rental agreement is then created in a rental file, including the rental number, the rental period, the vehicle type and the pickup office.

Exceptions

  1. An appropriate vehicle is not available at the pickup office. The customer is offered an alternative vehicle.
  2. The customer does not agree to a price and asks for an alternate vehicle and/or period.

I designed the activity diagram for the activity above yet I don't know whether I have to put the question in the decision node or above on the control flow? In my case, the Agree to Price should it be on the decision node or on the control flow arrow that inputs the node?

As well as that, if a use case only specifies a condition, such as " If a vehicle is available, the customer is offered the vehicle and a price is quoted. If the customer accepts then a rental is initiated." how does the decision node look like?

Moreover, what if there are three different actors, should there be a swimlane representing the actors or can the activity diagram be drawn without one?

The activity diagram for the use case above is posted below

Make Reservations

1

1 Answers

1
votes

I don't know whether I have to put the question in the decision node or above on the control flow?

They are written in the flow, as you did. In UML the decision node is empty (this is a difference from basic flowcharts, where one would write the condition within the node). Each flow coming from a decision node may be annotated with a guard (i.e. condition). When the decision node is executed, any flow whose guard evaluates as true may be selected for execution (Usually, the conditions of the guards are exclusive, and only one guard may be selected, but that is not a requirement).

As well as that, if a use case only specifies a condition, such as " If a vehicle is available, the customer is offered the vehicle and a price is quoted. If the customer accepts then a rental is initiated." how does the decision node look like?

It looks as in your figure, but there should be an action node for asking the client before the decision node, because the only purpose of the decision node is choosing among several possible flows. No actions are executed as part of the execution of the decision node.

Decision node, with an action node before

Moreover, what if there are three different actors, should there be a swimlane representing the actors or can the activity diagram be drawn without one?

It depends on what you are modelling, if you have different actions performed by different parts of your system, you may use swimlanes (I recently drawn an example here), but you may avoid swimlines if it is not interesting to model that separation. Normally, the actors would provide input to the system, but they will not be executing actions by themselves.

For instance, your example model the behavior of the reservation officer (which is part of your system) based on input from the customer (the initial quote and agreement) and the customer receives output (the rental number). I recommend that you ask that as a separate question emphasizing on the third actor.