Reuse states across workflows

May 18, 2010 at 7:39 AM
Edited May 18, 2010 at 7:40 AM

Cool that you're looking at supporting state machines in WF4. I had an issue with WF 3(.5) and I'm curious if this is resolved now.

Can you now also reuse states across different workflows? For example I have two workflows:

WF1 with states: A, B, C, D
WF2 with states: E, B, C, F

States B and C in these workflows do exactly the same thing. Can I define them somewhere separate like a custom activity which I can reuse in WF1 and WF2?

In WF3(.5) deriving from StateActivity didn't work. It threw "Adding child activities to a custom 'StateActivity' is not allowed" when adding states.

Cheers,
Gerben.

May 18, 2010 at 8:40 AM

In WF V4.0, State is an object instead of an activity. I am afraid that you cannot reuse it in another StateMachine or Workflow.

May 19, 2010 at 7:22 AM

Ah, that's too bad. I've filed an issue / feature request for this: http://wf.codeplex.com/WorkItem/View.aspx?WorkItemId=6067

Cheers,

Gerben.