Define multiple receive operations within a single workflow service (WF4)

I have a workflow service (specifically declaratively in a .xamlx file) that currently contains a single Get action. As you know, services usually expose more than one operation. And this is what I would like to do with my service too. How to add additional operations to this service? Without WF, this is very easy. Just add as many methods as you like and decorate them with OperationContract. Then the client can call any of the operations that the service offers. In WF4, on the other hand, when I try to add another Recieve service to a service, I can only add it before or after an existing activity. I thought I could use the Pick exercise for this, but I just guess. So am I doing this? Or should I add another workflow service and add a Get operation to it? (not at all like a good solution). Or maybe there is the right way to do this?

PS As you can tell, I am completely new to WF in general and WF4 in particular.

Thanks Avi

+4
source share
1 answer

Having one receiving activity at the beginning of a workflow is not unusual, because usually there is one event that triggers a workflow. And as soon as it starts, it can wait for other messages to appear. However, there is no reason not to allow the workflow to listen to several different ones at the same time, and, as you mentioned, Pick activity is the way to go. Just drop the Pick on the design surface, add as many PickBrache as you like, and enjoy.

+11
source

Source: https://habr.com/ru/post/1302757/


All Articles