IT tutorials
 
Technology
 

Developing Workflow Applications for Sharepoint 2013 (part 2) - Visio Professional, SharePoint Designer, and Workflow

10/11/2013 9:08:31 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

3. Visio Professional, SharePoint Designer, and Workflow

In SharePoint 2010 the ability to do iterative workflow development was introduced; for example, between a business analyst using Microsoft Visio and a SharePoint power user using SharePoint Designer. Having these two tools (each one more specifically suited to a particular role for a process design participant) enabled a seamless way to divide the labor when creating automated business processes for SharePoint. The business analyst, as the process owner, knowing the organic nature of the process, could use Visio to describe it. The power user, as the SharePoint subject matter expert (SME), could then import the flow, embellish it with the SharePoint-centric nuances and business logic, publish and test it, and return the Visio file for further enhancements by the analyst. This tool support for synergistic process design continues with SharePoint Designer 2013 and Visio Professional 2013, but is enhanced.

As with Visio 2010, Visio Professional 2013 sports a Microsoft SharePoint 2013 Workflow template. This template consists of three stencils: Actions, Conditions, and Components, as shown in Figure 2.

FIGURE 2

image

The Visio shapes in each of these stencils essentially match one-for-one with their counterpart construct in SharePoint Designer 2013. In typical Visio manner you simply drag and drop the shapes you want on the drawing surface and connect them together. What’s important to note here is the Stage Outline button under the Process tab on the ribbon in the SharePoint Workflow group. When you click this button, Visio creates an entirely new page and names it Default Stage Outline. You can see this in your page tabs at the bottom of Visio. The purpose of this view is for the business analyst or someone not familiar with the SharePoint Action constructs. Therefore, the Stage Outline lets him model the process flow using this higher-level view. With this view he uses the Simple Stage shape on the Components stencil and any needed shapes from the Conditions stencil to describe the flow. However, the business analyst’s design experience is not simply limited to the use of the SharePoint-related shapes. It is possible to actually use any shape from any Visio stencil that helps express the intent and requirements of the process. The business analyst therefore uses Visio as if he were creating any other diagram — selecting and using the shapes that best represent what they want to visually convey.

When the business analyst has completed his work, he can save the file, which is now an XML-based structure with the file extension of .vsdx, to any location where the SharePoint subject matter expert can retrieve it.

The SharePoint subject matter expert has a couple options upon notification of the available Visio file. She can open it using Visio, make her additions, and save it again, or she can import the file directly into SPD. Notice that the business analyst does not need to “export” the file as was the practice in SharePoint 2010. SPD 2013 can read the new .vsdx file format natively so no need exists for the .vwi intermediate file format if the diagram is created with Visio 2013. However, SPD can still import Visio 2010 .vwi when needed.

When the Visio document is imported into SPD, the subject matter expert can first check for errors. SharePoint Designer will review the imported file and list any issues found so the SME can resolve them. These can be anything from a line not being connected to a shape, to a Yes or No label missing from a decision, to a shape being used inside the flow that is not a SharePoint workflow shape. The SME can work through each issue until the workflow contains no errors.

One of the really nice new features in SharePoint Designer is that SMEs can now choose to work within two different designer views to build out their workflows. They can use the Visual Designer view, which is Visio embedded in SPD, as shown in Figure 3 (Wow!), or using the Views button in the ribbon, they can toggle to the traditional text-based design view, as shown in Figure 4. This provides maximum flexibility in the workflow design-time experience!

FIGURE 3

image

FIGURE 4

image

Visio and SharePoint Designer are certainly first-class tools to use for collaboratively designing and building your SharePoint workflows. The following Try It Out provides you first-hand practice with these tools where you will first assume the role of a business analyst using Visio 2013 to design the workflow from the business perspective, and then you will assume the role of the SharePoint subject matter expert to complete the workflow by adding the SharePoint-specific configuration details and deploying.


TRY IT OUT: Employee Time card Approval Workflow with Visio and SharePoint Designer
In this exercise you learn the basics for using Visio Pro and SharePoint Designer by building an employee time card approval process. When an employee submits a time card indicating her total hours worked for the week, the workflow performs a calculation to determine whether the employee worked overtime. When overtime hours are present, these hours are updated to a column in the SharePoint list and must be reviewed by the manager for payment approval. If approved, the hours are paid. If rejected, the employee total hours worked for the week will be reset to 40, but the overtime hours will remain recorded on the list, too, and available for Human Resources review. For this Try It Out you will optionally need Visio Professional 2013 (if you will be using the Visual Designer) and SharePoint Designer 2013. You can complete this exercise with the SharePoint Designer Text-based Designer alone.
1. Log in to your Office 365 SharePoint to a site where you can create lists.
2. Click Site Contents in the left navigation bar and click the Add an app icon.
3. Click the Custom List tile. In the Adding Custom List dialog, type Employees and click Create.
4. On the Site Contents page, locate and click the tile for your new Employees list. In the ribbon, click the List tab and click List Settings.
5. Under the Columns section, click the Create column link and for:
  • Column name: EmpID
  • Require that this column contains information: Yes
  • Enforce unique values: Yes
  • Number of decimal places: 0
