Process Modeling Tutorial

Overview

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

Tutorial Scenario

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.

Create an Application Action

Let's start by using the expenseReportForm interface to create an application action. To do this:

  1. Navigate to the application contents view of the Appian Tutorial application (if needed).
  2. Click expenseReportForm to open the interface.
  3. From the settings menu (gear icon), click Save as…. This will display the Save Interface As form.
  4. Select Application Action at the top.
  5. Enter Submit Expense Report in Action Name.
  6. Click the browse icon to the right of the Folder field, which will display the Pick a Process Model Folder form.
  7. Click New Folder, which will open the Create Folder form.
  8. Enter Expense Mgmt Example in Folder Name.
  9. Click Create. This will return you to the Pick a Process Model Folder form.
  10. Enter Expense Mgmt Example in the Folder field, then select your new folder from the suggestions.
  11. Click OK. This will return you to the Save Interface As form.
  12. Click Save.

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:

  • Creates a new application action
  • Creates a new process model
  • Configures basic process model Properties including the process model name and description
  • Creates any needed Process Variables
  • Maps the interface used as a start form

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 selecting the Monitoring view in Appian Designer or in the Application view.

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:

  1. From your Appian Tutorial application, click Submit Expense Report to open the process model for editing.
  2. Unless you have already set your default modeler view, click Process Designer.
  3. From the File menu, click Properties. Alternatively, you can select the Properties icon Image:Properties_icon.png next to the swimlane icon.
  4. On the General tab, enter ="Expenses Submitted: " & pv!expenseItem in Process Display Name. This adds expense item information to the display name of every process instance.
  5. Click OK to close the Process Model Properties form.
  6. From the File menu, click Save & Publish.

Add a Cancel Flow

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.

  1. Open the Submit Expense Report process model.
  2. From the Palette on the left, under Standard Nodes, expand the Gateways folder.
  3. Drag the XOR object to the canvas between the Start Node and End Node and 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.
  4. Click the label of the new XOR gateway and change it to Cancel?.
  5. From the Palette, under Standard Nodes, expand the Events folder.
  6. Drag an End Event node to the bottom of the Cancel? gateway. A red dot appears indicating that these two nodes will be connected.
  7. Drop the End Event node. The two nodes are now connected.
  8. Rename this node to Cancel End Event.
  9. Double Click on each flow connector leaving the Cancel? node. Add a label of No for the End Node outflow and Yes for the Cancel End Event outflow.

The process model should look like this:

Now let's configure the logic within the Cancel? gateway.

  1. Double-click the Cancel? node.
  2. In the Configure Cancel? form, click the Decision tab.
  3. Click New Condition.
  4. Enter pv!cancel in the expression field.
  5. From the go to dropdown to the right of the expression, click Cancel End Event .
  6. From the go to dropdown to the right of Else if none are TRUE, click End Node.
  7. Click OK.
  8. Save and publish the model.

To test it out, submit the action in Tempo by clicking the Cancel button.

Add an Approval Step with a User Input Node

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 Interface 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:

  1. From the Activities category on the palette, add a User Input Task and connect the nodes as shown below by dragging the new User Input Task node on top of the existing connector with the No label.
    • The logic in the Cancel node is automatically updated so that the User Input Task node is selected for the second go to results.

  1. Change the label of the User Input Task to Approve Expense
  2. On the General tab, change the Task Display Name to ="Approve Expenses for " & user(pp!initiator,"firstName") & " " & user(pp!initiator,"lastName")
    • This gives every expense approval task a display name that includes data about the task, in this case the first and last name of the person who submitted the expense report.
  3. On the Forms tab, in the picker below the Select and Interface radio button, search for and select the expenseReportForm
  4. Select Yes on the Create Node Inputs dialog box
    • This action will take all of the rule inputs from the form and create activity class parameters. These activity class parameters will be mapped in the "value" column of the resulting table.

The forms tab should look like this:

Next, we need to configure the activity class parameters created by importing the rule inputs:

  1. Click on the Data tab of the Configure Approve Expenses properties.
  2. Use the table provided to set the value of each activity class parameter. Access each parameters property by click on the name of the activity class and configuring the right-hand properties.
Name Value Save into Notes
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:

  1. On the Assignment tab, begin typing Process Initiator and then select it from the auto-complete list displayed.
    • We're selecting the process initiator for testing purposes. When you're ready to build your process model, you can configure this input using the supervisor() function.
  2. Click OK to close the Configure Approve Expenses dialog box.
  3. Save and publish the process model.

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:

  1. Select either Approve or Reject and click the Submit button to submit the form.
  2. Navigate to the Monitoring view.
  3. Click on the latest process name to open it in Monitor Mode.
  4. 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 an interface, 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: Interface Recipes to create different interfaces with specific layouts and dynamic behavior

FEEDBACK