SharePoint workflow deep-dive

50 %
50 %
Information about SharePoint workflow deep-dive

Published on December 29, 2008

Author: chrisobrien

Source: slideshare.net

Description

My presentation to the UK SharePoint User Group in January 2008 on SharePoint workflow. During the presentation I developed a state-machine workflow over several demonstrations. A downloadable \'resources pack\' of workflow tips and tricks accompanied this presentation, available at http://www.sharepointnutsandbolts.com/2008/01/resources-from-my-workflow-deep-dive.html.

Workflow: A deep dive into developing workflows using Visual Studio and InfoPath Chris O’Brien – SharePoint MVP http://www.sharepointnutsandbolts.com

Workflow intro Key decisions Can I use an SPD workflow instead of Visual Studio? Sequential vs. state machine workflows ASPX vs. InfoPath forms Visual Studio workflows in detail The 4 complexities of workflow Chris’s workflow bonanza pack! 7 key resources, 5 ‘how-to’ guides, 4 advanced tips, 3 pitfalls (+ slides, sample code) What we’ll cover

Workflow intro

Key decisions

Can I use an SPD workflow instead of Visual Studio?

Sequential vs. state machine workflows

ASPX vs. InfoPath forms

Visual Studio workflows in detail

The 4 complexities of workflow

Chris’s workflow bonanza pack!

7 key resources, 5 ‘how-to’ guides, 4 advanced tips, 3 pitfalls (+ slides, sample code)

SharePoint workflows are always associated with content e.g: Document Form (typically InfoPath) List item Workflows revolve around tasks Person X must do Y Workflows can be started manually or automatically (i.e. when new item is added) Introduction

SharePoint workflows are always associated with content e.g:

Document

Form (typically InfoPath)

List item

Workflows revolve around tasks

Person X must do Y

Workflows can be started manually or automatically (i.e. when new item is added)

Introduction Different workflow types: VS workflows require coding ability (and ideally InfoPath knowledge) SPD workflows can be powerful, but limitations Standard workflows simple to use Standard SPD VS COMPLEXITY

Different workflow types:

VS workflows require coding ability (and ideally InfoPath knowledge)

SPD workflows can be powerful, but limitations

Standard workflows simple to use

Advantages of SPD workflows: Built using wizard, not code Powerful - wide-range of activities to add Simple to deploy Limitations of SPD workflows: Can only be applied to one list at a time (no re-use) Custom code activities, but not ad-hoc custom code Not flexible enough for many requirements Key decision #1 – Visual Studio or SPD?

Advantages of SPD workflows:

Built using wizard, not code

Powerful - wide-range of activities to add

Simple to deploy

Limitations of SPD workflows:

Can only be applied to one list at a time (no re-use)

Custom code activities, but not ad-hoc custom code

Not flexible enough for many requirements

Sequential workflow: ‘ Traditional’ design Generally flow downwards, but: If/else activity While loop activity (cannot overlap) These aside, cannot go ‘back up’ Key decision #2 – VS workflow type

Sequential workflow:

‘ Traditional’ design

Generally flow downwards, but:

If/else activity

While loop activity (cannot overlap)

These aside, cannot go ‘back up’

State machine workflow: Series of ‘states’ e.g: ‘ Awaiting initial review’ ‘ Awaiting final review’ ‘ Completed’ Can go from any state to any state Developer specifies ‘transitions’ between states Key decision #2 – VS workflow type

State machine workflow:

Series of ‘states’ e.g:

‘ Awaiting initial review’

‘ Awaiting final review’

‘ Completed’

Can go from any state to any state

Developer specifies ‘transitions’ between states

InfoPath or custom .aspx forms? Factors: InfoPath forms quicker to develop Much less complexity with InfoPath forms Custom forms must interface with workflow API manually InfoPath forms integrate with Word, Excel etc. However, InfoPath unlikely to be suitable for public website See ‘collect feedback’ sample in MOSS SDK for custom .aspx forms example Key decision #3 – forms

InfoPath or custom .aspx forms?

Factors:

InfoPath forms quicker to develop

Much less complexity with InfoPath forms

Custom forms must interface with workflow API manually

InfoPath forms integrate with Word, Excel etc.

However, InfoPath unlikely to be suitable for public website

See ‘collect feedback’ sample in MOSS SDK for custom .aspx forms example

Item for workflow: expenses form (InfoPath) Process: User submits expense claim Approved by department Approved by finance -> Completed Development process: ‘ ASPX-like’ model Coding Drag activity from toolbox Write code to tell it what to do/what values to use Deploy/test My example – Acme Inc.

Item for workflow: expenses form (InfoPath)

Process:

User submits expense claim

Approved by department

Approved by finance -> Completed

Development process:

‘ ASPX-like’ model

Coding

Drag activity from toolbox

Write code to tell it what to do/what values to use

Deploy/test

Acme expense workflow – first steps demo

