Modeling Branches Newsletter
Techniques for modeling conditional flows
How to make business rules visual, understandable, and testable
October 2023 • 8 min read • Event Modeling
In the last episode of the “Eventmodeling & Eventsourcing” Podcast, we mainly discussed “Given / When / Then” scenarios to describe business policies and touched on slice-based architectures, especially how they simplify concurrent development and version control.
We use business rules in three places:
To change the system, we use state change slices – typically consisting of:
📌 Example: A customer clicks Submit Order on the orders page → this stores an event in the system.
These rules are described using Given / When / Then:
This approach makes rules:
When the
Submit Ordercommand is executed → ExpectOrder Submittedevent stored with same ID
Preventing duplicates:
Given:
Order Submittedalready exists When: trying to submit again → Then: error state is expected
In the podcast, Adam and I explained our different takes:
Given:
Order SubmittedThen:Customer Notifiedis triggered automatically
e.g. Treat automated SNS notification like a human-triggered command
They are:
🎧 Follow the Eventmodeling & Eventsourcing Podcast 👋 See you next week!
My book “Understanding Eventsourcing” gives you the blueprint. But reading alone will take your team too long.
I can teach your team how to build these blueprints faster and skip the whole trial-and-error phase. Let’s have a chat about how this applies to your project.
Follow the Online Course “Implementing Eventsourcing” - comes with a Lifetime Event Modeling Toolkit License.