views:

166

answers:

1

Hi,

In workflow 3.0-3.5 you could explicitly set the Id of a workflow you start. This feature was particularly useful. I cannot see a way to do this in Workflow 4.0. Does anyone know if this is possible? Since the Id property is read-only and there is no overloaded constructor accepting an Id, the only possible mechanism I see is if there is a magic key that could be used when passing the IDictionary object into the WorkflowApplication constructor.

Cheers,
Rohland

+1  A: 

In WF4 there is no way to do this and the ID is always generated by the WorkflowApplication. The arguments dictionary isn't going to help you there either.

Why do you want to specify a Guid for a workflow instead of the WorkflowApplication providing one for you?

Maurice
It is useful in scenarios where you have a queued set of tasks where each task has an Id (assume Guid). It is useful to have the workflow Id simply match the task's Id as it is processed. While it is simple to create a mapping, an inferred one is just simpler.
Rohland
Except that is doesn't tell you if you already started the workflow. I just add the workflow ID to an item when I start the workflow.
Maurice