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. Do you 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 generate new, edit, and display forms from the Expense Claim list in SharePoint. You 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 claim items. This section is the details 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, in this case, an ID.
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 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 also uses a SmartForm to review the claim and decide how they want to handle the claim. They can approve, reject, or query the claim. 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 to view them and enter comments or questions on a task comments view.
The form used for the Approve Expense Claim task
The finance team uses a SmartForm as well to review and process the claim.
Because the finance processing form and the approve expense claim form are so similar, you use the same SmartForm for both user tasks. You use rules to adjust the behavior of the form, depending the user task. The finance processing team can process or reject the claim.
The form used for the Finance Processing task
The originator also uses a SmartForm to rework the task 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. The originator can resubmit the claim or cancel the claim completely.
The form used for the Rework task
The data component is core to this application. You combine data from several systems into one application. The image below shows the business objects that make up the SmartObjects. 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 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 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.
Two expense claim reporting lists used in this application