This tutorial will help you create your first process model that end users can start as an action. This tutorial is dependent on the completion of the SAIL Tutorial, which created the form needed to complete this tutorial. You will need to be a member of the Process Model Creators group. Contact your system administrator if you are unsure if you belong to this group.
We will start with a simple form where users can input information. Additionally, we will add an approval step for a supervisor to approve the submitted information.
Use the examples provided to understand how to set it up. Then, try it with your own data.
The process model we're creating in this tutorial is for a simple expense management application. We’ll create an action so that users can submit their own expense reports. The form for the expense report will contain a few inputs that are saved into process variables so we can report on them later. Next, we'll add a process flow for if the user cancels their request. Finally, we'll add an approval step for a user to approve the expense report submitted.
Let's start by using the
expenseReportForm interface to create an application action. To do this:
Submit Expense Reportin Action Name.
Expense Mgmt Examplein Folder Name.
Expense Mgmt Examplein the Folder field, then select your new folder from the suggestions.
You have just created a process model for submitting expense reports and made it available in Tempo as an action. This feature essentially does the following:
To test it out, open Tempo and click the Actions tab. You should see Submit Expense Report in the list. You will also notice the Appian Tutorial application added to the left-side of the navigation pane.
Click Submit Expense Report to test it out. You should see the following:
Complete and submit the form.
You can see your process by clicking on your profile picture in the top right of your screen and click Runtime Data. Notice that your url ends with /designer.
To see process data, click the Processes tab. You should see a list of processes.
Notice that the process name is simply Submit Expense Report. As more expense reports are submitted and other application are introduced into this environment, it will become difficult to distinguish processes from each other.
So, let's update the name to include more information about the process instance. To do this:
="Expenses Submitted: " & pv!expenseItemin Process Display Name. This adds expense item information to the display name of every process instance.
Now let's add a cancel flow to the process for when the user clicks Cancel.
We already have all our process variables set up for us. Now we need to add a gateway to redirect the process flow if the user clicks cancel.
End Nodeand drop it on top of the existing connector when the connector turns blue. This indicates that you can add the object to the existing flow.
Cancel?gateway. A red dot appears indicating that these two nodes will be connected.
End Eventnode. The two nodes are now connected.
Cancel End Event.
Cancel?node. Add a label of No for the
End Nodeoutflow and Yes for the
Cancel End Eventoutflow.
The process model should look like this:
Now let's configure the logic within the
pv!cancelin the expression field.
To test it out, submit the action in Tempo by clicking the Cancel button.
Next, let’s add an approval step to the process model and assign it to the process initiator's supervisor. In the approval task, we'll use the same form that the user fills in when starting the process, but we'll mark each input as read-only. We'll also show a radio button where the approver will select whether the expense report should be approved or rejected. In the SAIL Tutorial, we configured the interface to already include this behavior, so we just need to reuse that form here.
Let's add the approval task to our process model:
="Approve Expenses for " & user(pp!initiator,"firstName") & " " & user(pp!initiator,"lastName")
The forms tab should look like this:
Next, we need to configure the activity class parameters created by importing the rule inputs:
|expenseItem||pv!expenseItem||no value||The item name will be display as a read only field. The Approver will not be changing this value, so we don't need to save into any process variable.|
|expenseDate||pv!expenseDate||no value||The expense date will be display as a read only field.,The Approver will not be changing this value, so we don't need to save into any process variable.|
|expenseAmount||pv!expenseAmount||no value||The expense amount will be display as a read only field.,The Approver will not be changing this value, so we don't need to save into any process variable.|
|cancel||no value||no value||Cancel will not be used on this form. Leaving the value and save into fields blank with effectively ignore this activity class parameter|
|comments||pv!comments||no value||The comments will be display as a read only field.,The Approver will not be changing this value, so we don't need to save into any process variable.|
|step||APPROVAL||no value||Setting this activity class parameter's value to "APPROVAL" tells the reusable expenseReportForm to display the appropriate fields|
|approve||no value||pv!approve||Since approval will be decided at this step, we do not need to provide a default value. However, we do need to save into a process variable if we want to use this value later.|
Finally, select a task assignee:
Process Initiatorand then select it from the auto-complete list displayed.
Our process model now contains two steps: one to enter the expenses information as an action, and one to approve the expenses. You can test it out just as you did earlier from the Actions tab by clicking Submit Your Expenses. After submitting the expenses form, click the Tasks tab to view the approval task, and you should see the following:
Select either Approve or Reject and then click the Submit button to submit the form. In the /designer interface, on the Processes tab, click on the latest process name. On the toolbar, click Process Details to review the value of the variables.
Your process model now collects data from users on two forms, allows users to choose from one of two buttons when submitting the form, and validates the number of characters a user adds to the comments field.
All the data each user enters is available for viewing and reporting by accessing the process variables you configured.
As mentioned earlier, by using a SAIL form, you can configure a multitude of other validations, components, and dynamic behavior. To do so, you simply need to update your expenseReportForm interface.
See Also: SAIL Recipes to create different SAIL forms with specific layouts and dynamic behavior