Download - SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Transcript
Page 1: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

SharePoint 2013 Workflow Basics

Installation and Use

Paul EngermanSenior Lead Consultant

[email protected]

Page 2: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Brief History of SharePoint Workflow

Page 3: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Limits of Previous Workflows Not compatible with SharePoint Very expensive to add on third party tools Not portable in an easy way Not scalable Poor performance at scale Design tools hard to use or unreliable

Page 4: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

SharePoint 2007 SharePoint 2007 was one of the first platforms that

implemented WF SharePoint 2007 workflows allowed developers and

users to model long running complex tasks Visual Studio workflows were difficult and complex

to author SharePoint Designer 2007 workflows were not

portable and the design surface was unreliable Performance was terrible at scale

Page 5: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

SharePoint 2010 Visual Studio 2010 workflows were a lot better, but

still complex to write and maintain SharePoint Designer 2010 made massive

improvements Workflows now portable between environments Able to be attached to Visio visualizations Design surface vastly improved

Page 6: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

What is new in SharePoint 2013?

Page 7: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Two SharePoint Workflow Platforms

Page 8: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

New Workflow ActionsAction Description

Assign a Task Assigns a single workflow task to a user or group.

Start a Task Process Initiates execution of a task process.

Go to This Stage Specifies the next stage in a workflow to which flow control should be handed.

Call HTTP Web Service Functions as a method call to a Representational State Transfer (REST) endpoint.

Page 9: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

New Workflow ActionsAction Description

Start a List Workflow Starts a list-scoped workflow.

Start a Site Workflow Starts a site-scoped workflow.

Build DynamicValue Creates a new variable of type DynamicValue.

Get Property from DynamicValue Retrieves a property value from a specified variable of type DynamicValue.

Page 10: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

New Workflow ActionsAction Description

Count Items in DynamicValue Returns the number of rows in a variable of type DynamicValue.

Trim String Removes all leading and trailing white-space characters from the current string.

Find Substring in StringReturns 1-based index of the first occurrence of one or more characters, or the first occurrence of a string, within a string.

Replace Substring in StringReturns a new string in which all occurrences of a specified character or string are replaced with another specified character or string.

Page 11: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

New Workflow ActionsAction Description

Translate DocumentFunctions as a wrapper around the HTTP activity that calls the synchronous translation API. You must configure a Machine Translation Service Application for the SharePoint site on which you run the workflow.

Set Workflow Status Updates workflow status as specified in message string.

Create a Project from Current Item [Microsoft Project] Creates a Project Server project based on the current item.

Set the current project stage status to this value [Microsoft Project]

Sets the two status fields within the current stage of the project.

Page 12: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

New Workflow ActionsAction Description

Set the status field in the idea list item to this value [Microsoft Project]

Updates the status field of the original SharePoint list item.

Wait for Project Event [Microsoft Project]Pauses the current instance of the workflow to await a specified Project event: Project checked in, Project committed, Project submitted.

Set this field in the project to this value [Microsoft Project]

Sets the value for the enterprise custom field for a specified project.

Page 13: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

SharePoint Designer Enhancements Web Services: Calling web services is now natively

supported Dictionary: data type which is used for storing name

value pairs. State Machine: workflow for states and conditions Nested conditions: to represent complex business

processes easily Looping: that allows you to loop n times between

stages or actions Impersonation: action to execute with higher level

access

Page 14: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Workflow Manager capabilities High Density and Multi-Tenancy Elastic Scale Activity / Workflow Artifact Management Tracking and Monitoring Instance Management Fully Declarative Authoring REST and Service Bus Messaging Managed Service Reliability

Page 15: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Workflow Interop Bridge Invoke a SP2010 style workflow from an SP2013

style workflow Call the built in SP 2010 workflows for Approval,

etc. Provides extensibility while new workflow actions

become available

Page 16: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

How does it operate differently? Workflows are now run in a Workflow Manager

Farm out of process from SharePoint. The communication between the two farms

happens using REST API and is secured using OAuth.

Scalability and Performance are now independent of SharePoint bottlenecks

Page 17: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Declarative Workflows Declarative Workflows blur the boundary between

