locked
How to know who is next Workflow Approver? RRS feed

  • Question

  • Hi,

    I want to know how to trace who is the next approver in a workflow?

    Said, I have three approver on the workflow,

    when 1st approver complete the task, workflow will create a new task for second approver.
    when 2nd approver complete the task, workflow will create another task for third approver.

    Now, my workflow encounter an error on 2nd stage, is there any possibility to trace who is the third approver?

    I know what is my workflow instance id and list id. Any idea?

    Regards,
    myway08
    Thursday, August 13, 2009 2:23 AM

Answers

  • Hi,

    I want to know how to trace who is the next approver in a workflow?

    Said, I have three approver on the workflow,

    when 1st approver complete the task, workflow will create a new task for second approver.
    when 2nd approver complete the task, workflow will create another task for third approver.

    Now, my workflow encounter an error on 2nd stage, is there any possibility to trace who is the third approver?

    I know what is my workflow instance id and list id. Any idea?

    Regards,
    myway08

    I got a work around to overcome this issue. It is simple, log all approvers into event viewer log or list when launching workflow.
    • Marked as answer by myway08 Tuesday, August 18, 2009 11:25 PM
    Tuesday, August 18, 2009 11:25 PM

All replies

  • Could you please mention if this is a SPD or VS.Net workflow?

    Thanks,
    --Mo
    Thursday, August 13, 2009 3:27 AM
  • Could you please mention if this is a SPD or VS.Net workflow?

    Thanks,
    --Mo

    This is VS.Net Worflow Foundation.
    Thursday, August 13, 2009 3:57 AM
  • Umm.. here's a couple of ways:

    1. Attach the VS debugger after the first two approvers have completed their tasks. You can then inspect everything.
    2. Modify your code. Add a LogToHistoryListActivity after each CreateTask activity. Write the approver's names to the history log. You can then easily view the workflow progress.

    -fodi
    http://sharepointgear.wordpress.com/
    Thursday, August 13, 2009 6:14 AM
  • Umm.. here's a couple of ways:

    1. Attach the VS debugger after the first two approvers have completed their tasks. You can then inspect everything.
    2. Modify your code. Add a LogToHistoryListActivity after each CreateTask activity. Write the approver's names to the history log. You can then easily view the workflow progress.

    -fodi
    http://sharepointgear.wordpress.com/

    My workflow is stopped by error before second approver complete his task.

    Just want to know where WF store the third approver name? I want to get it.

    Thursday, August 13, 2009 6:29 AM
  • myway08,

    If this is a custom workflow, it's impossible for us to tell you where the approvers name is stored. The approvers names might all be assigned at the beginning and stored in an array\collection or whatever. Otherwise, they might be sourced just before the task is created, or even in the CreateTask activity itself.

    There's no magic collection of usernames that is available for a quick search.

    Your best bet would be to attach the debugger and break execution in the onWorkflowActivated activity. You can then inspect the tasks.. There might be multiple CreateTask activities, in which can you can set a break point at the second activity, or the developer might've used a repeater activity and you might need to step through the code manually.

    I'm guessing you weren't the original developer? If so, just attach a debugger. Again, there's no magic way of finding out who the next approver's gonna be.

    If you're debugging locally, the process is straight forward. It's a bit more complicated when debugging remotely. I've written an article here:
    http://sharepointgear.wordpress.com/2009/03/24/digging-deep-a-guide-to-debugging-sharepoint-workflows/


    http://sharepointgear.wordpress.com/
    Thursday, August 13, 2009 6:37 AM
  • hi
      go to the list and terminate the workflow manually from the taskedit.aspx page and go to the lisitem  and trigger the workflow manually --> view item->click on workflows --> startaew workflow click onyour workflow name(link).
    it will trigger and let you know what will be the next activity.






    thnx
    prasadwt
     
    PrasadWT
    Thursday, August 13, 2009 11:02 AM
  • Prasadwt,

    He's trying to find the name of the third approver in the workflow. The workflow fails after the second task is started but before the third approver has been assigned. Restarting the workflow to view the first activity won't work in this case.

    -fodi
    http://sharepointgear.wordpress.com/
    Thursday, August 13, 2009 11:36 PM
  • if you know the 3 approvers when the workflow starts, you can dump the "next one" in a hidden custom custom sharepoint list or even in the workflow history list by using the LogToHistorylist activity, before creating each task.Something like this :

    Log Approver1->to History list or to a custom hidden list
    CreateTask1
    Log Approver2->to History list or to a custom hidden list
    CreateTask2
    Log Approver3->to History list or to a custom hidden list
    CreateTask3


    Serge Luca; blog: http://www.redwood.be
    Sunday, August 16, 2009 3:29 PM
  • Hi,

    I want to know how to trace who is the next approver in a workflow?

    Said, I have three approver on the workflow,

    when 1st approver complete the task, workflow will create a new task for second approver.
    when 2nd approver complete the task, workflow will create another task for third approver.

    Now, my workflow encounter an error on 2nd stage, is there any possibility to trace who is the third approver?

    I know what is my workflow instance id and list id. Any idea?

    Regards,
    myway08

    I got a work around to overcome this issue. It is simple, log all approvers into event viewer log or list when launching workflow.
    • Marked as answer by myway08 Tuesday, August 18, 2009 11:25 PM
    Tuesday, August 18, 2009 11:25 PM