Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding...

32
Hands-On Lab Building Workflow Solutions for SharePoint Online Lab version: 1.0 Last updated: 7/9/2022

Transcript of Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding...

Page 1: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

Hands-On LabBuilding Workflow Solutions for SharePoint Online Lab version: 1.0

Last updated: 5/23/2023

Page 2: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

CONTENTS

OVERVIEW................................................................................................................................................. 3System Requirements..............................................................................................................................3

SETUP........................................................................................................................................................ 3Task 1 – Create SharePoint Site...........................................................................................................3

Task 2 – Create SharePoint Online Site................................................................................................4

Task 3 – Upload Prerequisite Solutions...............................................................................................5

EXERCISE 1: EXPORT WORKFLOW FROM VISIO..................................................................................6Task 1 – Export Workflow from Visio...................................................................................................6

EXERCISE 2: IMPLEMENT WORKFLOW IN SHAREPOINT DESIGNER 2010........................................7Task 1 – Import Visio Workflow into SharePoint Designer 2010.........................................................7

Task 2 – Implement Workflow Logic in SharePoint Designer.............................................................10

Task 3 – Associate the Purchase Request Approval Workflow..........................................................20

Task 4 – Test the Non-Standard Business Purchase Request Approval Workflow.............................22

EXERCISE 3: UPLOAD THE WORKFLOW TO SHAREPOINT ONLINE................................................27Task 1 – Save the Workflow as a Template........................................................................................27

Task 2 – Upload the Template to SharePoint Online.........................................................................28

SUMMARY................................................................................................................................................ 28

Page 3: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

Overview

Lab Time: 1 hour

Lab Folder: C:\%Office365TrainingKit%\Labs\3.1\Before

Lab Overview: Building automated workflows into SharePoint Online solutions allows you to integrate a business process directly into the collaboration tools your customers use every day. The SharePoint Online platform provides an integrated way to design, develop and customize workflows while providing the right tools for each audience.

Visio 2010 can be used by end users to model the overall flow of the business process. SharePoint Designer 2010 can be used by power users and developers to flush out the execution of the workflow. Visual Studio 2010 can be used by developers to create custom workflow actions to integrate the workflow into the overall solution. Each of these tools has its strengths. By combining all three to create a workflow solution, users and developers can work together to automate an organization’s business processes.

In this lab, you will import a workflow diagram of a non-standard purchase request from Visio, similar to what a business user would provide, into SharePoint Designer. Next, you will implement and deploy the workflow to SharePoint Online on premise using SharePoint Designer 2010. Last, you will save the workflow as a template and deploy it to SharePoint Online.

System Requirements

You must have the following items to complete this lab:

SharePoint 2010

SharePoint Designer 2010

Visio 2010

Visual Studio 2010

SharePoint Online

Setup

Task 1 – Create SharePoint Site

In this task, you will create a sub site for this lab in your SharePoint on-premise site.

1. Navigate to your top-level SharePoint site, e.g., http://intranet.contoso.com.

2. From Site Actions, choose New Site.

Page 4: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

3. Choose the Team Site template.

4. Enter Lab03 for the name of the site to create.

a. The site will be created at http://intranet.contoso.com/Lab03.

5. Click Create to create the site.

6. After the site is created, navigate back to the top level site; e.g.: http://intranet.contoso.com.

7. From Site Actions, choose Site Settings.

8. Under the Site Collection Administration section, click Site collection features.

9. Ensure that the SharePoint Server Enterprise Site Collection Features feature is activated.

a. This feature is required for the Visio-based workflow visualization feature.

10. Ensure that the SharePoint Server Publishing Infrastructure feature is activated.

a. This feature creates the appropriate security groups for approval workflows, e.g. the Approvers group.

11. Navigate back to the site you created for this lab; e.g.: http://intranet.contoso.com/Lab03 .

12. From Site Actions, choose Site Settings.

13. Under the Site Actions section, click Manage site features.

