Welcome to KnowledgeLink - The AKG Blog

SharePoint 2010 Workflow Basics - Other Workflow Concepts (Part 3 of 3)

Posted by Sue Hernandez on Fri, Sep 2, 2011 @ 09:09 AM

Other Workflow Concepts

Using SharePoint designer 2010 introduces new functionality you didn’t have in 2007, as well as using some of the same terminology, such as the action of Publishing, or the terms Steps, Conditions, and Actions.

Save vs. Publish

When you save a workflow, you are saving it in draft state, where you can come back to it later, but your users will not be able to use the workflow on the sites.  To use a completed workflow on the site, you simply press the Publish button to make it live.

The workflow will check itself for errors, save the workflow, create any necessary forms needed for the workflow, and then finally publish it to the site.

Else-If Branch

The term Condition as used in SharePoint Designer workflows is like the programming term of an IF statement.  The Else-If branch works just the way it does in programming – it provides a second set of conditions to match against.  For example, to switch logic based on the color chosen, you might enter the following:

If field ‘Color’ equals ‘Red’
     // Perform some actions
Else If field ‘Color’ equals ‘Blue’
     // Perform some actions
     // Perform actions that hit any other color other than Red or Blue

With Else-If branches, you don’t have to use the same comparator twice – i.e. you don’t have to compare different values to the same field:

If field ‘Sub Total’ is greater than or equal to ‘500.00’
     // Perform some actions
Else If field ‘Shipping and Handling’ is greater than ’25.00’
     // Perform some actions
     // Perform actions that hit any other condition than the ones stated

Parallel Block

By default, when you add actions and conditions to the workflow, they are run one after another – in serial.  However, you can use a Parallel Block if you want conditions and actions to run at the same time.

You would use this functionality when you don’t wish for the operation to pause the workflow – for example, when assigning a task.

Impersonation Step

Impersonation Steps are placed in the workflow in the same way that you would place regular steps.  They have conditions and actions within, just the same.  However, the actions within the Impersonation steps will run as if it were the identity of the user who authored the workflow.

CAUTION:  Using this feature gives the users of the workflow rights they wouldn’t normally have.  They may be able to add list items to a list they don’t have rights to, for example.  Use with extreme care.

There are some actions, as you’ve already seen, that only run under the elevated privileges of the Impersonation Step.

Publishing Globally

If you have full control permission at the top-level site on which you are working, you can choose to publish a workflow globally.  Publishing globally places the workflow into the Global workflows catalog, making it reusable on every site within the site collection.

Initiation Form Parameters

There might be times when you wish to ask your user for information that isn’t stored anywhere, or to have your user choose from among several options presented to them, both of which will determine the course of the workflow.  Initiation Forms and their parameters allow you to query the user for that information.

When you click on the Initiation button, you are given the choice to add one or more parameters that are questions you are asking your users.  For each parameter you wish to have, you will type in the name of the parameter, you will choose the type of field it should be (i.e. Text, Number, Date, etc.), and the default value, if any.  You also specify whether each parameter will be allowed to have nothing filled in (“Allow blank values”).

The form that is used to present the questions to the user is automatically created when you publish the form.  If you are running SharePoint Server 2010, then all of the forms that are automatically generated are using InfoPath 2010.  The forms are then later customizable in InfoPath.

Local Variables

Variables give you a place to store values, such as storing information to pass between steps, holding interim calculations, holding item IDs of items you create, etc.  Information held in variables are accessed in the workflow in the same manner that initiation form parameters are accessed – the difference between the two are that variables are internal and not exposed to the users.

You can choose from among the following data types for your variables:

  • Boolean
  • Date/Time
  • Integer
  • List Item ID
  • Number
  • String

Association Columns

Columns (i.e. fields) called association columns can be declared within reusable workflows.  When the workflow is deployed to a list or library, the association columns get added to that list or library as well.

Start Options

The start options are found in the Workflow General Settings page, which can be reached by pressing the Workflow Settings button on the Ribbon.  Start options give you three choices:

  • Whether or not you wish to allow users to start the workflow manually
  • Whether or not to start the workflow automatically every time a new item is created
  • Whether or not to start the workflow automatically every time an item is edited.

Keep in mind, that when you set the workflow to automatically start, no Initiation Form is presented to the user, and if you have any initiation parameters they are set to their default values.



Topics: SharePoint Designer, SharePoint, SharePoint 2010, SharePoint Designer 2010, Workflow