locked
What is the best way to list a group of running workflows? RRS feed

  • Question

  • Suppose I have an approval workflow where a manager needs to approve some expense. Each expense claim is a separate workflow. If I want to create UI for that manger that lists all the claims that are waiting for approval, how can I best achieve that?

    I can think of these solutions:

    1.       Create a custom database table and insert and delete records in there before and after the approval is made

    2.       Create a master workflow that tracks all the claims in a workflow variable

    3.       Use a solution that uses Workflow Tracking

    I am designing a solution that will have many of these types of overviews, so I am a bit reluctant to create dedicated persistence for all of them. On the other hand, I am not sure if Workflow Tracking is suitable for using in the business logic (instead of only for diagnostics).

    What would be the best approach? Is there a better solution?

    Wednesday, August 11, 2010 10:30 AM

Answers

All replies

  • Workflow Tracking is definitely the preferred solution here, but you might be able to get what you need just by setting up persistence and querying the persistence database for records- the persistence records can be set to be removed when the workflow completes.
    Wednesday, August 11, 2010 7:35 PM
  • Does using tracking only not pose the risk of the UI showing a state inconsistent with the actual workflow state?

    Ex: Start two approval requests, approve one, restart the workflow service.
    Without persistance the UI will show one pending approval while none exists in the workflow.
    [Edit] Deleting all state info at workflow service start could solve this.

    I assume writing state info to a database (using a custom activity or tracking) for the requierment stated here must always happen in a transaction together with persistance. So using a persistance particant as described http://msdn.microsoft.com/en-us/library/ee364726.aspx seems  to be the best solution.
    Or am I missing something here?

    Thursday, August 12, 2010 6:11 AM
  • Hi,

    You can use the default provided sql persistence to do this.
    1. Promote the data you want to show to the managers, check here for more info about Promoting data:
    http://msdn.microsoft.com/en-us/library/ee364726.aspx
    and this
    http://xhinker.com/post/WF4Promote-persistence-Data.aspx

    2. query the persistence database to display the bookmarked/persisted) workflows.

    Regards


    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support. My Blog:http://xhinker.com
    • Marked as answer by traveldev Friday, August 13, 2010 8:54 AM
    Friday, August 13, 2010 7:44 AM
  • Thanks Andrew,

    Data promotion looks like a perfect solution for my problem. I will give it a try!

    Friday, August 13, 2010 8:57 AM