SharePoint Saturday Workflow in Action


Published on

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.

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • This slide introduces all the new things you can do with workflow on SharePoint 2010. This deck first covers what is new for end-users, next are the new features of SharePoint Designer and finally the new capabilities of Visual Studio 2010 will be discussed. New targets – Site workflowsVisio visualization – show the workflow status using Visio services – Visio services supports client site APIs to further customize the experienceImproved nested logic – In the SPD we have now extremely flexible workflow customization engine – note. SPD is sequential workflow engineNew Task Process designer – Improved tools in SPDCustomizable OOB workflows – you can customize the approval workflows etc. by adding new steps etc.Visual Studio 2010 SharePoint tools – Better support for the developers in the VS2010Workflow Events – Events, which are raised as part of the workflow processPluggable External Data Exchange Services – External execution dependent tasks – Workflow is hydrated, until the response from external system is received
  • There have been many improvements in the field of workflow. Of course Site workflows are now supported, but the real excitement lies in the field of tooling, and the support for external data.
  • Creating ASP.NET workflow forms is a complex undertaking. There are many intricate steps you need to take to ensure that your workflow supports the rich features of the SharePoint workflow environment. Many of the settings that a user can configure on any workflow (like whether it will auto-start on change), need to be persisted through code in the workflow form. The new ASP.NET workflow form support in Visual Studio 2010 make creating Association and Initiation forms much easier. Hopefully the extensibility model of Visual Studio 2010 will enable the community to pick up on the Task and Modification forms.
  • Important to note if there are questions about it, is that the events cannot be used to access workflows as they are re-hydrating after being persisted. So you cannot modify any running worklflow instance.
  • SPWorklowEventReceiver is the base class to create workflow events.
  • A core concept of workflow is calling an external system and waiting (with the workflow persisted in a database) for that system to complete its work. When working with external data in a WF workflow it is important to support the concept of correlation. Correlation provides a generic way for allowing the workflow runtime to route incoming calls from external systems to the right workflow that is waiting for that event. SharePoint 2007 only allowed correlation with SharePoint list data. For a workflow to call into an external system and wait for that system to complete its task you need to route through a hidden SharePoint list.
  • SharePoint 2010 now allows for pluggable external data exchange services. An EDE service lies at the core of the WF environment. It is the component that is called by a workflow to reach out into an external system and get a response back. Creating these services is not an easy task though and requires a solid understanding of the SharePoint workflow environment.
  • From the Workflow perspective the flow of events when working with an external system are as follows.The workflow uses an CallExternalMethod activity which calls a method on the EDE Service (routed through the runtime based on .NET interface)The workflow does other thingsThe workflow uses a HandleExternalEvent activity to wait for a response from the external system. It uses the same correlation information as the first step to ensure the right even will be receivedFrom the perspective of the EDE ServiceThe EDE service receives a call from a workflow (method call)The EDE services calls into an external system. It either receives a response immediately or it will receive a response through a different communication channel such as a WCF service hosted in SharePointIt notifies the runtime that the event has arrived, which notifies the workflow (dehydrating it from the database)
  • SharePoint Saturday Workflow in Action

    1. 1. Workflow in SharePoint 2010<br />Elaine van Bergen<br />Architect<br />OBS<br />
    2. 2. The Connected EnterpriseWhere workflow fits in<br />Collaboration happens in SharePoint<br /><ul><li>People at work
    3. 3. Data they make and use</li></ul>Workflows to manage it<br />Two flavours<br /><ul><li>System – move data inand out of SharePoint
    4. 4. Human – support peoplewith long-running processes</li></li></ul><li>Human Workflow Examples<br /><ul><li>Managing how people work
    5. 5. Document approval & feedback
    6. 6. Collaborative reviews & discussions
    7. 7. Gathering signatures
    8. 8. Business logic in action
    9. 9. Rules for SharePoint content
    10. 10. Applied automatically or on demand
    11. 11. “Glue” used to build common business apps</li></li></ul><li>"Whats New" for SharePoint 2010<br />For the end-user<br /><ul><li>New targets to run a workflow
    12. 12. Visio visualization</li></ul>For the power-user<br /><ul><li>Improved nested logic
    13. 13. New Task Process designer
    14. 14. Customizable OOB workflows</li></ul>For the developer<br /><ul><li>Visual Studio 2010 SharePoint tools
    15. 15. Workflow Events
    16. 16. Pluggable External Data Exchange Services</li></li></ul><li>Windows Workflow Foundation<br />Workflow engine shipped as part of the .NET 3.0 Framework<br />Model workflows as state machines or sequential steps<br />Long-running and stateful<br />
    17. 17. Windows Workflow Foundation<br />Workflow Services<br />SharePoint<br />CRM<br />LOB<br />Workflow<br />Workflow<br />Workflow<br />WorkflowRuntime<br />Scheduler<br />Persistence<br />Batching<br />Tracking<br />
    18. 18. Workflow Solution Spectrum<br />Increasing Functionality<br />Browser<br />SharePoint Designer<br />Visual Studio<br />
    19. 19. Prototype, Design and DevelopSharePoint 2010 offers new development process<br /><ul><li>Envision workflows in Visio
    20. 20. Import into SharePoint Designer</li></ul>Parameterize<br />Export to Visual Studio 2010<br /><ul><li>Add code</li></li></ul><li>Declarative vs. Code-Based Workflows<br />Developed with .NET code<br />Compiled to template assemblies<br />Packaged as features<br />Deployed via WSP packages<br />Added to feature galleries<br />Activated per-site collection<br />Versioned like code<br />Can do all of the work in internal code <br />and/or call activities<br />Code-Based Workflows Declarative Workflows<br />Developed as XOML (eXtensible Orchestration Markup Language)<br />JIT compiled and run by a template assembly provided by SharePoint<br />Published to containers (lists, libraries, etc.)<br />Versionable like documents (with help)<br />Connect activities together, but the activities do the work<br />
    21. 21. A Gartner 2008 survey showed that:<br /><ul><li>67% of companies that are "doing BPM" changed some of their business processes at least twice a year.
    22. 22. 18% needed to make changes on a monthly basis
    23. 23. 10% on a weekly basis and
    24. 24. 4% on a daily basis</li></li></ul><li>Visio to Designer<br />Live Demonstration<br />
    25. 25. Tool Enhancements<br />SharePoint Designer 2010<br /><ul><li>Big design interface improvements
    26. 26. Full screen, more available context data, import/export, nested logic
    27. 27. It’s what we’ve been using for all of the demos so far</li></ul>Visio 2010<br /><ul><li>Allow business analysts to design workflows
    28. 28. Provide graphical workflow status (Visio Services)</li></li></ul><li>Declarative workflows<br /><ul><li>Performance improvements*
    29. 29. InfoPath forms for association, activation, tasks
    30. 30. Reusable workflows
    31. 31. Content types
    32. 32. Association columns
    33. 33. Promotable to “globally” reusable
    34. 34. Out-of-box workflows work this way now
    35. 35. Site workflows*
    36. 36. Workflows on document sets*
    37. 37. Impersonation steps*
    38. 38. Export to Visual Studio</li></ul>*not just for declarative workflows; also for code-based workflows<br />
    39. 39. Reusable Workflows<br /><ul><li>Not tightly coupled to specific lists
    40. 40. Associated with lists or content types
    41. 41. Association columns
    42. 42. Promotable to “globally” reusable
    43. 43. Out-of-box workflows work this way now</li></li></ul><li>SharePoint 2010 Workflow Targets<br />Site<br />List Item<br />
    44. 44. Site Workflows<br />Bound to site, not to a list or content type<br />Started manually <br />Accessible from Site Actions menu<br /><ul><li>Go to View All Site Content to see them</li></ul>Perfect for workflows that:<br /><ul><li>Work on groups of content
    45. 45. Work mostly on non-SharePoint content</li></li></ul><li>Custom activities<br />Plug in your own custom activities<br /><ul><li>Fully trusted deployment model
    46. 46. Sandboxed code in the user solution gallery</li></ul>Build on top of existing activities<br /><ul><li>OfficeTask exposed in Visual Studio</li></ul>Flexibility of custom code, reusable in code-based and declarative workflows alike<br />
    47. 47. New and improved out-of-the-box actions<br />User profile lookups<br />Document sets<br />Declare record<br />Set permissions<br />Read/write to external lists<br />Utility actions<br />Task Processes<br /><ul><li>e.g., Office Task
    48. 48. Composite activities
    49. 49. Design dialogs</li></li></ul><li>How It Works: The “OfficeTask”<br />Workflow activity<br />Workflow activity<br />Approval start behavior<br />Approval in progress<br />Approval end behavior<br />For each task…<br />Exit conditions<br />Task start behavior<br />Task in progress<br />Task end behavior<br />
    50. 50. Example: Expense Reporting<br />Workflow activity<br />Workflow activity<br />Check metadata on uploaded report<br />Approval in progress<br />Set status to either Approved or Rejected, and notify submitter<br />If anyone rejects, cancel the approval<br />Task start behavior<br />Send daily reminders when due date passes<br />Task end behavior<br />
    51. 51. Designer<br />Live Demonstration<br />
    52. 52. What’s new in Visual Studio 2010<br />Site Workflows<br />ASP.NET Form Templates<br />New events<br />External Data Exchange<br />
    53. 53. Developing Site Level Workflows<br />Site Workflows <br /><ul><li>List / Item properties are null
    54. 54. No auto-start</li></li></ul><li>Creating ASP.NET Workflow Forms<br />Generates the required code<br />Updates the elements.xml file<br />Available:<br /><ul><li>Association
    55. 55. Initiation</li></li></ul><li>Workflow Events<br />Events fired during workflow lifetime<br /><ul><li>Started, Completed…</li></ul>Scenarios<br /><ul><li>Call sub-workflows and wait for completion
    56. 56. Provide more elaborate error handling</li></ul>Familiar model for developers<br />
    57. 57. SPWorklowEventReceiver<br />public class MyWorkflowEventReceiver<br /> : SPWorkflowEventReceiver<br />{<br />public override void WorkflowStarting(<br />SPWorkflowEventProperties properties)<br /> {<br />// your code here<br />base.WorkflowStarting(properties);<br />}<br />}<br />Base class for handling workflow events<br />Register on site / list / content type<br />
    58. 58. External Data in SharePoint 2007<br />External Data<br />SharePoint Data<br />Correlated Events<br />
    59. 59. Pluggable EDE Services<br />Interact with LOB systems by using custom External Data Exchange services<br />Requires low-level understanding of WF layer<br />You can write your own events<br /><ul><li>No partial trust</li></li></ul><li>Flow of Events<br />Workflow<br />Call External Method<br />WorkflowRuntime<br />Raise Event<br />External System<br />EDE Service<br />Or<br />Subscriptions<br />External System<br />WCF Service<br />
    60. 60. Visual Studio<br />Live Demonstration<br />
    61. 61. Question and Answer Time<br />@laneyvb<br /><br />
    62. 62. Feedback details<br />Connect to the “GUEST” wireless network<br />Browse to the URL<br />At the Cliftons log on screen use these credentials<br />User: CSC<br />Password: 9A4F<br />Select “forms authentication” and then log on with the details you were emailed during the week<br />If you need a logon or need help, see Brian or Lewis at the front desk<br />How to do tell us what you think<br />
    63. 63. Thanks for Listening!<br />And Thank You To Our Sponsors!<br />