Click OK, and when prompted to create an index, click Yes.
6. Click the Employees link at the top of the page to return to the Employees list. To add a new item, click the plus sign (+) and create at least three employees. Use the Title column to enter the employee’s first and last name for simplicity and provide each with a unique employee ID number.
7. Click Site Contents in the left navigation bar and click the Add an app icon.
8. Click the Custom List tile. In the Adding Custom List dialog, type Employee Time Card and click Create.
9. On the Site Contents page, locate and click the tile for your new Employee Time Card list. In the ribbon, click the List tab and click List Settings.
10. Under the Columns section, click the Create column link and complete the following fields as indicated (leave the default value unless directed to change it):
  • Column name: Employee Name
  • For the column type: Lookup (information already on this site)
  • Require that this column contains information: Yes
  • Enforce unique values: No
  • Get information from: Employees
  • In this column: Title
  • Add a column to show each of these additional fields: EmpID
Click OK, and when prompted to create an index, click Yes.
11. Click the Create column link and complete the following fields as indicated:
  • Column name: Total Hours
  • For the column type: Number
  • Require that this column contains information: Yes
Click OK.
12. Click the Create column link and enter the following:
  • Column name: Overtime Hours
  • For the column type: Number
Click OK.
13. Click the Employee Time Card link at the top of the page to return to the Employee Time Card list. To add a new item, click the plus sign (+) and create at least one employee time card with the following values:
  • Title: Week of mm/dd-dd/20yy
  • Employee Name: Select an employee from your list
  • Total Hours: 42
  • Overtime Hours: 2
Click Save.
14. With the lists in place, you will now assume the role of the business analyst who will create the Visio workflow for the employee time card process. Open Visio Professional 2013 and select the Microsoft SharePoint 2013 Workflow template. Click Create.
15. As a business analyst, you do not work with the specific SharePoint shapes that describe Actions; you work at a higher process flow level. Click the Process tab in the ribbon and click the Stage Outline icon. You can zoom in on the size of the design surface if you want the Stage shape to be bigger.
16. Visio has placed a default first stage on the design surface; double-click it and type Submit time card.
17. In the Visio Stencils navigation bar, click Components ⇒ SharePoint 2013 Workflow. Drag three Simple Stage shapes onto the design surface, double-click each one individually, and type one of the following Text labels for each:
  • Manager approval
  • Reset total hours
  • Pay employee
18. In the Visio Stencils navigation bar, click Conditions ⇒ SharePoint 2013 Workflow. Drag two “If any value equals value” shapes onto the design surface, double-click each one individually, and type one of the following Text labels for each:
  • Is overtime present?
  • Is overtime approved?
19. Using Figure 5 as a guide lay out your shapes accordingly. Click the Home tab in the ribbon and select the Connector in the Tools groups. To connect one shape to the next, click and hold inside the shape you want to start with and drag into the shape you want to end with. The connector snaps automatically in place. When you have all the connectors in place for all the shapes, you need to label the Yes/No lines exiting the decision shapes. Right-click each line and select the Yes/No label as appropriate for that line.

FIGURE 5

image
20. Save the file to disk with the name, EmployeeTimeCard-BusAnalyst. You will import it into SharePoint Designer. Close Visio.
21. Open SharePoint Designer 2013 and click the Open Site tile. In the Open Site dialog, enter the full URL path to the site collection where you created the Employees and Employee Time Card lists. When the site opens, in the left navigation pane, click Workflows under Site Objects.
22. In the ribbon, click Import from Visio and select Import Visio 2013 Diagram. In the file selection dialog, navigate to your EmployeeTimeCard-BusAnalyst file, select it, and click Open.
23. In the Create Workflow dialog, type Timecard Approval for the Name, and select List Workflow for the Workflow Type and select Employee Time Card for the SharePoint list so your configuration looks like Figure 6. Click OK.

FIGURE 6