14. Activate the SharePoint Server Publishing feature.

Task 2 – Create SharePoint Online Site

In this task, you will create a sub site for this lab in your SharePoint Online site.

1. Navigate to your top-level SharePoint Online site, e.g., https://contoso.sharepoint.com.

2. From Site Actions, choose New Site.

3. Choose the Team Site template.

4. Enter Lab03 for the name of the site to create.

5. Click Create to create the site.

6. After the site is created, navigate back to the top level site; e.g.: https://contoso.sharepoint.com.

7. From Site Actions, choose Site Settings.

8. Under the Site Collection Administration section, click Site collection features.

9. Ensure that the SharePoint Server Enterprise Site Collection Features feature is activated.

a. This feature is required for the Visio-based workflow visualization feature.

Page 5: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

10. Ensure that the SharePoint Server Publishing Infrastructure feature is activated.

a. This feature creates the appropriate security groups for approval workflows, e.g. the Approvers group.

11. Navigate back to the site you created for this lab; e.g.: https://contoso.sharepoint.com/Lab03 .

12. From Site Actions, choose Site Settings.

13. Under the Site Actions section, click Manage site features.

14. Activate the SharePoint Server Publishing feature.

Note: You have to be an administrator on your SharePoint Online website to perform the tasks in this lab, e.g., creating and publishing a SharePoint Designer workflow to the SharePoint Online site.

You will also need an account that is a member of the Approvers group in order to approve workflow items.

Task 3 – Upload Prerequisite Solutions

In this task, you will prepare for the lab by uploading a solution both locally and to SharePoint Online that will create the list you need for the rest of the tasks in this lab.

1. Launch Internet Explorer and navigate to your top-level SharePoint site, for example, http://intranet.contoso.com.

2. Click Site Actions >> Site Settings.

3. Under Galleries, click on the Solutions link to view the site collection’s Solution Gallery.

4. Click on the Solutions tab in the ribbon to view the Upload Solution button.

5. Click the Upload Solution button.

Page 6: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

6. Browse to C:\%Office365TrainingKit%\Labs\3.1\Source\After\Visual Studio\Workflow.Setup.wsp and click Open and OK.

7. In the Solution Gallery – Activate Solution dialog, click the Activate button on the Ribbon to activate the solution.

Note: Activating the solution will close the dialog automatically.

8. Browse to the Lab03 site.

9. Click Site Actions >> Site Settings and under the Site Actions group choose Manage Site Features.

10. Activate the Workflow.Setup Feature1 feature.

11. The Non-Standard Business Purchase Requests list should now be visible in the Quick Launch.

12. Upload the same solution to SharePoint Online by navigating to your top-level SharePoint Online site, e.g., https://contoso.sharepoint.com and performing steps 2-11.

Exercise 1: Export Workflow from Visio

Task 1 – Export Workflow from Visio.

In this task, you open a workflow modeled in Visio and export it as a Visio Workflow Interchange document so that you can import it into SharePoint Designer 2010.

1. Launch Microsoft Visio 2010.

Page 7: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

2. Open the file C:\%Office365TrainingKit%\Labs\3.1\Source\After\Visio\Non-Standard Business Purchase Approval.vsd.

3. The workflow should look like this:

4. Click the Process tab in the Visio ribbon.

5. Click Export to export the workflow into a Visio Workflow Interchange (vwi) document.

6. Save the vwi document to C:\%Office365TrainingKit%\Labs\3.1\Source\Before\Visio as Non-Standard Business Purchase Approval.vwi.

Exercise 2: Implement Workflow in SharePoint Designer 2010

Task 1 – Import Visio Workflow into SharePoint Designer 2010

In this task, you will import the Visio workflow into your SharePoint Online site using SharePoint Designer 2010.

1. Open SharePoint Designer 2010.

2. Click Open Site.

3. In the Open Site dialog, enter the URL of your local SharePoint website, e.g., http://intranet.contoso.com/Lab03.

