Post on 22-Dec-2015
SharePoint 2013 Workflow Basics
Installation and Use
Paul EngermanSenior Lead Consultant
paul.engerman@catapultsystems.com
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
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
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
What is new in SharePoint 2013?
Two SharePoint Workflow Platforms
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.
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.
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.
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.
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.
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
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
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
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
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
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
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
Authoring Tools
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
SharePoint Designer 2013 Plugin allows for Visio style workflows inside
SharePoint Designer Supports authoring 2010 and 2013 workflows
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
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
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
Configure Workflow Manager
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
Configure Workflow Manager
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
Workflow Service Config
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
Test Your 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
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)
Caveats No Foundation No tie in with content types No upgrade path from 2010 Workflows Scalability means more $$$ for hardware and
licensing
Sources http
://technet.microsoft.com/en-us/library/jj163276(v=office.15).aspx#appendix
http://www.codemag.com/article/1301021 http://
technet.microsoft.com/en-us/library/jj219638.aspx http://
technet.microsoft.com/en-us/library/jj193528.aspx
Questions?