image
24. By default, when you import a Visio diagram you will be in the Visual Designer. Also notice that you are still in the high-level view of the business analyst. However, now you are in the role of the power user/SharePoint subject matter expert, so you’ll want to work at the lower level of actually adding specific SharePoint Actions and steps. In the Visual Designer ribbon, click the Generate Workflow Outline icon in the Manage group.
25. In the workflow outline, you can now build out, within each of the blue stage containers, all the logic needed to process that stage. This can include any number of actions, steps, loops, conditions, and so forth. In the SPD Visual Designer view, you do this all just as you would in Visio.
26. Before you configure your workflow, you must first create one variable to hold the overtime hours that the workflow will calculate. In the ribbon, click Local Variables and click Add.
27. In the Edit Variable dialog, type OvertimeHours for the Name and select Number for the Type.
28. In the left navigation bar, click Actions - SharePoint 2013 Workflows. Locate the Do Calculation shape, and drag and drop it on the Submit time card Stage. Hover over the Do Calculation shape and an icon with a gear and curved arrow appears. Hover over it, click the drop-down arrow, and select LeftOperand. A dialog opens so you can configure the calculation.
29. Click the LeftOperand row in the dialog and click the fx button. In the Define Workflow Lookup dialog select the following options:
  • Data source: Current Item
  • Field from source: Total Hours
Click OK.
30. Click the Operator row in the dialog, click the list box drop-down on the right, and select Minus.
31. Click the RightOperand row in the dialog, click the white space on the right side under Minus and type 40.
32. Click the To row in the dialog, click the drop-down arrow on the right side, and select Variable: OvertimeHours. Click OK.
33. In the left navigation bar locate the Set field in current item shape, and drag and drop it on the Submit time card Stage following the Do calculation. Here you want to automatically record in the list the number of overtime hours that were worked by the employee. Hover over the Set field in current item shape, click the drop-down arrow, and select Field.
  • For Field, select Overtime Hours
  • For Value, click fx and select Workflow Variables and Parameters for Data Source
  • For Field from source select Variable: OvertimeHours
Click OK.
34. Hover over the “Is overtime present?” shape, click the drop-down arrow, and select Value. A dialog opens so you can configure the logic for this condition.
35. Click the top Value row in the dialog and click the fx button. In the Define Workflow Lookup dialog, complete the following fields as indicated:
  • Data source: Workflow Variables and Parameters
  • Field from source: Variable: OvertimeHours
Click OK.
36. Click the Operator row in the dialog, click the list box drop-down on the right and select Is greater than.
37. Click the bottom Value row in the dialog, click in the white space on the right side under Is greater than, and type 0. Click OK to close the dialog.
38. In the left navigation panel, click Actions - SharePoint 2013 Workflow. Locate the Start a task process shape and drag and drop it onto the Manager approval Stage.
39. Hover over the Start a task process action and click the down arrow to open the SPD properties. Select Process Settings.
40. In the Start a Task Process dialog perform the following:
a. Click the ellipsis (...) beside Participants. In the Select users dialog, select your login name from the left list. Click the Add>> button to add your name to the left column under Selected User. For simplicity, your login is being made the only approver for this workflow. Click OK.
b. In the Task Title, type: Overtime Approval.
c. In the Description, click the Open editor for body button. In the String Builder dialog, type Please approve the overtime of and be sure to leave a space following the word of.
d. Click the Add or Change Lookup at the bottom of the dialog, and in the Lookup for String dialog, for Data source, select Workflow Variables and Parameters and for the Field from source, select OvertimeHours. Click OK to close the Lookup for String dialog.
e. In the String Builder dialog, following the value just inserted, add a space and type hours for (including a space following) and click the Add or Change Lookup button.
f. In the Lookup for String dialog, for the Data source, select Current Item and for the Field from source, select Employee Name. Click OK to close the Lookup for String dialog.
g. In the String Builder dialog, following the value just inserted, type a period. The fully constructed body of your task item should look like Figure 7.

FIGURE 7

image
h. Click OK to close the String Builder dialog.
i. In the Start a Task Process dialog, click to expand the Task Options. For Completion Criteria select Wait for first response.
j. In the Start a Task Process dialog, click to expand the Outcome Options. For Default Outcome, select Rejected. Click OK to close the Start a Task Process dialog.
41. In the Visual Designer, hover over the “Is overtime approved?” shape, and click the drop-down menu on the SPD properties.
42. Click the top Value row in the dialog and click the fx button. In the Define Workflow Lookup dialog select the following options:
  • Data source: Workflow Variables and Parameters
  • Field from source: Variable: Outcome
Click OK.
43. Click the Operator row in the dialog and click the list box drop-down on the right, and select Equals.
44. Click the bottom Value row and select Approved. Click OK to close the dialog.
45. The last part of the business rule to implement is that when the overtime hours are rejected, then the Total Hours submitted need to be automatically set back to 40. In the left navigation bar locate the Set field in current item shape, and drag and drop it on the Reset total hours Stage. Hover over the Set field in current item shape, click the drop-down arrow, and select Field.
  • For Field: Total Hours
  • For Value: 40
