As you have learned in other tutorials, it is important to lay out your application design before you begin building. Start with the workflow component. The workflow helps you identify the tasks needed to complete the workflow goal. After you have identified the workflow tasks, think about the forms you need and the users that use the forms. Does your user need to edit content on a form? Is the form better-suited as a read-only interface? What data sources do you need to both retrieve data and store data? Finally, do you need reports? What kind of reports do you need and what format is best for displaying reporting content?
An effective method for laying out the workflow is to create it in a flowchart format. The image below displays the Expense Claim workflow as a swim-lane flowchart. Notice the four lanes. Each lane represents the user or system responsible for the task.
The Expense Claim workflow consists of the following steps:
Expense Claim Workflow Design
This application uses SmartForms for the user interfaces. SmartForms allow greater control over the form layout, behavior, and workflow integration. You will generate new, edit, and display forms from the Expense Claim list in SharePoint. You will also build forms from scratch in K2 Designer. SmartForms allow communication with external data sources, which is not easily configured with standard SharePoint forms.
The Expense Claim application has four forms for the user tasks. Like designing the workflow, sketching the form layout allows you to add notes and adjustments based on the intended use and behavior. You can determine the fields that are necessary and the fields that are not necessary. You can also get a start on the data requirements for the fields. Which fields retrieve content from a data source when the form loads? When the originator submits the form, what data source stores the field values?
The New Expense Claim Form captures and submits a new expense claim for approval. The image below displays the basic layout and behavior of this form.
This form is a classic header/details, or parent/child form. The Expense Claim list in SharePoint stores the header content as one record. This content includes the name, email, department, etc. for the claimant. This is the parent record.
Notice then, at the bottom of the form, is a section where you list the individual expense claims items. This section is the detail or child section. The SmartBox SmartObject stores this content as many records, one record per row. So, the header section is the parent record, and the line items section are the child records. They are bound together by a common property, most likely an ID of some kind.
Looking closer at the line item section, notice that you can attach receipts or invoices to the claim. This section also supports multiple currencies and calculates the USD amount for an expense item.
You will allow users to submit claims on behalf of other users (perhaps a manager's assistant). They can select the approver from a SharePoint group of pre-defined users.
New Expense Claim Form
The approver uses the Approve Expense Claim Form to review the claim, then decides how they want to handle the claim. They can approve it, reject it, or query it. Querying a claim sends it back to the originator for rework. While the approver cannot make changes to the originator's submittal, they can open receipts and view them.
Approve Expense Claim Form
The Finance team uses the Finance Processing Form to review the claim, then process the claim. For simplicity, this tutorial will not cover the detailed steps for finance processing. Understand however, that SmartObject integration can be very useful in interacting with other line-of-business systems.
Because the Finance Processing Form and the Approve Expense Claim Form are so similar, you will use the same SmartForm for both user tasks. You will use rules to adjust the behavior of the form, depending the user task. The finance processing team can process the claim or they can reject the claim.
Finance Processing Form
The originator uses the Rework Form if the approver queries the claim. The rework form displays the approver's comments, along with the original request content. The originator can make any changes needed, including adding, editing, or deleting line items/rows. The originator can resubmit the claim or cancel the claim completely.
Rework Form
The data component is core to this application. You will combine data from several systems into one application. The image below shows the business objects that make up the SmartObjects for the application. Notice that each object has a different data source with lines representing the relationships between the objects.
K2 offers standard reports that are always available for K2 applications. In this tutorial, you will create a new dashboard-style report, using reporting controls found in K2 Designer. With these reports, you can tell at-a-glance the current state of expense claims. The dashboard displays the number of expense claims submitted and the average duration of a claim process. You will include two lists: one for expense claims waiting for approval and one for expense claims waiting for finance processing.
Reports and dashboards can be much more complicated than the sample in this tutorial. The goal is to help you learn the basic principles of using business data along with workflow data to create rich graphical representations of application activity.
Expense Claim Reports