• Question

  • Hi All,

          Let's say we have a Integration + BPM scenario as stated below -

    A user (through an UI app) creates an xml request which is being put into a Message Queue and a scheduler(windows service) picks up this request xml and invokes a Workflow Service based on content in the Request XML(content based routing) and then the Workflow Service does n number of calculations based on data being picked up from differnet sources (via DB calls or other 3rd party systems via Message Queue Asyncronous Request Response exchange pattern) and after that some user intervention is required to approve those calculations and then once the calculations are approved by some user, those calculations are used to prepare a posting(another xml request) which is then again sent to another 3rd party system again via Message Queue Asyncronous Request Response exchange pattern and once successful response arrives ,a final notification is sent to the original UI app (which generated the original request xml).By the way, while doing all these, the Workflow app sends intermediate status notifications to the original UI app. 

    Now how and where do I apply CQRS(Command Query Responsibility Seggregation) concepts like Commands,Command Handlers,Aggregates,Domain Events, Sagas etc in such a Integration + BPM scenario? Does CQRS fit in a whole Integration + BPM scenario or may be some bounded context(e.g. may be only the UI) we can apply this architectural style, in such a scenario?

    Thanks and Regards,


    Monday, June 2, 2014 11:26 AM

All replies

  • The question is a bit muddy. You mention Sagas and WF, do you mean the concept of a saga or an implementation of an saga in WF? CQRS is about separating out the commands and the queries, how does that fit into what you are doing? Where do you get your query data from, i.e. how is the data segregated? It's just a little vague at the moment.

    Monday, June 2, 2014 4:07 PM
  • Hi pkr2000,

                      I just wanted general guidance on which are the areas where I can and I should apply CQRS. Regarding the data sources, there are various data sources like SQL Server DB tables,Oracle DB tables, flat files and 3rd party systems(here integration is done via MQ using Asynchronous Request Response Exchange Pattern). Regarding sagas, I wanted to know, can I implement sagas within WF?

                     In general, I wanted to know how does CQRS fit into a EAI(Enterprise Application Integration) and BPM(Business Process Management) application?

    Thanks and Regards,


    Wednesday, June 4, 2014 5:16 PM
  • You can't simply shoe-horn CQRS into an existing system. It's a pattern that relies on examining how your data is maintained "vs." how it's fetched. It's often paired with eventual consistency, given some of the description of a messaging pattern plus the use of WF you might already be there. But I would recommend looking for Greg Young or Udi Dahan and read their views on CQRS.

    Thursday, June 5, 2014 8:21 AM