Share Point Designer 2010 Workflows Preview

Preview:

Citation preview

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    1/25

    UNDERSTANDING SHAREPOINT JOURNAL

    Bjrn Christoffer Thorsmhlum Furuknap

    SharePoint Designer2010 Workflows

    Volume 2

    Issue

    2

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    2/25

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    3/25

    Credits

    About the AuthorBjrn Christoffer Thorsmhlum Furuknap is a senior solutions architect,

    published author ofBuilding the SharePoint User Experience, speaker, and

    passionate SharePointaholic. He has been doing software developmentprofessionally since 1993 for small companies as well as multinational

    corporations. He has also been a teacher at a college-level school, teaching

    programming and development to aspiring students, a job that inspired him tobegin teaching what he has learned and learns every day.

    About Understanding SharePoint Journal

    Understanding SharePoint Journal is a periodical published by UnderstandingSharePoint.com. The journalcovers few topics in each issue, focusing to teach a deeper understanding of each topic while showing howto use SharePoint in real-life scenarios.

    You can read more about USP Journal, as well as get other issues and sign up for regular updates,

    discounts, and previews of upcoming issues, athttp://www.understandingsharepoint.com/journal.

    Other Credits

    A great big thanks to Kim Wimpsett for doing the copyedit. The quality of work in this issue is greatlyattributed to her skill. Jon Tobey has also been an invaluable help in writing this issue.

    http://www.understandingsharepoint.com/journalhttp://www.understandingsharepoint.com/journalhttp://www.understandingsharepoint.com/journalhttp://www.understandingsharepoint.com/journal
  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    4/25

    Table of Contents

    Credits....................................................................................... iAbout the Author .............................................................................. iAbout Understanding SharePoint Journal........................................ iOther Credits .................................................................................... i

    Table of Contents ....................................................................... iIntroduction .............................................................................. 4Workflow in a Nutshell .............................................................. 6

    So, What Is a Workflow Anyway? ................................................... 7Sequential and State Machine Workflows ....................................... 8Site and List Workflows ................................................................... 9Workflow Terminology ................................................................... 10

    Actions .................................................................................................... 10Branches ................................................................................................. 10Workflow Step ......................................................................................... 11Variables ................................................................................................. 11Initiation Parameters ............................................................................... 11Workflow Forms ...................................................................................... 11

    Mission Statement ........................................................................ 11What You Will Need ................................................................................ 12Rules of Engagement ............................................................................. 12

    SharePoint Designer Overview .............................................. 14So, What Are SharePoint Designer Workflows? ........................... 15

    List Workflows ......................................................................................... 16Reusable Workflows ............................................................................... 16Site Workflows ........................................................................................ 17

    Get to Know the SharePoint Designer Workflow Designer ........... 17Backstage UI ........................................................................................... 18Task and History Lists ............................................................................ 21

    Workflow Editing ........................................................................... 22Steps and Actions ................................................................................... 23Saving and Publishing ............................................................................ 26

    Your First Workflow ................................................................ 29Notify Administrator ....................................................................... 29

    Setting Up the List................................................................................... 30Play Ball .................................................................................................. 31Authoring ................................................................................................. 32

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    5/25

    Setting Activities ...................................................................................... 32Publish the Workflow .............................................................................. 37

    Forms, Parameters, and Variables ......................................... 44Initiation Form ............................................................................... 44

    Parameters ................................................................................... 46

    Editing Forms .......................................................................................... 49Editing Workflow: Add or Change Lookup .............................................. 53

    Working with Variables .................................................................. 54Renaming Variables................................................................................ 58

    Collecting Data from Users .................................................... 63Collecting Data from Users ........................................................... 63

    A Short Intermission................................................................................ 71Workflow Lookup .......................................................................... 76

    Secondary Lookup .................................................................................. 78Publish and Verify ......................................................................... 80

    Workflow Logic ....................................................................... 83Conditional Branching ................................................................... 83

    Setting Conditions ................................................................................... 84Other Conditions ........................................................................... 91Parallel Blocks .............................................................................. 95

    Adding a Parallel Block ........................................................................... 95Test ......................................................................................................... 97

    Solution Overview ................................................................ 101Preparation ................................................................................. 101

    Create SP Group, Add Members .......................................................... 102Create Student Reports Library .................................................. 102

    Create Basic Content Type ................................................................... 102Solution Outline ........................................................................... 103Site Workflow .............................................................................. 104

    Collect Student Name, Class Name, Facilitator, and Auditor ............... 105Content Type Revisited ........................................................................ 108

    Create the Second Workflow ...................................................... 111Build the Steps First .............................................................................. 112Linking Workflows ................................................................................. 113

    Update List Item to Set Multiple Values at a Time ...................... 114Define User ........................................................................................... 115Getting Approval ................................................................................... 117

    More Content Type Updates ....................................................... 119Set Workflow List Item Properties ............................................... 119

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    6/25

    Adding Feedback and Grades .............................................................. 120Creating the Report Document ................................................... 122

    Preparations .......................................................................................... 123Building the Name String ...................................................................... 126

    Now, Lets Get That Report Created .................................................... 128

    Connecting Workflows in SharePoint .......................................... 129Testing ........................................................................................ 131

    Final Thoughts and Additional Resources ............................ 137Previous USP JournalIssues ............................................... 138

    Volume 1 (SharePoint 2007) ....................................................... 139Volume 2 (SharePoint 2010) ....................................................... 139

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    7/25

    IntroductionAsking the right question at the right time to the right people can trigger a landslide.

    Welcome to the wonderful world of SharePoint Designer workflow. Through thisissue, youll learn much of what you need to become productive as a workflow

    developer using Microsofts latest version of SharePoint Designer.

    If you are a new reader ofUSP Journal, then a second welcome is in order. For

    previous readers, however, you may notice some changes to this issue, and Id like to

    point them out before we go on to the learning. First, this issue has taken a long timeto write. The reason is that in the past few months, I have been very busy starting the

    worlds first SharePoint university, called USPJ Academy. Were still in the Early

    Access period where only a select few students have been enrolled to help us evaluatethe platform and content, but there is still so much work to do that finding time to sit

    down and write is difficult.

    Second, for this issue, I have elicited some outside help in the writing. Jon Tobey

    generously offered to help out to speed things up and has provided invaluable advice

    and content for this issue.

    Third, the entire USP Journal is now part of USPJA Publishing, the publishing arm of

    USPJ Academy. That wont necessarily affect the journal directly beyond the addresschange on the second page, but it does mean that the future of the journal is looking

    brighter than ever.

    I hope you enjoy this issue and that youll get everything you need from it. As always,

    I value your feedback, so please send that tojournal@understandingsharepoint.comifyou have any questions, comments, or suggestions.

    .b

    mailto:journal@understandingsharepoint.commailto:journal@understandingsharepoint.commailto:journal@understandingsharepoint.commailto:journal@understandingsharepoint.com
  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    8/25

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    9/25

    Workflow in a Nutshell

    Understanding the path you walk

    Welcome to one of the most powerful features of SharePoint: workflows. Insidethat small word lies a world of opportunity and perhaps the single most valuable

    piece of technology currently available. Workflows bear the promise of businessprocess optimization beyond the wildest dreams of anyone.

    OK, Ill stop the marketing talk. Were not here to blindly buy into what Microsoftsays; we are here to understand SharePoint and increase our knowledge of

    workflows in SharePoint Designer. By virtue of that alone, we will become all the

    marketing SharePoint requires by showing how great this tool and platform can be.

    Before we can commence any investigation into SharePoint Designer, we need to

    understand some key concepts in workflows.

    Workflows saw a rise in popularity after Microsoft started marketing Windows

    Workflow Foundation as part of the .NET Framework. Released as part of .NET 3.0in 2006, workflows quickly became an important part of business applications even

    for smaller businesses and projects. These days, it seems you cant walk down the

    street without stepping into one or more workflows.

    Chapter

    1

    I C O N K E Y

    Valuable information

    Exercise

    Caution

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    10/25

    Note

    Although initially marketed as WWF, the marketing guys and gals inRedmond got a visit from some really huge and scary men wearing

    funny clothes and masks and sporting names like Hulk Hogan and TheUndertaker and decided that they might as well use the acronym WF.

    Either that or they realized they didnt need the connection to pandasand other threatened species. In any case, I will be using the official

    acronym WF throughout this journal.

    So, What Is a Work flow Anyway?

    Workflows are just what their name implies, flows of work. Think of any process

    where some set of actions is performed, such as buying an item in a store, taking ashower, filing a letter, or even dating someone special. All of these tasks arecomposed of tasks or states where some action or event is expected.

    Lets take a look at one of them, buying an item in a store.

    When you buy an item, you need to do the following:

    Find the correct item.

    Take the item to the counter.

    Receive the price from the attendant.

    Decide between using cash and using a credit card.

    o If using cash:

    Give the appropriate amount to the attendant.

    Receive any change.

    Verify the change.

    Pocket the change.

    o If using a credit card:

    Give the credit card to the attendant.

    Receive the receipt for a signature.

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    11/25

    Verify the amount.

    Sign the receipt.

    Return the receipt to the attendant.

    Put pen in pocket.

    Retrieve the item, and run before the attendant notices the missing pen.

    Dont be fooled. This task may seem simple, but thats only because we do it so

    often it has become routine. Several of these steps require a number of substeps, and

    any failure will need to be handled according to some set of rules.

    A workflow structures such processes into manageable chunks called activities.Each activity performs one or more small operations, such as verifying an amount

    or stealing a pen, and the workflow makes sure that everything is done in order andhandles exceptions to the regular flow.

    Sequential and State Machine Work flows

    Workflows come in two varieties, sequentialworkflows and state machine

    workflows. Although theyre two different terms, the two forms are closely

    connected.

    The simplest form is the sequential workflow in which a series of actions occur in a

    predefined sequence. You can use conditions to branch the workflow, but in the

    end, it is just a matter of going from one end to the other in order. SharePointDesigner workflows are sequential workflows.

    A state machine workflow is a bit more complex, but if you think of state machine

    workflows as collections of sequential workflows, you may find them easier to

    understand. Each state in a state machine is really just a separate sequentialworkflow. Either during or at the end of each such subworkflow, you can enter

    another state and thus trigger a second sequential workflow.

    Another difference is that although a sequential workflow always ends, a state

    machine workflow may keep going indefinitely, at least in theory. Think of the

    workflow to have someone exchange the calendars in an office at the end of theyearunless time itself stops or we stop using calendars, that workflow will keep

    going forever.

    State machine workflows are particularly well-suited for workflows that require

    human interaction. The reason is that humans rarely behave in a strictly sequentialmanner and often jump in another direction than the designer of the workflow

    anticipated.

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    12/25

    State machine workflows can cope with this situation much better than sequential

    workflows because state machines by design encourage jumping between different

    states depending on the outcome of other states.

    Note

    This issue of the journal will deal only with sequential workflows,because SharePoint Designer sadly supports only sequentialworkflows.

    That said, you can simulate a state machine workflow in SharePoint

    Designer by using a repeating workflow and what are known assecondary workflows. Explaining the details of how to do this isbeyond the scope of this issue, and frankly, theyre not recommended

    in a production environment.

    Site and List Workflows

    Another concept you need to understand is the difference between site and list

    workflows.

    Prior to SharePoint 2010, your only option was to create list workflows. List

    workflows run in the context of one list item or library document. For example, you

    may have a document containing an application for a loan, and you would run theworkflow to approve or reject the load in the context of that single document.

    In contrast, a site workflow does not run in the context of any list item or librarydocument. With a site workflow, you are not limited to working with a single item

    or document anymore, but you also lose the document or item context.

    You would use a site workflow when you want to work on multiple items or

    documents, for example, or when you want to work with tasks that do not concernany specific item such as creating a new site. Because site workflows are not

    associated with an particular document or list item, you must manually start them.

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    13/25

    0

    Note

    In theory, you can design a site workflow to find a specific document

    and work with that. In some cases, that may be what you want.

    Sadly, though, although the SharePoint 2010 platform now has rich support for site

    workflows, SharePoint Designer does not. There are no activities to create a newsite, for example. Also, since there are no built-in loops, you wouldnt be able to

    create a workflow to work on all items in a list or library, which would have been

    great.

    Oh, youre confused about the terms activities and loops? Let me give you a quick

    overview of the terminology used in workflows.

    Workflow TerminologyIf you are new to workflows, the terminology can be confusing at best. To help with

    this confusion, I have compiled the following sections, which explain the various

    terms and phrases that comprise the workflow lingo.

    ActionsActions are the individual tasks that a workflow performs during its execution. An

    action can be sending an email, assigning a task to someone, creating a new list

    item, or performing many other tasks.

    Actions or Activities?

    The terms actions and activities refer to the same thingthe individualtasks performed in a workflow. Throughout this issue, I am using the

    term action, but you may encounter the term activity in other

    situations.

    We will examine many of the available actions throughout this issue.

    Branches

    A branch in a SharePoint Designer workflow is an action or set of actions that theworkflow performs if a condition is met. A branch can also have no conditions and

    is then called a default branch.

    The default branch will execute if none of the conditions on other branches is met or

    if there are no branches with conditions at all.

    If multiple conditions are met, the branch defined first in the step will execute.

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    14/25

    1

    Branching will be covered in Chapter 5.

    Workflow StepA workflow step is just that, a step of a workflow. Each step comprises at least one

    branch that again comprises one or more actions. Each step will perform only onebranch and thus only one set of actions.

    You can have as many steps as you like or, rather, as many steps as you need. Imsure there is a limit to the number of steps, but you will need to seriously reconsider

    your design if you ever need a lot of steps.

    VariablesA variable is a named value, for example the price of an item, the number of days

    until Christmas, the name of the manager of a department, and so on. Developers(yes, that means you, because you will be a workflow developer in about 80 pages)

    can use the name of the variables without knowing the underlying value.

    Variables are based on one of five variable types, and the values entered into the

    variables must conform to those types. For example, for a date variable, you need to

    enter a date and not a number.

    Initiation ParametersInitiation parameters are values that the user starting the workflow enters before the

    workflow starts. The initiation parameters are stored in variables so you can access

    the values during the workflow execution.

    We will look more at variables as well as initiation variables in Chapter 2.

    Workflow FormsDuring the execution of a workflow, you might find it necessary to interact with auser, for example to collect data, ask the user to perform a task, or just start the

    workflow. The pages that the users see while interacting are called workflow forms.

    Mission Statement

    Throughout this journal, we will learn about SharePoint Designer workflows. Wewill do so by creating a solution that mimics the grade process at the USPJ

    Academy.

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    15/25

    2

    What You Will NeedThis issue is based on the RTM version of SharePoint 2010, specifically the free

    version of SharePoint called SharePoint Foundation 2010.

    First, you need an up-to-date SharePoint installation. You should make sure you getthe most recent updates as well, because fixes and updates may alter yourexperience.

    Second, you will of course need SharePoint Designer (SPD). SharePoint Designer

    was released free of charge on April 2, 2009, so all you need to do now is download

    and install it. You will find the link to SharePoint Designer 2010 in the sidebar to

    the left.

    Note

    You must use SharePoint Designer 2010 to work with SharePoint2010based sites. You cannot use SharePoint Designer 2007.

    Likewise, you cannot use SPD 2010 with SharePoint 2007 sites,

    although you can have both SPD 2007 and 2010 on your computer if

    you are running the same bit version (32 bits). Note that 2010 installs

    in its own directory, while 2007 installs in the Office directory.

    Third, you should set up a basic Team Site if you want to get the exact results in the

    exercises in this issue. If you do not know how to set up a Team Site, ask your

    SharePoint administrator to give you a site where you can play around. Theworkflows here rely on only a few lists, however, so anywhere you can create new

    lists should suffice.

    Rules of Engagem entTo make sure that we work in a manner that is supportable and that we learn how to

    use SharePoint Designer in an efficient manner, we need to define a set of rules forwhat we will do:

    Wewill use only supportable methods and not harm a single Microsoft-provided file.

    If you modify any file that ships with SharePoint, you will not be able to getsupport for your solution from Microsoft.

    We will use the least amount of effort possible.We are going to learn how to utilize SharePoint Designer, not necessarily

    using the best practice for any given scenario. Expect to add or improve

    error handling and modify text, for instance.

    SharePoint Designer:http://www.microsoft.com/spd

    SharePoint Foundati on

    2010:http://www.understandingsharepoint.com/url/10103

    http://www.microsoft.com/spdhttp://www.microsoft.com/spdhttp://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.microsoft.com/spd
  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    16/25

    3

    We will use SharePoint native techniques whenever possible.We might end up taking a step or two back to solve a problem. That is OK;

    we want to learn to use SharePoint workflows.

    http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103
  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    17/25

    4

    SharePoint Designer

    Overview

    Might as well get going, eh?

    Now that we have a good understanding of what a workflow is, we can move on toexploring how a workflow is implemented in SharePoint Designer.

    In this chapter, Ill give you a brief overview of what SharePoint Designer

    workflows are, and Ill also introduce you to the SharePoint Designer interface so

    you know where to find all the buttons and options you need.

    Perhaps a good starting point is to explain what SPD workflows are not:

    SPD workflows cannot do loops, at least not by default. By loops, I mean aniterative task performed repeatedly, such as modifying all items in a list or

    sending an email to remind people about a task every day.

    SPD workflows have a limited set of activities. It is quite possible to usethese activities to achieve impressive results, but you are still limited morein what you can do than you are in other workflow scenarios, such as Visual

    Studio workflows. For example, you cannot create state machine workflows

    without getting very creative.

    Although you can create new activities to use in SharePoint Designer, thisrequires programming skills or the addition of third-party tools.

    In previous versions of both SharePoint and SharePoint Designer 2007, this list

    included the fact that SharePoint Designer workflows were not reusable. In practice,this meant that you could not move your workflow from a development

    environment to a production environment.

    However, this has now changed. Not only can you reuse your workflow in multiple

    sites and farms, but you can even export your workflow into other tools for further

    refinement.

    Chapter

    2

    http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103
  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    18/25

    5

    None of this may mean much to you, but Ill explain everything throughout this

    issue.

    Lets see what SharePoint Designer workflows are all about.

    So, What Are SharePoint Designer Work flow s?

    An SPD workflow is an easy, cheap, and somewhat limited entry point to workflow

    development.

    Theyre easy, because most end users and administrators can become workflowdevelopers without too much training.

    Theyre cheap, because both SPD and SharePoint are now free. Well, at leasttheyre included in your Windows Server license.

    Theyre also somewhat limited, because of the reasons explained earlier in thischapter.

    The main advantage to SPD workflows, however, is the speed with which you can

    create simple and custom business processes. Creating a workflow in SPD should

    not take too long, because if it does, you are likely making a more complexworkflow than SharePoint Designer is designed to accommodate.

    That speed means youll get a high return on investment. Doing simple tasks in

    SPD can reap huge benefits to a company. For example, as were doing in this

    issue, creating a simple workflow to follow up an order from a customer may lead

    to an increase in customer satisfaction.

    SharePoint Designer workflows are not just limited to SharePoint Designer,however, because you can export your workflows from SharePoint Designer to

    Visio or even Visual Studio. You can even import Visio workflows back into

    SharePoint Designer, regardless of whether you started by exporting a SharePointDesigner workflow to Visio.

    Note

    You can export SPD workflows to Visual Studio to further refine or

    expand your workflow, but once you do, you cannot import theworkflow back into SPD.

    With the new version of SharePoint Designer, you have multiple types ofworkflows. We should take a few moments to talk a bit about each type.

    http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103
  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    19/25

    6

    List Workflow sA list workflow in SPD 2010 is the same type of workflow that was available in

    SPD 2007.

    A list workflow is forever tied to a single list and cannot be reused later. Onceyouve attached a workflow to a list, theres no supported way to change that listaffiliation. However, you can still change the workflow process.

    This also applies to the same list in a different site. You cannot export the workflow

    from one site to another site, effectively killing the reuse of list workflows. Another

    consequence of this is that you have to create all your production workflows in your

    production environment.

    This may or may not pose a problem for you. If what you want is a quick way forbusiness users to solve a problem, designing your workflow in your production

    environment may be just the right thing, although it has implications for testingmission-critical workflows.

    Reusable Workflow sThe reusable workflow addresses the problem of list affiliation. This type ofworkflow, introduced in SharePoint 2010, solves list affiliation by simply not being

    tied to a list at all.

    This seems at least initially like a great solution, and it does offer some more really

    useful options for workflow creation.

    However, SharePoint Designer workflows are declarative in nature. That means

    you declare, during design, what the workflow should do. The problem is that,because the workflow has no idea on what kind of list it will run in, it also cannot

    use any of the columns in any of those lists.

    A-ha! thought the SharePoint Designer development team. Well make the

    workflow affiliate with a content type instead! This is a brilliant idea that allows

    you to connect a workflow to a type of content rather than where that content isstored.

    The brilliance of this approach becomes apparent when your site has structured

    content and you utilize content types for your taxonomy.

    Well cover reusable workflows in the solution in Chapter 8.

    http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103
  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    20/25

    7

    Site Workflow sThe final type of workflow you can create in SharePoint Designer 2010 is a site

    workflow. Again, this is a very good idea that may seem utterly useless at first. I

    mean, why would you want to run workflow on something other than list items and

    documents? After all, isnt the whole purpose of a workflow to have some sort ofdata that behaves in a certain manner?

    Well, you may be right, but there are many situations in which you dont want to

    work directly with a specific piece of data. For example, if you dont have that datayet but require someone to upload or add that data, youd want to run a workflow

    outside the context of a specific item or list.

    In this journal issue, well do just that, and well create a new grade report requested

    by someone. That grade report will be a Word document that doesnt exist when the

    workflow starts.

    Well also cover site workflows in the solution in Chapter 8.

    Note

    The video SharePoint Designer Workflow Types explains more aboutthe various types of workflow as well as some guides on when to use

    which type.

    Lets get down to business and learn by exploring.

    Get to Know the SharePoint Designer Work flow

    Designer

    Before we get into the exercises of the following chapters, I want to show you some

    of the Workflow Designer options that are available for you. (The WorkflowDesigner is your main tool for creating workflows in SPD.) We will explore these

    options in greater detail in the following chapters, so consider this just a tour of

    what is to come.

    Lets start with an overview of SharePoint Designer 2010. As you probably know,

    SharePoint Designer has been free since April 2009, and this also applies to the newversion, SharePoint Designer 2010. You can just download it, and you will be able

    to run it.

    Well, there are some technical requirements, and you also need a site with

    SharePoint 2010, but basically, if you have a computer that meets the minimumspecs and that site, youre good to go without needing to purchase anything extra.

    http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103
  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    21/25

    8

    SPD 2010 comes in two flavors, a 32-bit edition and a 64-bit edition. You may be

    tempted to get the 64-bit edition because, well, higher is better, right? Before you

    do, consider the following.

    If you plan on using both SPD 2007 and SPD 2010 on the same machine, you needthe same edition of both software packages. Because SharePoint Designer 2007 isavailable only in 32-bit edition, that means you must have the 32-bit edition of SPD

    2010 as well.

    Also, your SharePoint Designer 2010 flavor must match the Office version you

    have installed, if you have one. Thus, if you have a 32-bit Office edition installed,

    you also need the 32-bit edition of SPD 2010.

    Regardless which version you choose, install it by following the installation guidethat comes with the package (its really easy; even Spouse mode doesnt apply

    here), and fire up the program once it is installed.

    Backstage UIIf youve worked with SharePoint Designer 2007, you will see that this is actually a

    vastly different interface than you are used to using. One of the things you willnotice is the backstage view that the Office 2010 suite of applications has

    implemented to replace the Office Button from Office 2007, as you can see in

    Figure 1.You will also notice the Ribbon, which is new for Designer 2010.

    FIGURE 1. BACKSTAGE VIEW

    In SharePoint Designer 2010, you will always need to open some kind of site. So,just clickOpen Site, and then enter the URL for your site, which is http://splab/ in

    my case. When you hit Open, SharePoint Designer will connect to the site.

    Although were sort of jumping ahead, there are a couple of things to notice in the

    backstage view. You will recognize some of the options from the Office Button if

    you have ever used the Office 2007 suite of products.

    http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103http://www.understandingsharepoint.com/url/10103
  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    22/25

    9

    You will also see some options that are unique to SharePoint Designer 2010. Most

    of this is for creating new lists, pages, and workflows, which is what were

    interested in. You can also see the various sites, and you will have access to all the

    options you had in SPD 2007.

    Right now, though, just reopen the tab that holds the site to which we connected. InFigure 2, notice that you now have the Ribbon, which creates what Microsoft calls a

    fluid interface. In other words, whatever task youre doing, the available options in

    the Ribbon will change. You have icons to make it easy to see whats going on. Itmight take a bit of time to get used to if youve never worked with the Ribbon, but

    its a nice improvement if you ask me.

    FIGURE 2. SHAREPOINT DESIGNER START SCREEN

    On the left side is navigation listing the various items in your site: lists, libraries, sitepages, assets, content types, and so on. This is also a huge improvement from SPD

    2007 where you only navigated content and not types of items.

    Right now, however, we will focus on the Workflows tab. Click the tab, and youll

    be told that there arent any workflow items yet. In addition, the Ribbon will changeso that we have options for creating new workflows, as shown in Figure 3.

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    23/25

    0

    FIGURE 3. WORKFLOW RIBBON

    As mentioned earlier, we now have three kinds of workflows available: List,Reusable, and Site. In addition, we can import workflows from Visio if you have

    that. Were not going to cover that in this issue, because its an Office product thatyou have to pay for. Well focus on the free stuff here.

    Lets create a Site workflow for giving you an overview of the SharePoint Designer

    workflow capabilities; just hit Site Workflow, and Designer prompts us for thename and description of the workflow. Lets just call this a Test Site workflow. We

    can also add a description.

    These interfaces are more or less the same regardless what type of workflow yourecreating. In the case of a List workflow, youre asked to connect to the list where

    you want to create the workflow. If youre creating a Reusable workflow, youre

    asked what kind of content type, if any, you want to connect this workflow to.

    Note

    If you have worked with SharePoint Designer 2007, you know that itswizard was actually a pop-up modal dialog box that ran on top of the

    rest of SharePoint Designer. In 2010, the entire SharePoint Workflow

    Designer is integrated into the same interface that you use for

    everything else.

    Also note that the various tabs have a breadcrumb underneath. It works like a lot ofother breadcrumbs, but you can also click the sidebar, side or right arrows, buttons,or whatever you want to call them to get quick access to all the other stuff available

    here. Another new thing is that you can actually have multiple workflows open at

    the same time.

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    24/25

    1

    When you add a new workflow, you enter directly into the editor for the workflow,

    but theres a profile page, or a settings page, for the workflow where we change all

    the settings for this workflow. You can access the settings page by clicking the

    name of the workflow in the breadcrumb. We can change the names and description

    here, as well as investigate or configure the task and history lists, change startoptions, and manage forms.

    Note that the settings page looks slightly different between the various types of

    workflows, mainly in the start options.

    You have the common settings that youre used to if youve ever worked with

    SharePoint Designer workflows, and if not, youll see what all of this means as wego along.

    Task and History Lists

    All workflows have a task list, which is where you store the tasks you create forusers. Well be doing that a lot in the workflow that well be building throughoutthis issue. This list is just a normal SharePoint task list, and this knowledge allows

    you to control where you want tasks to appear for your workflows.

    You can, for example, create multiple task lists, and you can have different task lists

    for each of the various workflows that youre creating. You can have one task list

    that is specific to one workflow; you can group them, for example, to put HR tasksin a separate task list; or you can do any kind of combination that you actually want.

    The same thing applies to the History List, which is where you log all the stuffthats going on whenever a workflow changes state for debugging or approval.

    Again, you can select that per workflow, you can have one list for all your

    workflows (which is the default), or you can group them.

    Well go into details on what these lists actually do and how you work with themwhen we look at collecting data from users in Chapter 6. There are some quirks

    there of which you should be aware, but Ill brief you on them when we get to the

    details later in this issue.

    The Start options are on the right side. These options change slightly between the

    various types of workflow. There are two major categories here: an item-basedworkflow, which are the Reusable and List workflows, or the Site workflows,

    which are not based on any list or content types.

    You can start site workflows either manually or automatically as part of some other

    process. If youre using the item-based workflows, however, you have more

    options. You can start the item automatically whenever a new item is created or ischanged; you can, as for the Site workflow, start it manually if you want; and you

    can combine them in whatever way you like.

  • 8/2/2019 Share Point Designer 2010 Workflows Preview

    25/25

    All workflows have various forms used for initiating workflow, getting data from

    users, modifying the workflow, and so on. These forms are basically just plain

    ASP.NET pages.

    That may scare you because ASP.NET is programming thing, and you dont wantto be a programmer, right? You dont need to worry about any of that, though,because, by default, SharePoint Designer will create all these forms for you.

    You will just say I want to initiate this workflow, and SharePoint Designer will

    create an initiation form for you. The same things happen when you create activities

    for collecting data; SharePoint Designer will build a form where users will enter the

    data, and you dont need to know a word of ASP.NET.

    Simple, eh?

    Workflow EditingWhen you want to edit a workflow, click the Edit Workflow link on the settings

    page (its located in the Customization section). This will launch the Workflow

    Designer canvas and give you a single step from which you will build yourworkflow empire. You will also see a blinking yellow-orange cursor bar that

    indicates where SharePoint Designer will add actions and steps as you build.

    You can rename the steps if you want, which makes sense because when the steps

    are called Step 1, Step 2, and so on, there is no context to tell you whats going on.

    To rename them, simply click the title, type whatever you want, and then hit Enter.That has nothing to do with how the workflow actually runs. Its simply so you

    recognize the steps by name. In Figure 4, Ive renamed a step to Initiation Step.

    FIGURE 4. RENAMING STEPS

Recommended