- List workflow - These workflows are directly associated with a list. This was only type of workflow supported by SPD 2007.
- Reusable workflow - These workflows can be associated with many lists or libraries or content types, and can be reused throughout your Sharepoint sites as needed.
- Site workflow - These workflows are not associated with a specific list or content type.
Workflow Designer
The Workflow Designer provides a visual representation of the declarative workflow, separated into the various steps, conditions, and actions. With the designer open, clicking on the Step button in the Ribbon adds a new step to which conditions and actions can be added:
- Conditions - These are the rules that are used to drive the workflow. If a condition is true, then whatever is contained within the conditional block will be processed. if a condition is not true, then the workflow will move along to the next condition, assuming there is another one. Clicking the Condition button in he Ribbon will display the complete list of available conditions.
- Actions - These are statements that perform a specific activity, such as sending an e-mail or modifying a field. Clicking the Actions button in the Ribbon will display the complete list of actions available for use in workflows.
- Open your site in SPD and click Lists and Libraries in the navigation pane on the left.
- Click the Custom List button in the Ribbon to create a new list called Employee Review with the following fields:
- Rename Title to Employee
- Manager: Single line of text
- Rating: Single line of test
- Comments: Multiple lines of text - After all of the fields have been added click the save button to save the changes to the list.
- Click the Workflows link in the navigation pane on the left.
- Next from the Ribbon, click the Site Workflow button to create a new workflow.
- Name the workflow Employee Reviews and click OK. The Workflow Designer for the new workflow will automatically open.
- With the Workflow Designer open, you should see a blinking horizontal orange line, which is used to indicate where the next action or condition will be inserted. But before you add any steps to your workflow, from the Ribbon, click the Initiation Form Parameters button. This allows you to define parameters that are used to collect data when the workflow is started. In this case you want the user to fill out the form and then use the information that was entered throughout the workflow.
- From the Association and Initiation Form Parameters dialog, click the Add button.
- Name the field Rating, choose Choice as the Information type, and click Next. On the Column Settings screen, enter the values and click Finish.
- Press the Add button to add another field. Name this field Comments, set it as Multiple lines of text, and click Next and the Finish. Click OK button from the Association and Initiation screen.
- The Workflow Designer should open and there should be a horizontal, orange blinking cursor in a box titled Step 1. From the Ribbon, click the Action button and then click Lookup Manager of a User. Optionally, instead of clicking the Actions button, you can start typing and SPD will try to figure out what you want it to do.
- A description of the action will be added to step 1. Click the link that says "this user" to specify whose manager will be looked up. The Select Users dialog will open. Select Workflow Lookup for a User and click the Add button. The Lookup dialog will display.
- In the Lookup dialog, set the following options:
- Data source: Workflow Context
- Field from source: Initiator
- Return field as: Login Name
- Click just below the action that was just completed but still within the Step 1 box. The orange cursor should show where the next action will be added. Click the Action Button again in the Ribbon and select Create List Item.
- In the new action, click the "this list" link.Select Employee Review. Click the Employee field and then click the Modify button to specify the values for this field. In step 9 and 10 you defined the values to be entered by the user. Because the name of the employee doing the review is the same as the person starting the workflow, you can get that automatically.
- Click the function button and set the following values in the Lookup dialog:
- Data source: Workflow Context
- Field from source: Initiator
- Return Field as: Display Name
- Repeat the same steps described in step 15 for the Rating field, but select the following values for the lookup:
- Data source: Workflow Variables and Parameters
- Field from source: Parameter: Rating
- Return field as: As String
- From the Create New List Item dialog window, click Add and choose the Manager field. Press the function button as described previously. Set the following values for the lookup:
- Data source: Workflow Variable and Parameters
- Field from source: Variable: Manager
- Return field as: Display Name
- Click ADD and choose the Comments field. Click the function button and set the following values for the lookup:
- Data source: Workflow Variables and Parameters
- Field from source: Parameter: Comments
- Return field as: As String
- With the Workflow Designer open, click the Action button in the Ribbon and select Assign a to-do item.
- Click the link for "a to-do item" and the Custom Task Wizard will open. Click next. On the second page of the wizard, enter Employee Review in the Name field and click Finish.
- Next, from the Workflow Designer click the "these users" link in the create to-do item action that you've been editing. From the Select Users dialog, click Workflow Lookup for a User, and then click Add. The Lookup for Person or Group dialog window will open.
Set the following values for the lookup in the top section of the window:
- Data source: User Profles
- Field from source: Manager
- Return field as: Login Name
- For the fields at the bottom of the Lookup for Person or Group dialog window, for the Field value choose Account Name from the drop-down. Next press the function button to the right of the Value field. In the dialog that opens, set the fields as follows:
- Data source: Workflow Context
- Field from source: Initiator
- Return field as: Login Name
Similar to step 13, the name of the manager is being returned, but in this case it is for the purpose of assigning a task to the manager, which is why the Login Name is used as the return field.
- Press OK on all the dialogs to accept the chanegs.
- The Workflow is now complete. From the Ribbon, click the Save button. Before the workflow can be used, it must first be published. To do so, click the Publish button in the Ribbon.
- TO try the site workflow, go back to your site and click Site Actions --> View All Site Content. At the top of the page, click the Site Workflow link.
- Click the Employee Review link which will open the page where you can fill out the form to start the workflow. Fill out the form and press Start. To make this form easier to access, you can copy the form's URL and create a link directly to the form.
- If you go back to Employee Review list, you'll see that a new item has been created, the manager has been successfully looked up, and the information entered into the form has been added. A task should have also been created for the manager, which you can see by clicking Site Actions ---> View All Site Content then clicking on the Site Workflows link.