Sivarajan's Blog

SharePoint | Office 365 | Azure | JavaScript

SharePoint 2013 / Office 365 : Debugging a Designer Workflow – Part 2

In the designer workflow series, we will see that how to debug the current helpdesk workflow.

Unfortunately we cannot debug a SharePoint Designer Workflow. But we can easily debug the workflow if we have developed using Visual Studio 2012/2013.

Alternatively we can use the following tools to trace the designer workflow.

  1. Log to history list Activity
  2. Fiddler (This will work only if we are accessing a workflow using http and not https)
  3. Using <system.diagnostics>

Log to history list Activity

In the previous post, we saw that how to use local variables.

For the demo purpose, I just edited the Helpdesk Config list item and changed the TASK_APPROVAL_TEAM key value from IT ADMIN to UNKNOWN ADMIN.

Now we will edit the existing helpdesk workflow and add the Log to history activity to explore the assignedTo local variable.

28012014-1

Save and republish the helpdesk workflow. When we create a new task, due to UNKNOWN ADMIN  SharePoint user group, the current workflow was suspended. Here Log to history list activity help us to explore the workflow local variables.

28012014-2

28012014-3

Using Fiddler

We aware that the SharePoint 2013 workflow is not running inside the SharePoint worker progress. Windows Azure Workflow platform will be used for hosting and monitoring the SharePoint 2013 workflow. The communication between our system and workflow platform using two web services (http://localhost:12291 and http://localhost:12290). For more information, http://technet.microsoft.com/en-us/library/jj658588.aspx

We can easily explore the each response or request using Fiddler if our on-premise SharePoint platform is connected via http workflow service. But this option will not be helpful if we are developing a workflow using Office 365. By default Office 365 is running via https.

Using <system.diagnostics>

I found the blog post with detailed walkthrough on how to enable the default workflow foundation trace log. After enabling that we can use the ULS log viewer for filtering the SharePoint log data.

<system.diagnostics>

      <switches>

          <add name="System.Workflow LogToFile" value="1" />

          <add name="System.Workflow.Runtime" value="All" />

          <add name="System.Workflow.Runtime.Hosting" value="All" />

          <add name="System.Workflow.Runtime.Tracking" value="All" />

          <add name="System.Workflow.Activities" value="All" />

          <add name="System.Workflow.Activities.Rules" value="All" />     

      </switches>

  </system.diagnostics>

 

References

http://msdn.microsoft.com/en-us/library/office/dn508412.aspx

http://msdn.microsoft.com/en-us/library/office/dn292551.aspx#bkm_03

http://blogs.technet.com/b/victorbutuza/archive/2009/02/26/how-to-enable-workflow-tracing-debug.aspx

Add comment

Loading