4. SharePoint Designer will open your SharePoint website and provide a dashboard for navigating its contents.

Page 8: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

5. In the site navigation toolbar, click Workflows to display the list of workflows that are currently available in your SharePoint Online site.

6. Click Workflows on the ribbon, and click Import from Visio.

7. Browse to the vwi file that you exported in the previous exercise, select it, and click Next.

Page 9: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

8. Change the name to Purchase Approval. Choose the type of workflow to import as Reusable Workflow, and select Purchase Request as the content type to attach the workflow to.

Note: Creating the workflow as a reusable workflow will allow you to later associate the workflow with other lists. It also allows you to later export the workflow as a .wsp that can be later deployed to other environments.

9. Click Finish to finish importing the workflow.

10. The workflow is imported into SharePoint Designer and is ready to edit.

Page 10: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

Task 2 – Implement Workflow Logic in SharePoint Designer

In this task, you will implement the Non-Standard Business Purchase Approval workflow logic using SharePoint Designer.

1. Click the text “ID3” in the workflow designer and replace it with “Non-Standard Business Purchase Approval Workflow”.

a. The text “ID3” is the name of the workflow activity; changing it to a more descriptive name is for documentation purposes and helps readability.

Page 11: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

2. In the breadcrumbs near the top of the window, click Non-Standard Business Purchase Approval

3. This screen provides some high-level information about the workflow, as well as options for configuring the workflow, such as setting its start options.

4. Check the “Show workflow visualization on status page” checkbox.

Note: Checking this checkbox allows you to use the Visio document you created in the previous exercise to visually show the state of the workflow and the path that the user takes through the workflow.

5. Make sure the Disable manual start option checkbox is unchecked.

Note: When a workflow is started manually, it allows you to capture information from the user in an InfoPath initiation form. This enables you to collect data from the user that is specific to the workflow and not appropriate to store in the associated list.

If the workflow is set to start automatically when a new item is created, you can’t use an InfoPath initiation form to collect data from the user when the workflow is started.

6. In the Customization section, click Edit workflow.

7. Click the “Approval” link the “Start Approval process on this item with these users” link.

Page 12: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

8. This screen allows you to customize the approval process.

9. In the Task Process ribbon, click Initiation Form Parameters.

10. The Association and Initiation Form Parameters dialog contains a list of parameters that the workflow uses during the initiation and association process.

Page 13: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

11. Click Add to add a new initiation parameter to capture the business rationale of the request from the user.

12. Set the Field name to Business Rationale, and Information type to Multiple lines of text and leave the Collect from parameter during set to Initiation (starting the workflow).

13. Click Next and leave the default value for this parameter as blank.

14. The Business Rationale Initiation form parameter is now visible in the list of initiation and association parameters.

Page 14: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

15. Click OK to close the Association and Initiation Form Parameters.

16. Under Customization, click Return to Workflow.

17. Click the “this item” link on the “Start Approval process on this item with these users” step of the workflow. Choose Current Item from the list to specify that the workflow should execute on the current item in the list.

18. Click the “these users” link on the “Start Approval process on this item with these users” step of the workflow.

19. To designate that the person to whom the task is assigned to must be a member of the Approvers group, click the lookup button to the right of the Participants textbox, search for the Approvers group and add it to the Selected Users list.

Page 15: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

20. In Task Request section of the Select Task Process Participants dialog, select the Title text box and enter Please review this Non-Standard Business Purchase Request to specify the title of the task that is assigned to the user.

21. We would like the business rationale entered by the user requesting the non-standard purchase to appear in the task description assigned to the approver.

22. In the Instructions textbox, enter “Business Rationale: “, and then click the Add or Change Lookup button.

Page 16: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

23. In the dialog, set Data Source to Workflow Variables and Parameters.

24. Set Field from source to Parameters: Business Rationale.

25. Set Return field as to As String and click OK.

26. The assigned task should now appear as follows:

27. Click OK.

