Chapter 4. Example: The Business Process of Renting Hotel Rooms

We consider a simple business process type of renting hotel rooms adopted from (Pesic et al 2007) for illustrating business process modeling with SysML v2. Renting hotel rooms processes consist of seven types of activities: (1) "book room": enter client name, payment data, etc; (2) “check-in”: record client arrival, provide key card, etc; (3) “bill”: for billing the number of nights, room services, laundry services, etc; (4) “provide room service”: provide a room service for the client; (5) “provide laundry service”: provide a laundry service for the client; (6) “charge”: the client is charged the total price of the stay; and (7) “check-out”: client checks out at the reception.

Following the terminology of SysML2, we say "action" instead of "activity".

This hotel room renting process type is only weakly structured since it does not properly sequence all types of actions. But it has a few (dynamic) constraints:

  1. Every process has to start with a "book room" action followed by a “check-in” action.
  2. Every process must include at least one action of type “bill”, i.e., at least the number of nights will be billed. However, it might be the case that the bill is extended multiple times during a process (due to room services and laundry services provided during the stay).
  3. Every action of type “provide room service” or “provide laundry service” must be billed. However, it is possible that several services are billed at once, instead of billing each service separately.
  4. When the client “checks-out”, the bill must either have been charged already or will be charged at, or after, check-out.

We start by defining the seven action types of this process type:

action def BookRoom {
  attribute clientName : String;
  attribute preferredWayOfPayment: String;
  ...
}
action def CheckIn {...}
action def ProvideRoomService {...}
action def ProvideLaundryService {...}
action def Bill {...}
action def Charge {...}
action def CheckOut {...}

Then we use these action type definitions for defining corresponding action steps in a RentHotelRoom action type definition:

action def RentHotelRoom {
  action bookRoom[1] : BookRoom;
  action checkIn[0..1] : CheckIn;
  action provideRoomService[*] : ProvideRoomService;
  action provideLaundryService[*] : ProvideLaundryService;
  action bill[1..*] : Bill;
  action charge[1] : Charge;
  action checkOut[0..1] : CheckOut;
  // Follow-Up: A room service must be succeeded by a bill action
  first [*] provideRoomService then [1..*] bill;
  // Follow-Up: A laundry service must be succeeded by a bill action
  first [*] provideLaundryService then [1..*] bill;
}

Notice that this action type definition includes three action cardinality constraints:

  1. The actions bookRoom and charge are executed exactly once.
  2. The actions checkIn and checkOut are executed at most once.
  3. The action bill is executed at least once.

and two follow-up constraints:

  1. A provideRoomService action must be succeeded by a bill action.
  2. A provideLaundryService action must be succeeded by a bill action.

We also need to define three precedence constraints and two combined follow-up/precedence constraints:

action def RentHotelRoom {
  ...
  // A check-in must be preceded by a book room action
  first [1..*] bookRoom then [*] checkIn;
  // A room service must be preceded by a check-in.
  first [1..*] checkIn then [*] provideRoomService;
  // A laundry service must be preceded by a check-in.
  first [1..*] checkIn then [*] provideLaundryService;
  // A book room action must be succeeded by a charge, and
  // a charge must be preceded by a book room action.
  first [1..*] bookRoom then [1..*] charge;
  // A check-in must be succeeded by a check-out, and
  // a check-out must be preceded by a check-in.
  first [1..*] checkIn then [1..*] checkOut;
}

Given the above action cardinality constraints for bookRoom, checkIn, charge and checkOut, these constraints could be rewritten in the following way, which is equivalent, but more informative:

action def RentHotelRoom {
  ...
  // A check-in must be preceded by exactly one book room action.
  first [1] bookRoom then [0..1] checkIn;
  // A room service must be preceded by exactly one check-in.
  first [1] checkIn then [*] provideRoomService;
  // A laundry service must be preceded by exactly one check-in.
  first [1] checkIn then [*] provideLaundryService;
  // A book room action must be succeeded by exactly one charge, and
  // a charge must be preceded by exactly one book room action.
  first [1] bookRoom then [1] charge;
  // A check-in must be succeeded by exactly one check-out, and
  // a check-out must be preceded by exactly one check-in.
  first [1] checkIn then [1] checkOut;
}