SharePoint Saturday Workflow in Action

Preview:

DESCRIPTION

The story for workflow in SharePoint 2010 has changed significantly. This sessions details the new capabilities that allow for business users designing workflows in Visio, through to SharePoint designer improvements and finishing in visual studio.

Citation preview

Workflow in SharePoint 2010

Elaine van BergenArchitectOBS

The Connected EnterpriseWhere workflow fits in

• Collaboration happens in SharePoint People at work Data they make and use

• Workflows to manage it• Two flavours

System – move data inand out of SharePoint

Human – support peoplewith long-running processes

People

Content

Human Workflow Examples

• Managing how people work Document approval & feedback Collaborative reviews & discussions Gathering signatures

• Business logic in action Rules for SharePoint content Applied automatically or on demand “Glue” used to build common business apps

"Whats New" for SharePoint 2010• For the end-user

New targets to run a workflow Visio visualization

• For the power-user Improved nested logic New Task Process designer Customizable OOB workflows

• For the developer Visual Studio 2010 SharePoint tools Workflow Events Pluggable External Data Exchange Services

Windows Workflow Foundation• Workflow engine shipped as part of

the .NET 3.0 Framework

• Model workflows as state machines or sequential steps

• Long-running and stateful

WorkflowRuntime

Workflow

Windows Workflow Foundation

Workflow Services

Scheduler Persistence Tracking Batching

SharePointCRMLOB

Workflow Workflow

Workflow Solution Spectrum

Out-of-Box Workflows

• Ready to use• Common

approval scenarios

Out-of-Box Customization

• Association and initiation settings

• Modify logic in SharePoint Designer

• Design forms in InfoPath

Custom Declarative

• Start from scratch or from existing

• New actions• Task process

framework• More types of

workflows

Custom Activities

• Encapsulate custom code in new action

• Deploy in full or partial trust (as user code)

Custom Non-Declarative

• Import solution into Visual Studio

• Advanced modeling

• Hook up workflow to events

Incr

easi

ng F

uncti

onal

ity

Browser Visual StudioSharePoint Designer

Prototype, Design and DevelopSharePoint 2010 offers new development process

Envision workflows in Visio Import into SharePoint Designer

• Parameterize– Export to Visual Studio 2010

Add code

Visio SPD VS10

Declarative vs. Code-Based Workflows

• Developed with .NET code• Compiled to template assemblies• Packaged as features• Deployed via WSP packages• Added to feature galleries• Activated per-site collection• Versioned like code• Can do all of the work in internal code • and/or call activities

Code-Based Workflows Declarative Workflows• Developed as XOML (eXtensible

Orchestration Markup Language)• JIT compiled and run by a

template assembly provided by SharePoint

• Published to containers (lists, libraries, etc.)

• Versionable like documents (with help)

• Connect activities together, but the activities do the work

A Gartner 2008 survey showed that:• 67% of companies that are "doing BPM" changed

some of their business processes at least twice a year. • 18% needed to make changes on a monthly basis• 10% on a weekly basis and • 4% on a daily basis

Visio to DesignerLive Demonstration

Tool Enhancements

• SharePoint Designer 2010 Big design interface improvements Full screen, more available context data, import/export,

nested logic It’s what we’ve been using for all of the demos so far

• Visio 2010 Allow business analysts to design workflows Provide graphical workflow status (Visio Services)

Declarative workflows• Performance improvements*• InfoPath forms for association, activation, tasks• Reusable workflows

Content types Association columns Promotable to “globally” reusable Out-of-box workflows work this way now

• Site workflows*• Workflows on document sets*• Impersonation steps*• Export to Visual Studio*not just for declarative workflows; also for code-based workflows

Reusable Workflows

• Not tightly coupled to specific lists• Associated with lists or content types• Association columns• Promotable to “globally” reusable• Out-of-box workflows work this way now

SharePoint 2010 Workflow Targets

Site List Item

Site Workflows• Bound to site, not to a list or content type

• Started manually

• Accessible from Site Actions menu Go to View All Site Content to see them

• Perfect for workflows that: Work on groups of content Work mostly on non-SharePoint content

Custom activities• Plug in your own custom activities

Fully trusted deployment model Sandboxed code in the user solution gallery

• Build on top of existing activities OfficeTask exposed in Visual Studio

• Flexibility of custom code, reusable in code-based and declarative workflows alike

New and improved out-of-the-box actions• User profile lookups• Document sets• Declare record• Set permissions• Read/write to external lists• Utility actions• Task Processes

e.g., Office Task Composite activities Design dialogs

How It Works: The “OfficeTask”

Workflow activity Workflow activity

Approval start behavior

Approval in progress

Approval end behavior

Task start behavior Task in progress Task end behavior

For each task… Exit conditions

Example: Expense Reporting

Workflow activity Workflow activity

Check metadata on uploaded

report

Approval in progress

Set status to either Approved or Rejected, and notify submitter

Task start behaviorSend daily

reminders when due date passes

Task end behavior

If anyone rejects, cancel the approval

DesignerLive Demonstration

What’s new in Visual Studio 2010

• Site Workflows• ASP.NET Form Templates• New events• External Data Exchange

Developing Site Level Workflows

• Site Workflows List / Item properties are null No auto-start

Creating ASP.NET Workflow Forms

• Generates the required code

• Updates the elements.xml file

• Available: Association Initiation

Workflow Events

• Events fired during workflow lifetime Started, Completed…

• Scenarios Call sub-workflows and wait for completion Provide more elaborate error handling

• Familiar model for developers

SPWorklowEventReceiver

• Base class for handling workflow events

Register on site / list / content type

public class MyWorkflowEventReceiver : SPWorkflowEventReceiver{ public override void WorkflowStarting( SPWorkflowEventProperties properties) { // your code here base.WorkflowStarting(properties); }}

External Data in SharePoint 2007

SharePoint Data

External Data

Correlated Events

Pluggable EDE Services• Interact with LOB systems

by using custom External Data Exchange services

• Requires low-level understanding of WF layer

• You can write your own events No partial trust

Flow of EventsWorkflo

w

EDE Service

External System

Subscriptions

WorkflowRuntime

Call External Method

Raise Event

WCF Service

External System

Or

Visual StudioLive Demonstration

Question and Answer Time

@laneyvbhttp://laneyvb.blogspot.com

Feedback details

• Connect to the “GUEST” wireless network• Browse to the URL http://10.2.70.199 • At the Cliftons log on screen use these credentials

– User: CSC– Password: 9A4F

• Select “forms authentication” and then log on with the details you were emailed during the week

• If you need a logon or need help, see Brian or Lewis at the front desk

How to do tell us what you think

Thanks for Listening!And Thank You To Our Sponsors!

Recommended