The next step in the workflow is to log a message to the history list.

Page 17: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

28. Click the “this message” link in the “then Log this message to the workflow history list” to log a new message in the workflow history list. Later when you open a workflow instance to check on its progress, you will see these messages displayed there.

29. Click the … button to bring up the String Builder dialog.

30. Under Name:, add the text: “New request entered by ” and click the Add or Change Lookup button to add the login name of the user that created the item.

31. For Data source select Current Item, Field from source select Created By and Return field as select Login Name to return the formatted login name.

32. Click OK.

The message that will be logged to the workflow history list should appear as follows:

The workflow up to this point should appear as follows:

You’re now ready to implement the logic for checking if the item was approved and taking the appropriate action.

33. Click the “value” link in the “If value this test value” workflow step to edit the value and click the fx button to open the Define Workflow Lookup dialog.

Page 18: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

34. Under Data source: select Workflow Variables and Parameters and for Field from source: select the Variable: IsItemApproved workflow variable designating if the item was approved.

35. Click OK.

36. In the workflow, click the “this test” link and select “equals”.

37. Click the “value” link and select “Yes”.

The condition should appear as follows:

The next step in the workflow is to email the user when the request has been approved.

38. Click the “these users” link in the “Email these users” step to bring up the Define E-mail Message dialog.

39. In the To box, click the lookup button to open the Select Users dialog.

40. Under Or select from existing Users and Groups:, select User who created current item and click Add >>.

41. Click OK.

42. Set the Subject to “Your request has been approved”.

43. In the body of the email, add the text “Your request for … has been approved”.

44. In the text in the previous step, select … and click the Add or Change Lookup button.

Page 19: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

Use the Current Item data source to pull the Title field and return it formatted as a string.

The email message definition should appear as follows:

45. Click OK.

If the user’s request is rejected by the approver, delete the item from the Non-Standard Business Purchase Requests list.

46. In the Else branch of the condition, in the “Delete item in this list” workflow step click the “this list” link and select Current Item and click OK.

Email the user to let them know that their request has been rejected.

47. In the “Email these users” step, click the “these users” link to bring up the Define E-mail Message dialog.

Create an email message to let the user know that their request was rejected using the same process used above.

Page 20: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

48. Save your changes.

The completed workflow is shown below:

49. On the Workflow tab in the ribbon, click Publish to publish the workflow to your SharePoint site.

SharePoint Designer will validate the workflow and publish it to the Lab03 site.

Task 3 – Associate the Purchase Request Approval Workflow

1. Open your Lab03 site, e.g. http://intranet.contoso.com/Lab03.

2. Open the Non-Standard Business Purchase Requests list from the Quick Launch.

Page 21: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

3. Select List >> Workflow Settings from the ribbon

4. Select Purchase Request from the drop down list and click Add a workflow. Your workflow is now associated with the Non-Standard Business Request list.

5. In the next screen, select the Non-Standard Business Purchase Approval Workflow workflow template name the workflow Non-Standard Business Purchase Approval.

Page 22: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

6. Click Save on the next screen.

Task 4 – Test the Non-Standard Business Purchase Request Approval Workflow

1. Open your site and select the Non-Standard Business Requests list

2. Click the Add new item link to create a new item in the list.

3. Create a new item in the list, for example:

◦ Title: SharePoint Conference

◦ Requested By: << Enter your account here >>

Page 23: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

◦ Description: SharePoint Conference 2010 in Anaheim, CA

◦ Price: 4999

4. Select the newly created item in the list and click Workflows in the ribbon.

5. The workflows screen displays all the workflows that you can start on this list item. Click the Non-Standard Business Purchase Approval workflow to start an instance of the workflow on the list item.

Page 24: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

6. The workflow initiation form appears and prompts the user to enter the business rationale for their request. Enter “I’d like to learn all about SharePoint Online”.

7. Click Start to start the workflow.

