Step 5: Commands
Whereas a domain event describes something that has already happened, a command describes what triggered the event or flow of events. Commands describe the system’s operations and, contrary to domain events, are formulated in the imperative. For example:
• Publish campaign
• Roll back transaction
• Submit order
Commands are written on light blue sticky notes and placed on the modeling space before the events they can produce. If a particular command is executed by an actor in a specific role, the actor information is added to the command on a small yellow sticky note, as illustrated in Figure 12-6. The actor represents a user persona within the business domain, such as customer, administrator, or editor.
Naturally, not all commands will have an associated actor. Therefore, add the actor information only where it’s obvious. In the next step we will augment the model with additional entities that can trigger commands.
![]() |
Figure 12-6. The “Submit Order” command, executed by the customer (actor) and fol‐ lowed by the “Order initialized,” “Shipping cost calculated,” and “Order shipped” events