A little (naive) order fulfilment flow for my Ruby event sourcing demo
Many ways to do this, but the Order actor reacts to its own "ItemFulfilled" events, and if all line items have been fulfilled, then it schedules a command to fulfil itself.
Why does the FulfillOrder command handler also check whether all items are fulfilled? Because that might have changed in the meantime. Eventual consistency is fun!
And a (simulated) payment workflow that runs concurrently from order fulfilment