8. Select the new item in the list, and then click Workflows in the ribbon to see the status of the workflow. You can now see an instance of the Non-Standard Business Purchase Approval workflow under the Running Workflows section.

9. Click on the workflow instance.

Page 25: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

10. The Workflow Visualization web part uses Silverlight and Visio Services to display a visual state of the workflow and the path that the user is taking through the workflow.

11. The Workflow History section shows items that have been entered automatically into the workflow history list.

12. To approve the workflow, you would typically have to log out and log back in with a user who is a member of the Approvers group. In this case, you are already logged in as an administrator so you can approve the workflow.

13. On the same screen, in the Tasks section, click the title of the approval task.

14. The Workflow Task dialog contains information about the task that was assigned to the Approvers group.

Note the Business Rationale text entered in the workflow initiation form is visible in the Consolidated Comments section.

Page 26: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

15. Click Approve to approve the request.

16. Go back to the Non-Standard Business Purchase Requests list and open the workflows page for the request list item.

You can see the instance of the Non-Standard Business Purchase Approval workflows in the Completed Workflows section.

17. Click on the workflow instance.

18. The workflow visualization is updated to show the path that the user took through the workflow.

The checkmarks on the individual steps denote that the step was executed during the workflow.

Page 27: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

Exercise 3: Upload the Workflow to SharePoint Online

Task 1 – Save the Workflow as a Template

In this task, you use SharePoint Designer to save your completed workflow as a template. This will create a .wsp file, which can be used to move the workflow from a development environment to a test or production environment. You will upload this file to SharePoint Online. The file can also be imported into Visual Studio for developers to investigate how the workflow is assembled.

Note: If you import the .wsp into Visual Studio, you will only be able to import it as a farm solution, which cannot be re-deployed to SharePoint Online.

1. Open SharePoint Designer 2010.

2. Click Open Site.

3. In the Open Site dialog, enter the URL of your local SharePoint website, e.g., http://intranet.contoso.com/Lab03.

4. SharePoint Designer will open your SharePoint website and provide a dashboard for navigating its contents.

5. From the left navigation, select Workflows >> Non-Standard Business Purchase Approval

6. Select Save as Template.

7. The .wsp will be saved to the Site Assets library of your local SharePoint site, e.g., http://intranet.contoso.com/Lab03/SiteAssets.

Page 28: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

8. Open the Site Assets library, select Non-Standard Business Purchase Approval.wsp and click the Preview in Browser icon. You will be prompted to save the file; save the file to the desktop.

Task 2 – Upload the Template to SharePoint Online.

In this task, you will upload the workflow template to SharePoint Online, activate the feature on a site, and associate the workflow with the appropriate content types and list.

1. Navigate to your SharePoint Online root site, e.g., https://contoso.sharepoint.com.

2. Follow the steps 2-11 from Setup >> Task 3 to upload and activate the Non-Standard Business Purchase Approval.wsp solution in the Solution Gallery

3. Browse to your Lab3 site e.g.: https://contoso.sharepoint.com /Lab03

4. Open Site Settings, and choose Manage Site Features.

5. Activate the feature Workflow template "Non-Standard Business Purchase Approval" from web template "Lab03".

6. Follow the steps from Exercise 2 >> Task 3 to associate the workflow above to associate the workflow with the content types and list.

7. The workflow you deployed locally is now deployed to your SharePoint Online site.

8. Follow the steps in Exercise 2 >> Task 4 to test the workflow in SharePoint Online.

Page 29: Building Workflow Solutionsaz12722.vo.msecnd.net/.../labs/lab-3-11-0/Lab.docx · Web viewBuilding Workflow Solutions Description In this lab, you will model a simple workflow in Visio

Summary

In this lab you explored the various options for created workflows for SharePoint Online. You modeled a simple workflow in Visio 2010, and then implemented its logic using SharePoint Designer 2010. You also saw how to capture workflow specific information from the user using workflow initiation parameters. Next, you exported the workflow as a template and deployed it to a SharePoint Online site.