Search code examples
workflow-foundation-4

Windows Workflow - Creating a reusable task list (bookmarks?)


I'm looking at migrating business processes into Windows Workflow, the client app will be ASP/MVC and the workflows are likely to be hosted via IIS.

I want to create a common 'simple task' activity which can be used across multiple workflows. Activity properties would look something like this:

  • Related customer
  • Assigned agent
  • Prompt ("Please review PO #12345")
  • Text for 'true' button ("Accept")
  • Text for 'false' button ("Reject")
  • Variable to store result in

Once the workflow hits this activity a task should be put into a db table. The web app will query the table and show the agent a list of tasks they need to complete. Once they hit accept / reject the workflow needs to resume.

It's the last bit that I'm stuck on. What do I need to store in the DB table to resume a workflow? Given that the tasks table will be used by multiple workflows how work I instantiate the workflow to resume it? I've looked at bookmarks but they assume that you know the type of workflow that you're resuming. Do I need to use reflection or is there a method in WF where I can pass a workflow id and it will instantiate it?


Solution

  • You can use workflow service and control its via ControlEndPoint. For more info about controlendpoint you can refer at http://msdn.microsoft.com/en-us/library/ee358723.aspx