21.4. Troubleshooting Workflows

Troubleshooting problems with workflows created by SharePoint Designer can be a daunting task, especially if the workflows become more complex. With multiple activities configured in single steps and a large number of steps in a single workflow, determining the action that causes the problem in workflow execution can be difficult. You might want to keep the following in mind while working on SharePoint Designer workflows:

  • When you create workflows for SharePoint lists or libraries by using Workflow Designer, SharePoint Designer makes Web service calls to SharePoint to determine the latest versions of the important SharePoint files. SharePoint Designer then stores a cached copy of these files locally on the computer where it's installed. This location, called the ProxyAssemblyCache, is stored on the SharePoint Designer machine at C:Documents and Settings<username>Application DataMicrosoftSharePoint DesignerProxyAssemblyCache. While this is a temporary cache, SharePoint Designer always looks for files inside this folder when creating workflows. If for some reason (such as a version upgrade or solution deployment) the server version of the files changes, SharePoint Designer might not be aware of it and would still use the cached version, which might cause errors and problems in SharePoint Designer while creating workflows. To ensure that SharePoint Designer requests the latest version of files, you can delete the contents of the ProxyAssemblyCache folder, which forces SharePoint Designer to request these files again, which helps update the file version.

  • If you're troubleshooting a complex SharePoint Designer workflow that has multiple steps, you might want to break it into a smaller workflow to troubleshoot and find the step that's causing the workflow to fail. This approach is useful in quickly eliminating potential problems with the workflow logic.

  • Workflows can be resource-intensive. You need to ensure that you test them for performance under a heavy load before deploying them to a production environment. It's also recommended that you break down complex workflows with a lot of steps and branches into smaller multiple workflows. This ensures that the workflows are easier to maintain and troubleshoot.

  • Only a single instance of a workflow can run on a particular item at one time. If you have instances of the same workflow overlapping on the same item, the new instances would simply fail to execute. You might want to check scenarios that could lead you into this limitation.

  • Avoid/check infinite looping that might happen if you configure a workflow to start on item update and then change the current item within the workflow by using an action. Put checks in place to help the workflow logic to come out of an infinite loop.

A list of most commonly encountered errors when working in SharePoint Designer for creating workflows can be found at http://office.microsoft.com/en-us/sharepointdesigner/HA102379121033.aspx.


While the SharePoint diagnostics logging (also called Unified Logging Service) can provide you with lots of information for assistance in troubleshooting workflows, you can also enable Windows Workflow Foundation logging to determine the point of failure in a running workflow. Workflow logging can be enabled for a Web application by adding the following code in the Web application's web.config file inside the <system.diagnostics> section:

<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>

After this code is added to the web.config file of the SharePoint Web application, a WorkflowTrace.log file is created inside the SharePoint Web application's file system for review and analysis. You can expect detailed information and logging for workflows in this log file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.135.249