← Graph

Process Managers in Ruby Lightning Talk

talk 9 connections

wroclove.rb 2025 lightning talk on implementing process managers in Ruby at the code level (which Mat called 'automation' in his talk). Explains process managers as a business-process implementation orchestrating departments — at the technical level a mapping from events to commands. Uses a reservation process example with three input events (pricing offer accepted, order confirmed, order cancelled), a state with three values, and five possible output commands (reserve, reject, accept, release stock, dispatch stock). Walks through the five parts of a process manager in code: (1) subscribe to events; (2) build state from events using a data object with status and order lines; (3) decide what to do based on state; (4) return commands; (5) pass commands to the command bus. Highlights reserve_stock as the non-trivial case where all order-lines must succeed transactionally — otherwise the code reverts everything. Shares helper-methods infrastructure that takes an event store and a command bus. Code is taken from the RailsEventStore/ecommerce reference repository, specifically the reservation process file.

date
2025-03-14
type
lightning-talk
talk Process Managers in Ruby Lightning Talk
about
Process Manager concept
Walks through process-manager implementation at the code level.
talk Process Managers in Ruby Lightning Talk
about
Code is built on rails_event_store and uses its event-store / command-bus infrastructure.
talk Process Managers in Ruby Lightning Talk
about
Process-manager code is taken directly from the RailsEventStore/ecommerce reservation-process file.
talk Process Managers in Ruby Lightning Talk
about
Command Bus concept
Commands returned by the process manager are dispatched through the command bus.
talk Process Managers in Ruby Lightning Talk
about
Event Store concept
Process manager subscribes to events from the event store.
talk Process Managers in Ruby Lightning Talk
about
Matches the 'automation' concept Mat used in his earlier Event Modeling talk.
talk Process Managers in Ruby Lightning Talk
about
Process managers map events to commands, a core CQRS concept.
talk Process Managers in Ruby Lightning Talk
presented_at
Lightning talk session at wroclove.rb 2025.
talk Process Managers in Ruby Lightning Talk
related_to
Follows up on Mateusz Nowak's talk where process managers were called automations.

Provenance

Created in
wroclove.rb 2025 lightning talks 2026-04-18 08:03