Click OK. Notice that you are not resetting the overtime hours, because you still want to record in the list that overtime was worked, even if it was not approved for payment.
46. To show that you could have done all this in the Text-based Designer, too, in the ribbon click Views and select Text-based Designer. You can use the View option to toggle between these designer options and use the one with which you feel the most comfortable.
47. Look at the top of your designer form and you will see your tab labeled Timecard Approval and a number of subtabs. Click the Timecard Approval subtab to return to the page where you can manage the workflow settings. Under Start Options, select the first two for starting manually and automatically when an item is created.
48. To publish your list workflow, click the Publish button. SPD publishes the workflow to the list, where you can check it out.
49. In Office 365 navigate to your Employee Time Card list. Create a new item using the following values:
  • Title: Week of mm/dd-dd/20yy
  • Employee Name: Select an employee from your list
  • Total Hours: 40
  • Overtime Hours: This value will automatically be calculated
Click Save.
50. Refresh the browser until you see the Timecard Approval status of Pay Employee. Because there was no overtime, no manager approval was required.
51. Create a new item using the following values:
  • Title: Week of mm/dd-dd/20yy
  • Employee Name: Select an employee from your list
  • Total Hours: 44
  • Overtime Hours: This value will automatically be calculated
Click Save.
52. Refresh the browser until you see the Timecard Approval status of Manager approval. Click the Manager approval link. Because you designated your login to be the approver, you can approve/reject the overtime. On the Workflow Status: Timecard Approval page, click the Overtime Approval link in the middle of the page. On the item page for the approval you can see the description text you configured stating the number of hours of overtime calculated and for which employee.
53. Click the Edit Item button in the ribbon, and click Approved. Return to the Employee Time Card list and see that the Timecard Approval status has updated to Pay employee.
54. Create a new item using the following values:
  • Title: Week of mm/dd-dd/20yy
  • Employee Name: Select an employee from your list
  • Total Hours: 48
  • Overtime Hours: This value will automatically be calculated
Click Save.
55. Refresh the browser until you see the Timecard Approval status of Manager approval. Click the Manager approval link. Click the Overtime Approval link in the middle of the page. On the item page for the approval, click the Edit Item button in the ribbon, and click Rejected. Return to the Employee Time Card list and see that the Timecard Approval status has updated to Reset total hours. Your outcomes should be comparable to Figure 8.

FIGURE 8

image
How It Works
In this Try It Out you played the role of two different personas, a business analyst and a SharePoint subject matter expert, each with his or her own set of skills and business acumen that they bring to the workflow building processes. Yet in both roles, you experienced the value of having the Visio and SharePoint Designer tools to design the logic for processing. In Visio you constructed the high-level stages and decisions in the business flow. In SharePoint Designer you drilled down deeper into each stage, configuring the Actions to execute in the workflow engine. Your completed workflow included a calculation, setting a couple column values in the SharePoint list (Total Hours and Overtime Hours), and decision logic. You also saw that some tasks, such as the Start a task process, have rich configuration capabilities for constructing dynamic, data-driven content for the user to see when the workflow runs and presenting the UI for the workflow approver to interact with.
At run time, the workflow started automatically upon a new list item being entered. The workflow then sent an e-mail to the approver(s) and the subject and body of the e-mail contained the same information as the workflow approval/rejection form. The e-mail provided a link directly to the workflow task on SharePoint, making it convenient for the approver to follow through and work with it. Alternatively, as you experienced in the exercise, on the Employee Time Card list page an approver can simply click the link for manager approval on a list item to navigate to the workflow page to approve or reject the overtime hours.

In your business context, whether you will be in the role of both the business analyst and the SharePoint subject matter expert, or if there is truly a division of labor within your organization and each role is performed separately, Visio Professional and SharePoint Designer are the tools of trade for designing and building your business process workflows for SharePoint 2013. As you explore and use these tools more fully you will quickly get a sense for the broad and deep types of workflows these two greatly enhanced tools provide you in this release.

 
Others
 
- Developing Workflow Applications for Sharepoint 2013 (part 1) - The Big New Features for SharePoint Designer
- Windows Small Business Server 2011 : Using the Native Consoles (part 2) - Using Server Manager, Directly Opening Native Consoles
- Windows Small Business Server 2011 : Using the Native Consoles (part 1) - Using the Advanced Mode of the Windows SBS Console
- Windows Small Business Server 2011 : Adding and Removing Roles and Features (part 4) - Adding Features
- Windows Small Business Server 2011 : Adding and Removing Roles and Features (part 3) - Adding and Removing Role Services
- Windows Small Business Server 2011 : Adding and Removing Roles and Features (part 2) - Removing a Role
- Windows Small Business Server 2011 : Adding and Removing Roles and Features (part 1) - Add a Role
- SQL Server 2012 : Data-Tier Applications (part 2) - Deploying a Data-Tier Application
- SQL Server 2012 : Data-Tier Applications (part 1) - Defining a Data-Tier Application
- SQL Server 2012 : Touring SSMS Through the Eyes of a Developer (part 2) - Templates, Debugging in T-SQL
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us