SharePoint Designer and Visual Studio The ability to call Web Services allows developers

to create custom code activities or web services and call them directly

The use of a Dictionary supports web services data storage

Custom Actions can be created in Visual Studio

Page 18: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Workflow Activities Custom Activities

SharePoint Activities Microsoft.SharePoint.Workflow Services.Activities

Project Activities Microsoft.Office.Project.Server. WorkflowActivities

Workflow Manager Activities Workflow Manager 1.0 Microsoft.Activities

WF 4.5 Activities .NET 4.5 System.Activities

Page 19: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Workflow Activities Different activities are used in different levels of

development Some of these activities are base level activities which

can be used for interacting with the workflows Workflow Manager Activities are used for interacting

with the  Workflow Manager Operations in SharePoint, such as the creation of list

items Custom activities allow for the inclusion of business

logic in the code then calling these activities using web services

Page 20: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Authoring Tools

Page 21: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Visio 2013 Design workflows in Visio then import to SharePoint

Designer Business users can work with Visio and visualize

the process as shapes SharePoint Designer converts shapes to activities

before actual deployment

Page 22: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

SharePoint Designer 2013 Plugin allows for Visio style workflows inside

SharePoint Designer Supports authoring 2010 and 2013 workflows

Page 23: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Visual Studio 2012 Visual Studio 2012 introduces a definite shift in

how developers author workflows. SharePoint 2013 style workflows are easier to

debug and can be extended using custom activities.

There is no code activity A sandbox solution can be used Only way to truly debug a workflow

Page 24: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Designer vs. Visual StudioSP Designer 2013 Visual Studio 2012

Declarative Yes Yes

Custom Actions Cannot create, but uses the actions created through VS

Can create and consume

Work inside Apps No Yes

Debugging Cannot be done Full support

Visio Integration Yes. Full plug in available. No

Custom Code Not Allowed Not Allowed

Target Audience Power Users, End Users and Developers

Developers

Page 25: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

How do I get Started? Install Workflow Manager -

http://go.microsoft.com/fwlink/?LinkID=252092. .NET Framework 4.5 Service Bus 1.0 Workflow Client 1.0 Microsoft Windows Fabric

Page 26: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Configure Workflow Manager

Page 27: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Configure Workflow Manager Default settings are recommended Only allow HTTP for development use Enable firewall rules according to individual need Use a good strong certificate generation key

Page 28: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Configure Workflow Manager

Page 29: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Configure Workflow Manager Enable remote connectivity or TCP/IP and Named

Pipes protocols for SQL Server In a production environment, you will have to

create a valid certificate, configure IIS, export the certificate, and then import and install the certificate on the SharePoint server

View the settings of the Workflow Management Site at https://localhost:12290/ under IIS

Page 30: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Workflow Service Config

Page 31: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Configure SharePoint Use the fully qualified domain name or FQDN site

URL of the workflow farm along with the port number while you are configuring SharePoint

Create a new site collection first then start the configuration

If you install the workflow farm on a different VM, then you will need to install the Workflow Client on the SharePoint VM. This is required to register the workflow service successfully

Powershell Script to complete setupRegister-SPWorkflowService -SPSite "http://sp/Sites/wfs" -WorkflowHostUri "http://sp:12291" -AllowOAuthHttp

Page 32: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Test Your Workflow

Page 33: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Workflow Best Practices When you use the Log To History List action, more i

nformation is better

Write the value of every string and variable that you construct to the history list

Output a trace log before and after each step or important unit of work in the workflow

Verify that variables are non-null and contain expected values

Page 34: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Workflow Best Practices Ensure that strings in workflow text fields do not ex

ceed 255 characters

Use elevated permissions on a neutral account when using impersonation (Like a service account)

In reusable workflows, use Association columns to ensure error-free list fields (Content Types can change)

Workflow design: Model a business process in a single workflow

Workflow design: Using the Approval action effectively (Stages)

Page 35: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Caveats No Foundation No tie in with content types No upgrade path from 2010 Workflows Scalability means more $$$ for hardware and

licensing

Page 37: SharePoint 2013 Workflow Basics. Brief History of SharePoint Workflow.

Questions?