1 / 43

Developing Workflows with SharePoint Designer

Developing Workflows with SharePoint Designer. David Coe Application Development Consultant Microsoft Corporation. Agenda. What is a workflow? Comparing SPD and VSTS Break it down – SPD Workflows Explain Create Deploy Debug Demo – Approval with a twist. What is a Workflow?.

peregrine
Télécharger la présentation

Developing Workflows with SharePoint Designer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Developing Workflows with SharePoint Designer David Coe Application Development Consultant Microsoft Corporation

  2. Agenda • What is a workflow? • Comparing SPD and VSTS • Break it down – SPD Workflows • Explain • Create • Deploy • Debug • Demo – Approval with a twist

  3. What is a Workflow? • Natural way to organize and run a series of actions that correspond to a work process. • Can include both actions performed by people (“participants”) and actions performed by the workflow • Can be as simple or as complex as your business processes require.

  4. More about Workflow • A series of activities • Think of it as a flow chart

  5. How to Create A Workflow • Visual Studio • SharePoint Designer

  6. Comparing SPD to VSTS VSTS • Code-behind file enables custom code • Workflow can be associated with multiple sites and lists • Workflow files compiled into assembly • Workflow defined as a SharePoint feature • Visual Studio debugging available • Can author both sequential and state workflows SPD • No code-behind file • Workflow is authored against and data-bound to specific list at design time • Association happens when workflow is authored • Workflow modifications are not available • Automatically handles deployment • No step-by-step debugging available • Can author only sequential workflows

  7. And that looks like…

  8. K.I.S.S. • Kan I use SharePoint, sir? • Keep it Simple – use SharePoint Designer • That’s why we’re here

  9. Advantages to SPD workflows • Workflows can be developed and tested rapidly. • Ease of deployment • Security issues are less complex • Can be deployed to servers where administrative policy prohibits custom code assemblies. • Can be created by users with less developer experience, such as Web designers or knowledge workers.

  10. More advantages • Authoring that workflow directly against, and data-binding to, a specific list or document library • Predefined list of workflow activities • No code!

  11. And still more … • Wizard-driven interface to assemble sequential workflows from predefined activities. • Each activity appears as an action, represented by a sentence that contains variables that the user can configure using drop-down menus and look-up dialog boxes. • Users can also select conditions, which are configurable conditional clauses that direct the flow of the workflow.

  12. The trade-offs • Cannot be deployed to multiple lists. It is valid only for the list for which it was created. • Workflow modifications are not available in workflows authored in SharePoint Designer. • You cannot author against a content type in SharePoint Designer.

  13. Where do these things live? • Stored in a site-level document library called Workflows. • Contains a folder for each workflow created with Office SharePoint Designer 2007. The folder contains all the source files necessary for the workflow, including: • The workflow markup (.xoml) file (needed only when the workflow uses conditions). • The workflow rules file. • The workflow configuration file. • Any .aspx forms needed, such as initiation forms or custom task forms.

  14. What makes up a workflow? • Events • Actions • Conditions • Steps

  15. What are Events? • An event is what starts or initiates a workflow • Three events that can start a workflow: • An item is created. • An item is changed. • A workflow participant clicks a start button on the SharePoint site. • Contribute permission required to start

  16. Starting a Workflow • Participant starts manually • Started automatically when a list item is created or changed

  17. demo Creating and Starting a Workflow

  18. What are Actions? • The most basic unit of work in a workflow • Sample out of the box actions: • Create, copy, change, or delete list items (including documents). • Check items in or out. • Send an e-mail message. • Create a task for someone on the Tasks list of your team site. • Collect data from a participant that can be referenced later in the workflow. • Pause or stop the workflow.

  19. More on Actions • A workflow can contain any number of actions. • Actions may performed by the workflow or participants. • In the most basic sense, when you design a workflow, you identify the necessary sequence of actions, and then you assemble that sequence of actions by using the Workflow Designer.

  20. Parallel vs. Serial • When you have more than one action associated with a condition, the actions can be set up to run at the same time (parallel) or one after another (serial). • Serial: • Do this THEN that • Parallel • Do this AND that • Non-deterministic, order not guaranteed • Must be one or the other – not both

  21. demo Actions

  22. What are Conditions? • Rules that apply conditional logic to SharePoint lists and items. • A rule establishes a condition where the workflow performs the associated action only if that condition is true. • Example: • Sends reviewer an e-mail message only if an item is created by a specific person.

  23. Conditions (cont) • You can also add clauses to a condition. • You can associate multiple actions with one condition. • To sum up, a rule is a condition associated with one or more actions: If all clauses in the condition are true, do all the associated actions.

  24. But wait … • You can also create a branch that has no specific condition. • This way, the workflow performs one action if a condition is true and a different action if the condition is false. • Note: Branching in a workflow cannot extend from one step to another. A set of 'Else If' branches is always contained in a single step.

  25. What Conditions Can I Use? • Is created or modified in a specific time span. • Is created or modified by a specific person. • Has a title field that contains specified keywords. • Is a file of a specific type or has a file size in a specific range. (This condition is available only when the workflow is attached to a document library.) • NOTE: An action does not require a condition.

  26. demo Conditions

  27. What are Steps? • Workflows are comprised of one or more steps. • Each step can contain any number of actions and associated conditions. • Steps allow you to group conditions and actions so that one set of rules (conditions and actions) can be evaluated and performed before a second set.

  28. Steps (cont) • Some workflows can be designed either as a sequence of actions within one step, or as a sequence of steps.

  29. Steps (cont) • How you structure your workflow into steps depends on what you want each step to accomplish. The rules in one step are processed to conclusion before going on to the next step. • Group as many rules necessary in the same step to effect the specific action or actions that you want. • IMPORTANT: Steps will keep evaluating until you introduce a pause or stop.

  30. How WF Evaluates Steps • If a step contains only actions and no conditions, the workflow always performs those actions. • If a step has conditional branches, and each branch has a condition, the workflow performs an action only when the condition in one of the branches is satisfied. If no condition in any branch is satisfied, by default the workflow moves to the next step. • If a step has conditional branches, and each branch has a condition except for the last branch, the workflow performs an action only when the condition in one of the branches is satisfied. Else, if no condition is satisfied, the workflow performs the action in the last branch, which has no condition.

  31. demo Steps

  32. Workflow Forms • Forms are used to collect information from workflow participants at predefined times in the workflow, and make it possible for participants to interact with the tasks for that workflow. • Two types of forms • Initiation Form • Custom Task form

  33. Initiation Form • Gathers information from participant when they start the workflow. • Displayed to users when they manually start a workflow on a given SharePoint item. • Users can specify additional parameters or information about the workflow as it applies to the given SharePoint item. • For example, you might use an initiation form to ask who should review a document and by when the review should be completed. • Not all workflows need initiation forms.

  34. Custom Task Forms • Allows workflow participants to interact with tasks in the Tasks list on a SharePoint site. • Allows you to create custom form fields and add them to a custom task form. • The workflow can respond to those changes as specified in the tasks, or look up and evaluate that information in later steps of the workflow.

  35. Customizing Forms • Workflow forms are ASP.NET pages with a Data Form Web Part and a master page applied to it. • These .aspx files are stored on the SharePoint site with the workflow source files. You can open and customize these forms as you would any other .aspx file. • Example: Prompting the user to verify they want to complete a task. • TIP: Watch out for pages that are over written!

  36. Deploying Workflows • Click “Finish” – SPD does the rest. • No custom debugging functionality. • Deleting a workflow authored in SharePoint Designer from a list does not delete the actual source files.

  37. Check the Status of a Workflow • The progress is reported via the browser in the All Items view, or any custom view with the workflow status column display (named after the workflow) • You can also click the item, go to Workflows, and see the history of workflows on the item

  38. Debugging Workflows • No step-through debugging • Use the action “Log to Workflow History List” • Use this action when you want to keep a record of the workflow history for investigating errors or for tracking and repudiation purposes • Creates a list called “Workflow History” • Contains columns for such information as user ID, date, event, and error description.

  39. Modifying Existing Workflows • Click Open Workflow on the File menu or double-click the .xoml file in the Folder List. • When you ‘re-deploy’ the workflow, all previous items will continue to run with their version of the workflow they started with. • To see versions of workflows, go to the list settings, then click on Workflow Settings.

  40. Important Tips • Have a solid understanding of the business process before undertaking designing a workflow for it. This makes life A LOT easier. • Workflows run as the user who initiated the workflow – so if the workflow starts on the creation of a list item, the person who creates the list item is the initiator of the workflow.

  41. More Tips • Workflows may error out when updating a list item • Either have InfoPath form closed • Pause for duration action • Wait for the timer to catch up before continuing

  42. demo Approval with a Twist

  43. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

More Related