views:

12

answers:

0

Hi All,

I can't seem to find any documentation/examples for situations where a WF application has multiple workflows, a single one selected and started against a single user.

I have a scenario where I have multiple clients using a WF enabled web application. Each of these clients will have 1 or more workflows available to them that they can associate and start for one of these workflows against a user of that client. Before I go to far down the wrong road I wanted to check something with the SO community as I don't want to duplicate effort and create tables that are already available to me to record this information in.

I will have an interface:

[userid typed in textbox here]
[workflow to start selected here[ ^ ]
{start workflow button here}

I need to populate the second field in that form that is a select box. Looking at the tables provided and the way that WF works (Workflows aren't stored in the database until an instance has been created), I'm looking at creating a ClientWorkflow table that will be the linking table between my Clients and Workflow definitions, in the Workflow table I will hold an ID, the ClassName of the workflow, description (for human consumption). After the user has effectively selected the Workflow ClassName, I can use this to pass to the CreateWorkflow method:

WorkflowInstance instance = 
                _workflowRuntime.CreateWorkflow(workflowTypeFromDatabase);

Obviously the select box will only show the Workflows that a linked to the Client whom the employee works for (eg: the ClientWorkflow table).

  • Does this sound reasonable?
  • Am I trying to solve a problem that has already been solved?
  • Will I have trouble starting the workflow from what is affectively a string?

Any thoughts on this approach appreciated.