banner



How To Create A Sharepoint 2010 Workflow

All About SharePoint Workflows

I trust that you've been following me in this 101 series on workflow, so welcome to part 3!  Let's see how we got here:

Part 1: Intro and Core Concepts

Part 2: Templates and Using Workflows

Part 3: SharePoint Designer and Creating Workflows (this post)

Part 4: Best Practices and Extending Workflows

I know we haven't done much exciting stuff yet, but that's where we start today.  Today we're going to focus on getting SharePoint Designer going, reviewing the interface for workflow and creating some workflows.  Get ready, this will be a long one!  There's a lot of info to get through, and I give you different steps between 2010 and 2013.

If it hasn't been clear so far, then let me say again that this series is intended to be conceptual in nature.  You will learn the concepts and get started with building workflow.  There are lots of other resources and books that give you exact steps to create business solutions for workflow.  I know you may not have time to read a book, so you can pick up the basics here and use other resources as a reference.

SharePoint Designer

If you want to edit or create any workflow, you will need SharePoint Designer.  What is it?  Glad you asked.  It's a free tool from Microsoft that you must download and install on your computer or server.

First we need to download it.  There have been some patches to it, so when you install, you will need the install the service pack to ensure you have the latest and greatest files.  You will need Designer 2010 if you have SharePoint 2010, and you will need Designer 2013 if you have SharePoint 2013/2016/Online.

As it stands today, Microsoft has stopped making SharePoint Designer.  The 2013 version is expected to be used for all versions post 2010.  You can read more about the basics of SharePoint Designer from Microsoft Office Support.

Download and Install SharePoint Designer

To install, download both files (a base file and a service pack file).  Run the base install first, reboot if it prompts you to, then run the service pack installer and reboot when/if prompted.

You will need to choose either 32-bit or 64-bit installs.  This has to be the same as your version of Office (Word, Excel, etc.).  You can find out more here.

SharePoint Designer 2010 Download Links

  • SharePoint Designer 2010 Base 32-bit
  • SharePoint Designer 2010 Base 64-bit
  • SharePoint Designer 2010 SP2 32-bit
  • SharePoint Designer 2010 SP2 64-bit
  • SharePoint Designer 2010 Post-SP2 Update (October 2015)

SharePoint Designer 2013/2016/Online Download Links

  • SharePoint Designer 2013 Base
  • SharePoint Designer 2013 SP1

Review of the SharePoint Workflow Interface and Action Basics

Now that SharePoint Designer is installed, let's open it up.  The interface and steps for workflow are different between SharePoint 2010 and 2013(2016/Online), so I will list them separately.

On a side note, you can have both versions of SharePoint Designer installed on the same computer.

You need to open the site where you want to create/update workflow.  Click File –> Open, and paste the URL for the site in the box without a library or path:

https://sharepoint.contoso.com/sites/designer/sitepages/home.aspx

In general when working with workflow, from here you will click on the Workflows heading on the left side panel.  When building workflow, it can be as simple as a one-line workflow that sends an email, or it can be 20-stage complex business process – it's up to you.

