سؤال

We have a situation where there are two XAML workflows (WF1 and WF2). WF1 is a superset of WF2. Thus while WF2 executes independently of WF1 within the system, we want WF2 to execute within the scope of WF1 when WF1 executes. Basically towards the end of WF1 there is a bookmark, on resumption of that bookmark WF2 has to execute.

They both operate on shared resources and we can not have different instances of these WFs running at the same time on our shared resources. We have a queuing mechanism in place that takes care of this.

What I would like to do is to somehow have this execution built in WF1 at design time. So maybe code an activity that loads up WF2 or convert WF2 to a coded activity somehow and drop it in WF1 etc. What I don't want is to have to pretty much copy WF2 and drop it in WF1 designer. Also we don't want a separate host process to be started within WF1 to execute WF2.

Basically in our WF1 and WF2 are both ran under WorkflowServiceHost. They are not traditional service WFs (so no Send/Receive activities) but are normal WFs exposed as WCF services. We have a good deal of customization that has gone into our WorkflowServiceHost regarding its persistence, tracking etc. which both our WFs benefit from. I would like to ensure that whatever mechanism we take to launch WF2 within WF1 we don't lose these benefits.

PS: If you would like to see how we have customized the running of these WFs, you can download sample code from my blog here

هل كانت مفيدة؟

المحلول

Technically speaking a workflow is just an activity. So if you compile the project with WF1 and WF2 in it and you open WF1 you will see WF2 in the activity toolbox. Just drag it onto WF1, wire up any arguments and you are good to go.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top