Develop Workflows 2013 – Visual Studio vs SharePoint Designer decision tree

General speaking (Visual Studio or SharePoint Designer) differs somewhat, but the concept of the declarative workflow remains the same.

Declarative workflows

Let’s first be clear what is meant by “declarative” workflows. This term means that instead of being authored in code and then compiled into managed assemblies, the workflow is described (literally) in XAML and then executed interpretively at run time.

The XAML is derived (or inferred) from the workflow building blocks that you manipulate in the Workflow Designer (if using Visual Studio) or SharePoint Designer workflow design surface (or Visio, but more about that later). The building blocks themselves are the visual workflow design objects in the designer toolbox—stages, conditions, actions, events, and so on. The set of tools in the respective toolboxes (Visual Studio or SharePoint Designer) differs somewhat, but the concept of the declarative workflow remains the same.

Decision tree: SharePoint Designer vs. Visual Studio


Feature / Requirement

SharePoint Designer

Visual Studio

Allows rapid workflow development

Yes

Yes

Enables reuse of workflows

A workflow can be used only by the list or library on which it was developed. However, SharePoint Designer provides reusable workflows that can be used multiple times within the same site.

A workflow can be written as a template so that after it is deployed, it can be reused and associated with any list or library.

Allows you to include a workflow as part of a SharePoint solution or app for SharePoint

No

Yes

Allows you to create custom actions

No. However, SharePoint Designer can consume and implement custom actions that are created and deployed by using Visual Studio.

Yes. However, be aware that in Visual Studio, the underlying activities, not their corresponding actions, are used.

Allows you to write custom code

No

No

 

Can use Visio Professional to create workflow logic

Yes

No

Deployment

Deployed automatically to list, library, or site on which they were created.

Create a SharePoint solution package (.wsp) file and deploy the solution package to the site (SPWeb).

One-click publishing available for workflows

Yes

Yes

Workflows can be packaged and deployed to a remote server

Yes

Yes

Debugging

Cannot be debugged.

Workflow can be debugged by using Visual Studio.

Can use only actions that are approved by site administrator

Yes

Yes

 

This is changed from previous versions. Previously, workflows and actions that were authored by using Visual Studio were code-based and deployed at the farm scope, so administrator approval was not required.

Among the greatest advantages of the workflow framework in SharePoint 2013 is the ease with which information workers can use the no-code environment of SharePoint Designer to create rich and powerful workflows. Additionally, a high degree of flexibility and customization is available in a declarative authoring environment such as Visual Studio.

Both of these workflow authoring environments—SharePoint Designer and Visual Studio—offer specific advantages and disadvantages. In this section, we explore how to determine which authoring environment best suits your workflow development needs.

Using SharePoint Designer
  • Target users: Information workers, business analysts, SharePoint developers.

  • Difficulty level: Familiarity with SharePoint Designer, including the core workflow components, such as stages, gates, actions, conditions, and loops.

With SharePoint Designer, users can create a workflow that is attached to a list, library, or site using a no-code, text-based designer. Or, they can use the new visual design environment in which graphical elements are arranged on a design surface to represent the logical flow of a business process. SharePoint Designer excels at enabling rapid workflow development by non-technical workers.

Using Visual Studio
  • Target users: Intermediate or advanced software developers.

  • Difficulty level: Familiarity with Visual Studio, including software development concepts such as event receivers, packaging and deployment, and security.

Authoring workflows in Visual Studio provides flexibility to create workflows to support virtually any business process, regardless of its complexity, and allows debugging and reuse of workflow definitions. Perhaps most important, Visual Studio lets developers include SharePoint workflows as part of a broader SharePoint solution or app for SharePoint.

Visual Studio enables developers to create custom actions for consumption by SharePoint Designer, and provides the means to execute custom logic. With Visual Studio, developers can also create workflow templates, which can be deployed to multiple sites.

Comparing SharePoint Designer with Visual Studio