Let's look at the common workflow building blocks:

  • Events
    • On the main settings page, you have to choose how your workflow is triggered – either automatically when a file uploaded, automatically when a file is edited, or manually.
  • Conditions
    • Conditions are a clause that determine if your workflow will do something (perform an action).  So conditions can be IF, IF ELSE, etc.  There can be multiple conditions or nested conditions.  Typically this is like IF <a column> equals <some value>, do something.
  • Actions
    • Actions are tasks that do something.  They can send an email, set permissions, get a value, set a column value, create items, and many other things.
  • Steps (2010 Workflows)
    • Steps are the containers of conditions and actions.  You group similar conditions and actions into a step, like you would a stage of a process.
    • There are regular steps, and there are Impersonation Steps.  The difference is the context.  When a workflow runs, it executes all conditions/actions as the user who started the workflow.  If you need to do special things like set permissions, and that person doesn't have rights to do that, you can use an Impersonation step.  These steps run as the context of the user who published the workflow (like an admin).
    • You can move existing conditions and actions up and down in the Step via the ribbon buttons (you CANNOT copy/paste actions or conditions)
    • Steps can be nested in other steps, and run in parallel
  • Stages (2013 Workflows)
    • One really cool feature of a 2013 workflow is that Steps were replaced by the concept of a true stage.  At the bottom of a stage, you have the ability to go to another stage, regardless if the stage is before or after the current Stage.  That enables possibilities to re-execute certain actions based on conditions, which is SO useful!
    • You can move existing conditions and actions up and down in the Stage via the ribbon buttons (you CAN copy/paste actions or conditions, VERY useful)
  • Variables
    • Think of variables as temporary storage of values while a workflow is running.  You will variables A LOT, so get used to it.  Let's say you have a workflow that sends an email in 5 different places, and it will be the same person.  You wouldn't manually set email action to the person's name.  If it changed, you have to change it in 5 places.  You would set that person's name to a variable, then use the variable as the send email to.  Then if it changes, just change it once at the variable.  You also will use variables if you're combining text or dates or other things like that.  It's a define once, use many.
    • Variables are available in any step / action / condition in the workflow once defined.

This will take some time to get the hang of, and time playing with it.  Workflow has a ton of context, and that is key to understand to make an efficient and useful workflow.  For example, within a workflow you can access different aspects like:

  • Current Item Fields
  • Workflow Variables and Parameters
  • Workflow Context (i.e. date/time workflow started, who started it, etc.)
  • The associated task or history lists
  • Any other list in the same site as the workflow

From here, things will diverge between SharePoint 2010 and SharePoint 2013.

SharePoint 2010

You will see something like this:

SharePoint Designer Workflows

This will show any existing workflows that you already have and their type (list, reusable, globally reusable, etc.).

Workflow Editor in SharePoint Designer 2010

To get the workflow editor, you will either create a new workflow or open an existing workflow to edit.  For the moment, just keep reading then you can go create your own.

Here's an example of a very simple workflow at the main workflow settings page:

SharePoint 2010 workflow settings page

If I click Edit workflow, we go into the workflow editor which is where you do all your creating/building/editing of what your workflow does:

SharePoint 2010 workflow editor

The ribbon up top has most of the stuff you need, with the editor in the main page area.  This will contain your workflow steps, which contain conditions and actions that are executed in sequence top down.

To Add a Condition or Action to a Workflow

  • Click inside a step, and do one of two things:

To Create and Use a Variable

  • Click the Local Variables ribbon.
  • Then click Add, and give it a name and choose the most relevant type.
  • To use the variable, add the Set Workflow Variable action to the workflow, choose the variable to set, then choose what value it should use (either a value from a field you can choose with the FX button, or manually type something).

From here, you just start taking your process and building conditions and actions that will make it happen.

You can get a list of all available workflow actions for 2010 here with examples.

Creating a SharePoint 2010 List Workflow

To create a list workflow, performing the following steps:

  1. Open the site in SharePoint Designer, and click Workflows.
  2. Click List Workflow from the ribbon, and choose the list or library this should run on.
  3. Give the workflow a name and description (this is useful since you will see it when starting the workflow).  Click Ok.
  4. You have a single empty step (a blank canvas).  Create your variables, conditions and actions as needed.
  5. To save your workflow, click Save.  This allows you to close Designer and come back to work on it later, but does not make it available for use.
  6. When you're ready to go with it, click Publish.

Customize an Existing SharePoint 2010 Reusable OOTB Workflow

So you've tested the provided Approval workflow, and it does most of what you want, but you'd like to tweak it a little.  We can make a copy of it and customize it.

  1. Open the site in SharePoint Designer, and click Workflows.
  2. Right-click on the Approval – SharePoint 2010 workflow under Globally Reusable, and click Copy and Modify.
    Customize an OOTB Reusable 2010 workflow
  3. Give the workflow a new name (and description if desired), and click Ok.
  4. Modify the workflow as needed.
    1. Common modifications might be to change the completion conditions of the approval process, add more or less emails or customize the emails, etc.
  5. Save and Publish when you're ready to use it.

