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.
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.
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.
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.