@Jonathan (or anyone else who can help)
I have couple more questions regarding the Event Store and Common
Domain Saga implementation.
Let's say I have the following scenario:
An Employee requests leave
Leave Request must be approved by the HR Manager
Leave Request must be approved by the employees Department Manager
Possible results:
Leave Request is granted if both managers approve the request
Leave Request is denied if one manager denies the request
Leave Request is denied if no manager action is taken within one
week of the request
So I'm going to be kicking off a Saga when the employee requests
leave.
Questions:
1) do I create the Saga in a Command Handler? or do I create the Saga
in response to an Event? or does it depend on the scenario?
2) related to #1, should a Saga Repository be accessed from an Event
Handler? If so, doesn't this cross the wire between your read model
and write model and prevent scalability? perhaps you'd set up
separate event store persistence for Aggregates apart from that used
for Sagas? or are you sharing the same event store for both? if the
Saga Repository isn't used in an Event Handler, then where?
3) how do you do "timeouts" if a Saga does not complete by a certain
time limit (as in the third transition listed above)? I know
NServiceBus has Timeout management functionality, but since the Common
Domain saga implementation is different, I'm guessing there has to be
another way to handle this?
I think I'm really close to getting my head around this and hopefully
a slight nudge in the right direction will put me right where I need
to be.
Thanks,
--Jeff
> There's actually a pattern for this, it's called the Correlation
> Identifier Pattern:
http://www.eaipatterns.com/CorrelationIdentifier.htmlhttp://www.eaipatterns.com/ramblings/09_correlation.html