An activity diagram places an inner decision on the branch that contains it. In an airline reservation, a seat-type check might occur only if a passenger already has a booking. The diagram must show that a passenger without a booking never reaches the seat check.
if (hasBooking)
{
if (hasWindowSeat)
{
status = "Window seat confirmed";
}
else
{
status = "Other seat confirmed";
}
}
else
{
status = "No booking";
}The outer condition chooses between a booked and unbooked passenger. Only the booked route splits again to choose a window or other seat. All three outcomes lead to a shared status display.
The inner Yes and No paths merge inside the outer Yes path. That result joins the outer No path before Display status. Follow the arrows from the initial node for three cases: no booking, booked with a window seat, and booked without one.
If the window-seat decision sits below the final merge, the unbooked passenger would encounter it. Check the location of the second decision and the shared display action before calling the diagram complete.
Place the status-setting actions on their own branches, then use a merge for alternative flows. A merge does not mean that both actions have run; only the action on the selected path ran. The final display occurs once regardless of which status was chosen. That distinction helps prevent an activity diagram from implying two simultaneous outcomes.