Reputation: 4610
Scenario:
I want to use rapidMQ as my messaging bus, I will be using web api and wcf as well. I want everything to be controlled via the message bus, so user approval/declining/assigning will result in a message on the bus, which workflow must pick up and action.
Is it possible to use workflow foundation with an mvc front end and have it respond to a message bus? i.e. workflow must place messages on a bus and read message from a bus and transition accordingly?
Please can you point me in the right direction? I am open to using another workflow solution if that will suit my needs better.
Upvotes: 4
Views: 393
Reputation: 827
It's better to isolate the workflow engine from business logic. workflow engine expose API to outside and maintain the task node and state.
When you have a workable workflow engine, you can make a proxy layer to translate the message to workflow engine API.
When client got the message from MQ, forward it to proxy layer and translate the message to a workflow API call. The message is actually another form of API call in this case.
Upvotes: 0
Reputation: 8406
I've driven workflows from message queues.
The basic concept is to have the workflow hosted as a service and any other applications or web sites as totally separate solutions.
Then they all communicate via queues.
I build a Workflow Controller class to handle incoming messages and run/re-hydrate the workflows. I never get the workflows themselves to read queues because handling timings/waiting gets annoying when queues go down. Better to send the workflow to sleep when it is waiting for a message from a queue and let the Controller class deal with the queue.
When sending to queues I get the Workflow Activities to call into a queue class in the workflow solution. I inject the queue handling class into the workflow by passing it into the workflow in the input parameters when running the workflow.
Upvotes: 1
Reputation: 1830
You first have to solve your workflow hosting situation. You might be able to host in mvc, but you won't be happy with it. Usually the host is a windows service exposing a WCF endpoint for an entry point into the workflow. After you work out hosting you can address messaging and bus.
Upvotes: 1