Step 6: Policies
Almost always, some commands are added to the model but have no specific actor associated with them. During this step, you look for automation policies that might execute those commands.
An automation policy is a scenario in which an event triggers the execution of a com‐ mand. In other words, a command is automatically executed when a specific domain event occurs.
On the modeling surface, policies are represented as purple sticky notes connecting events to commands, as shown by the “Policy” sticky note in Figure 12-7.
Figure 12-7. An automation policy that triggers the “Ship Order” command when the “Shipment Approved” event is observed
If the command in question should be triggered only if some decision criteria is met, you can specify the decision criteria explicitly on the policy sticky note. For example, if you need to trigger the escalate command after the “complaint received” event, but only if the complaint was received from a VIP customer, you can explicitly state the “only for VIP customers” condition on the policy sticky.
If the events and commands are far apart, you can draw an arrow on the modeling surface to connect them.