The following table provides a side-by-side comparison of the features and requirements for using SharePoint Designer and Visual Studio to create SharePoint workflows.

This is changed from previous versions. Previously, workflows and actions that were authored by using Visual Studio were code-based and deployed at the farm scope, so administrator approval was not required.

Developing workflows using Visual Studio

Unlike earlier versions, workflows in SharePoint 2013 are entirely declarative. Built now on Windows Workflow Foundation 4, Visual Studio provides a visual workflow designer surface that lets you create custom workflows, workflow templates, forms, and custom workflow activities entirely in the designer environment. Your workflow is then packaged and deployed as a SharePoint Feature. For information about Feature packaging, see Using Features in SharePoint Foundation.

Perhaps the most significant change for Visual Studio developers is that custom workflows are no longer compiled and deployed as .NET Framework assemblies. Furthermore, SharePoint 2013 no longer uses Microsoft InfoPath forms; instead, forms generation relies on Microsoft ASP.NET forms.

Finally, the Visual Studio workflow project templates have changed. Whereas formerly templates for state machine and sequential workflows were provided, these distinctions are no longer meaningful. Rather, Visual Studio project templates are available in the Visual Studio build provided on your virtual machine (VM).

Enabling on-premises workflow debugging


To debug on-premises workflows in Visual Studio, you need to temporarily allow the Workflow Manager Tools to access your system through the firewall.

  1. In Windows Control Panel, choose System and Security, Windows Firewall.

  2. In the Control Panel Home list, choose the Advanced Settings link.

  3. In the left pane of Windows Firewall, choose Inbound Rules.

  4. In the Inbound Rules list, choose Workflow Manager Tools 1.0 for Visual Studio 2012 – Test Service Host.

  5. In the Actions list, choose Enable Rule.

  6. On the properties page of your SharePoint project, choose the SharePoint tab, and then select the Enable Workflow debugging check box.

Debugging SharePoint Online workflows using Visual Studio

To debug SharePoint Online workflows in Visual Studio, perform the following steps:

  1. If you’re behind a firewall, you may need to install a proxy client (such as the Forefront Threat Management Gateway (TMG) Client), depending on your company’s network topology.

  2. Register for a Windows Azure account if you haven’t already, and then sign into that account.

    For information about how to register for a Windows Azure account, see Windows Azure.

  3. Create a Windows Azure Service Bus namespace, which you can use to debug remote workflows. You can do this on the Windows Azure management portal.

    For more information about the Windows Azure Service Bus, see Messaging and Managing Service Bus Service Namespaces.

    SharePoint Online workflow debugging uses the Relay Service component of the Windows Azure Service Bus, so you’ll be charged for using the Service Bus. See Service Bus Pricing FAQ. You get free access to Windows Azure each month that you subscribe to Visual Studio Professional with MSDN, Visual Studio Premium with MSDN, or Visual Studio Ultimate with MSDN. With this access, you can use the Service Bus relay for 1,500, 3,000, or 3,000 hours, depending on your MSDN subscription. See Get some amount of Windows Azure Services each month at no additional charge.

  4. In Windows Azure, choose your service namespace, choose the Access Key link, and then copy the text in the Connection String box.

  5. On the properties page of your app for SharePoint project, choose the SharePoint tab, and then select the Enable Workflow debugging check box.

    You must enable this feature to debug workflows in SharePoint Online. This property applies to all of your SharePoint projects in Visual Studio. Visual Studio automatically turns off workflow debugging if you package your app for distribution on the Office store.

  6. Select the Enable debugging via Windows Azure Service Bus check box. Then, in the Windows Azure Service Bus connection string box, paste the connection string that you copied.

After you enable workflow debugging and provide a valid connection string for the Windows Azure Service Bus, you can debug SharePoint Online workflows.

If you haven’t disabled workflow debugging and don’t want to receive a notification whenever your project contains a workflow, clear the Notify me if Windows Azure Service Bus debugging is not configured check box.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s