We just hit them: #1: Using activities – two ways to set properties: Using code Properties window often used to bind property to a member variable (e.g. our string CurrentLogAction) #2: Deployment MS help us here – PostBuildActions.bat We provide config in Feature files Need to associate workflow with list(s) after each full deployment Complexities #1 and #2

We just hit them:

#1: Using activities – two ways to set properties:

Using code

Properties window

often used to bind property to a member variable (e.g. our string CurrentLogAction)

#2: Deployment

MS help us here – PostBuildActions.bat

We provide config in Feature files

Need to associate workflow with list(s) after each full deployment

How do I get at the information which was entered into the form? Can write code to parse XML e.g. XmlDocument Can use serialization (preferred): Obtain schema (.xsd) for your form Use xsd.exe to generate class Add class to project Add deserialization code to workflow Complexity #3

How do I get at the information which was entered into the form?

Can write code to parse XML e.g. XmlDocument

Can use serialization (preferred):

Obtain schema (.xsd) for your form

Use xsd.exe to generate class

Add class to project

Add deserialization code to workflow

How do I work with SharePoint tasks? CreateTask Set properties in code Set TaskType to 0, 1, 2 etc. to associate task edit form If required, pass values to task form via ExtendedProperties OnTaskChanged In state machine should be in EventDriven activity Collect values from form Copy to field-level vars if another activity needs to use value (e.g. IfElse) CompleteTask No code required, just set CorrelationToken & TaskID Complexity #4

How do I work with SharePoint tasks?

CreateTask

Set properties in code

Set TaskType to 0, 1, 2 etc. to associate task edit form

If required, pass values to task form via ExtendedProperties

OnTaskChanged

In state machine should be in EventDriven activity

Collect values from form

Copy to field-level vars if another activity needs to use value (e.g. IfElse)

CompleteTask

No code required, just set CorrelationToken & TaskID

Always always design in Visio first! Error/bug? Check the SharePoint logs first Learn how to debug workflows - See ‘how-to’ in my starter pack document Always rename activities so the ID makes sense Write to SharePoint logs for simpler diagnostics when live - Article on my blog coming soon Top 5 workflow tips See my starter pack for advanced tips!

Always always design in Visio first!

Error/bug? Check the SharePoint logs first

Learn how to debug workflows - See ‘how-to’ in my starter pack document

Always rename activities so the ID makes sense

Write to SharePoint logs for simpler diagnostics when live

- Article on my blog coming soon

SharePoint has different levels of workflow Key decisions summary: OOTB/SPD workflow may be sufficient Prefer state machine over sequential workflow InfoPath forms simpler than custom ASPX Demo - first stage of an expense claim workflow Being armed with right resources is key! What was he talking about??

SharePoint has different levels of workflow

Key decisions summary:

OOTB/SPD workflow may be sufficient

Prefer state machine over sequential workflow

InfoPath forms simpler than custom ASPX

Demo - first stage of an expense claim workflow

Being armed with right resources is key!

Downloadable resources: http://www.sharepointnutsandbolts.com/2008/01/resources-from-my-workflow-deep-dive.html Blog: www.sharepointnutsandbolts.com LinkedIn: http://www.linkedin.com/in/chrisobrienmvp Thank you Q & A

Add a comment

Related presentations

Related pages

InfoPath 2010 and SharePoint 2010 No-Code Workflow Deep ...

Home » Training » SharePoint Training » InfoPath 2010 and SharePoint 2010 No-Code Workflow Deep Dive. Introduction; Outline; Prerequisites; Materials ...
Read more

Windows Workflow Foundation: Tracking Services Deep Dive

This documentation is archived and is not being maintained. Summary: The Windows Workflow Foundation (WF) tracking infrastructure and services provide the ...
Read more

Deep Dive into the SharePoint Content Deployment and ...

Deep Dive into the SharePoint Content Deployment and ... With SPD workflows you might have to recreate the workflow on the target if really ...
Read more

SharePoint Training | PremierPoint Solutions

Tired of mass-market SharePoint training? Our classes are unique, business-focused and taught by SharePoint consultants!
Read more

SharePoint 2016, Team Collaboration Software Tools

Share, organize, and discover information with Microsoft SharePoint. Learn about SharePoint Online, OneDrive for Business, Yammer, and Apps for SharePoint.
Read more

K2 for SharePoint Deep Dive: Working with Workflow Webinar

K2 smartforms are leveraged extensively in K2 for SharePoint and this webinar covers the details behind that implementation.
Read more

A deep dive into SharePoint storage - SearchWindowsServer

A deep dive into SharePoint storage. by Don Jones. PowerShell.org. ... Here’s a deep dive on how SharePoint storage works. How SQL Server stores data
Read more

Deep Dive Building Blocks and Services of SharePoint ...

Deep Dive Building Blocks and Services of SharePoint. ... Learn why your customers should consider putting a workflow in an app for SharePoint, ...
Read more

Deep Dive into the SharePoint Content Deployment and ...

Deep Dive into the SharePoint Content Deployment and ... dependent objects of a particular list say for example which workflow is being run ...
Read more