This will just make this template available to be used.  You would complete the Add a workflow steps again, but choose your new workflow by name from the list.

SharePoint 2013

Before I go further, I want to call out that there were some big changes between 2010 and 2013 with workflow.  Some actions were removed, some new ones were added, along with other new capabilities.  You can read more on these changes in the Designer section here.

I would encourage you to check out the changes with Visio too.  It was there in 2010, but was a pain in the rear to use.  Now it works great, and can make building your workflow easier if you like Visio (read more here).

Now, when you open the Workflows section in Designer 2013 you will see something like this:

SharePoint Designer 2013 Workflows

This will show any existing workflows that you already have, their type (list, reusable, globally reusable, etc.) and their platform (2010 or 2013).

Workflow Editor in SharePoint Designer 2013

To get the workflow editor, you will either create a new workflow or open an existing workflow to edit.  For the moment, just keep reading then you can go create your own.

Here's an example of a very simple workflow at the main workflow settings page:

SharePoint 2013 workflow settings page

If I click Edit workflow, we go into the workflow editor which is where you do all your creating/building/editing of what your workflow does:

SharePoint 2013 workflow editor

The ribbon up top has most of the stuff you need, with the editor in the main page area.  This will contain your workflow stages (and steps), which contain conditions and actions that are executed in sequence top down.

To Add a Condition or Action to a SharePoint Workflow

  • Click inside a Stage, and do one of two things:

NOTE: Notice you have Stages AND Steps.  You can nest Steps inside a Stage for organizational purposes.

TIP: To copy and paste an action, just right-click and click Cut/Copy Action, then Paste.  I can't TELL you how much of a time-saver this is.

Copy and paste SharePoint 2013 workflow actions

To Create and Use a Variable in SharePoint Workflow

  • Same as 2010

From here, you just start taking your process and building conditions and actions that will make it happen.

You can get a list of all available workflow actions for 2013 here with examples.  You can see the list of 2010 actions removed from 2013 here.

Creating a SharePoint 2013 List Workflow

To create a 2013 list workflow, performing the following steps:

  1. Open the site in SharePoint Designer, and click Workflows.
  2. Click List Workflow from the ribbon, and choose the list or library this should run on.
  3. Give the workflow a name and description (this is useful since you will see it when starting the workflow).
  4. Choose the workflow platform to use (2010 or 2013).  Click 2013, and click Ok.
  5. You have a single empty stage (a blank canvas).  Create your variables, conditions and actions as needed.SharePoint 2013 end of workflow
    1. I will just add here that since things are stages, there isn't an stop/end workflow action.  What you do is when you're ready to end the workflow, in the Transition to Stage box, type "go to" stage and choose End of workflow.
  6. To save your workflow, click Save.  This allows you to close Designer and come back to work on it later, but does not make it available for use.
  7. When you're ready to go with it, click Publish.

Customize an Existing SharePoint 2010 Reusable OOTB Workflow in 2013

In SharePoint 2013, as I've mentioned you have the ability to run a 2013 workflow or use the old 2010 engine.  In 2013, customizing an existing workflow template (like the Approval) are the same exact steps as in 2010.

Wrap Up

Shew that was a keyboard full!  If you made it this far, congratulations.  I told you there was a lot to cover!

I really hope that gives you the information to be able to get started with workflow.  With this foundational knowledge, you can research the actions, see what they can do, and get busy writing.

In our final installment, I'll give you some best practices with workflow and how you can augment workflows to do even more.  Stay tuned!

How To Create A Sharepoint 2010 Workflow

Source: https://www.c5insight.com/Resources/Blog/tabid/148/entryid/704/sharepoint-workflow-basics-creating-workflows-with-sharepoint-designer.aspx

Posted by: rodriguezmolaing.blogspot.com

0 Response to "How To Create A Sharepoint 2010 Workflow"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel