locked
Rehosted Debugging RRS feed

  • Question

  • In his blog http://blogs.msdn.com/kushals/archive/2009/12/29/visualworkflowtrackingwithstepservice.aspx Kushal wrote "Please note that, it is not Re-hosted debugging per say since we are not controlling the Workflow Runtime through a customer debug engine."

    How can I actually control the Workflow Runtime through a custom debug engine? Where to start with?

    I need debug commands like Step Into, Step Over, Repeat last Step, Continue at Selected Activity. Is there any possibility to accomplish this?

    I thought about executing any highlighted activity of the workflow's activity hierarchy in a separate instance to simulate the stepping behaviour of the debugging, but these are of-cause separate instances with no common context.


    Regards

    Christof

    Wednesday, March 24, 2010 1:18 PM

Answers

  • Hi -

    The debug APIs allow to track Workflow execution, as outlined in Kushal's blog - http://blogs.msdn.com/kushals/archive/2009/12/29/visualworkflowtrackingwithstepservice.aspx
    It is possible to simulate Step Into thru Blog’s scenario by adding breakpoint to the next activity and pressing F5; however it does not provide debugging support (just tracking).

    Workflow debugging has dependency on Visual Studio debugging engine. WF4.0 does not currently have API support for building a custom debug engine outside of VS.

    Regards,

    Naiana

    Thursday, March 25, 2010 12:49 AM
  • Hi Christof -

    We do not have support for this scenario.

    Please help us with following releases by submitting your suggestions/feedback thru https://connect.microsoft.com/wf


    Regards,
    Naiana

    • Marked as answer by Christof K Wednesday, March 31, 2010 7:29 AM
    • Marked as answer by Christof K Wednesday, March 31, 2010 7:30 AM
    • Unmarked as answer by Christof K Wednesday, March 31, 2010 7:30 AM
    • Marked as answer by Christof K Wednesday, March 31, 2010 7:30 AM
    Tuesday, March 30, 2010 5:07 PM

All replies

  • Hi -

    The debug APIs allow to track Workflow execution, as outlined in Kushal's blog - http://blogs.msdn.com/kushals/archive/2009/12/29/visualworkflowtrackingwithstepservice.aspx
    It is possible to simulate Step Into thru Blog’s scenario by adding breakpoint to the next activity and pressing F5; however it does not provide debugging support (just tracking).

    Workflow debugging has dependency on Visual Studio debugging engine. WF4.0 does not currently have API support for building a custom debug engine outside of VS.

    Regards,

    Naiana

    Thursday, March 25, 2010 12:49 AM
  • Hi Naiana

    I was wondering if the following scenario would be a workaround for the debugging scenario.

     

    If the workflow stops at a breakpoint, the workflow is persisted to a in-memory XML file. As I understand, the state of the workflow is persistent, e.g. the values of variables and the current activity. Therefore I could change the values of variables or set the current activity back to a previously executed activity by manipulating  the persisted workflow. Afterwards I would load and continue the persisted workflow.

    Does that work?

    By the way. The sample to use a XML file as InstanceStore is not available any more \WF_WCF_Samples\WF\Application\PurchaseProcess. Has this feature be dropped as well (like dynamic updating)?

     

    Regards

    Christof

     

    Monday, March 29, 2010 8:18 AM
  • Hi Christof-

    When the workflow stops at a breakpoint, it does not persist to a in-memory file.

     

     

    For the workflow tracking solution (from Blog), when breakpoint is hit, it waits for user input (F5).

    //Show the Debug Adornment
    void ShowDebug(SourceLocation srcLoc)
    {
       …
       if (isBreakpointHit == true)
       {
          resumeRuntimeFromHost.WaitOne();
       }
    }
    
    
     protected override void OnKeyDown(System.Windows.Input.KeyEventArgs e)
     {
        if (e.Key == Key.F9)
        {
            …
        }
        else if (e.Key == Key.F5)
        {
           resumeRuntimeFromHost.Set();
        }
     }
    
     
    

     

    I hope this helps.
    Naiana

    J

    Monday, March 29, 2010 6:14 PM
  • Hi Naiana

     

    My question was if I write my own code to follow that scenario, would this work or is it simply not possible?

    Here again that scenario in pseudo code:

    1. Start workflow.
    2. Pause workflow at breakpoint
    3. Persist workflow to an in-memory XML file
    4. Modify workflow status at in-memory XML file, e.g. values of variables or current activity
    5. Reload workflow from in-memory file
    6. Resume workflow (with the new values of variables or current activity)

     

    Regards

    Christof
    Tuesday, March 30, 2010 7:57 AM
  • Hi Christof -

    We do not have support for this scenario.

    Please help us with following releases by submitting your suggestions/feedback thru https://connect.microsoft.com/wf


    Regards,
    Naiana

    • Marked as answer by Christof K Wednesday, March 31, 2010 7:29 AM
    • Marked as answer by Christof K Wednesday, March 31, 2010 7:30 AM
    • Unmarked as answer by Christof K Wednesday, March 31, 2010 7:30 AM
    • Marked as answer by Christof K Wednesday, March 31, 2010 7:30 AM
    Tuesday, March 30, 2010 5:07 PM