Process Modeling Tutorial

Overview

This tutorial will help you create your first process model that end users can start as an action. After you have created your process model, you will use this process model to create a record type with your process model as its source. 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 and a record type for users to view the expense report. 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. For the last step of setting up your process model, we'll add an approval step for a user to approve the expense report submitted. Once your process model is complete, we'll quickly walk through how to create an expense reports record type with your process model as its source.

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

Create a process-backed record type

Now that you have the Submit Expenses process model completed, we'll be using it to create a record type of expense reports.

To create the record type:

  1. Go to the application contents view of the Appian Tutorial application.
  2. From the New dropdown menu, select Record Type.
  3. In Name, enter Expense Report. In Plural Name, Expense Reports will auto-populate.
  4. In Description, enter List of expense reports.
  5. Click Create.
  6. In Record Type Security, select Viewer as the default.
  7. Click Add Users or Groups, enter AT_Administrators, and select Administrator.
  8. Click SAVE.

After the Expense Report record type opens, we need to choose our data source.

To select a source:

  1. On the Data Model page, click TELL US ABOUT YOUR DATA.
  2. For CHOOSE SOURCE TYPE, select Process.
  3. Click NEXT.
  4. For CHOOSE PROCESS MODEL, select Search and enter Submit Expense Report to choose your process model.
  5. Click FINISH.
  6. Click SAVE CHANGES.

Configure the record list

To configure the record list:

  1. In the left navigation menu in your record type, click List.
  2. For Style, select Feed.
  3. Click Edit List.
  4. In the List View expression editor enter the following expression:
    • Note: Record type field references are unique to each record type and environment. The reference here is only an example and will have to be changed to reference your record type.
      1
      2
      3
      
       a!listViewItem(
        title: rv!record[recordType!Expense Report.fields.expenseItem]
       )
      
  5. For Sort Field, select expenseDate.
  6. For Sort Order, select Descending
  7. Click CREATE.

Create a summary view interface

Now we're going to create a summary view interface for our record type. This view will display the information of each expense report record.

To create a summary view:

  1. From the New dropdown menu, select Interface.
  2. In Name, enter expenseReportSummary.
  3. Click Create.
  4. Copy and paste this expression into EXPRESSION MODE.
    • Note: Record type field references are unique to each record type and environment. The references here are only an example and will have to be changed to reference your record type.
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      
      {
      a!textField(
       label: "Requester",
       labelPosition: "ADJACENT",
       value: user(ri!expenseReport[recordType!Expense Report.fields.pp.initiator], "firstName") & " " & user(ri!expenseReport[recordType!Expense Report.fields.pp.initiator], "lastName"),
       readOnly: true
       ),
       a!textField(
      label: "Amount",
      labelPosition: "ADJACENT",
      value: ri!expenseReport[recordType!Expense Report.fields.amount],
      readOnly: true
       ),
       a!textField(
      label: "Date",
      labelPosition: "ADJACENT",
      value: ri!expenseReport[recordType!Expense Report.fields.date],
      readOnly: true
       )
      }
      
    • There will be an error since you haven't yet created rule inputs.
  5. In the right panel under RULE INPUTS, add a rule input.
  6. In Name, enter expenseReport.
  7. For Type, select your Expense Report record type.
  8. Click OK.
  9. Click EXPRESSION MODE and replace the example record type field references with references to your record type everywhere that the rule input is used.
  10. Click SAVE CHANGES.

You will be unable to view the interface right now because the null value for the user function shows as an error. Don't worry, you set it up correctly! You'll be able to see the summary view once it is added to the record type.

Add a summary view

With the view's interface created, it's time to add the interface to the record type as a summary view.

To add a summary view to the record type:

  1. Open the record type.
  2. In the left navigation menu, click Views.
  3. Click the view named Summary.
  4. In Interface, call your summary view interface using rule!expenseReportSummary().
  5. Inside the summary view rule, add a parameter label for the interface's rule input named expenseReport:.
  6. Then enter rv!record to call each records' data into the rule input.
    • Your completed expression should look like this: rule!expenseSumarryView(expenseReport:rv!record)
  7. Click OK.
  8. Click SAVE CHANGES before leaving your record type.

Test your record type

You have just created a record for each process instance of the Submit Expenses process model.

If you go the record list view in Tempo, you might not see any expense reports listed. This is because you currently don't have any instances of the process. Let's add one and take a look at the result.

Start an instance of the Submit Expenses process with the following values:

  • In Expense Item, enter Plane ticket to St. Louis.
  • In Expense Amount, enter 200.
  • In Expense Date, enter 4/16/2013.
  • In Comments, enter Flights are expensive.

In Tempo, select the Records tab, and click Expense Reports.

You should see the following:

Select the "Plane ticket to St. Louis" record.

You should see the following:

In the summary view interface, you'll notice that we used record type field reference to access process variables. For record types with process models as their source, you can access process variables, process properties, and process model properties as record fields using record type field references.

Only certain process and process model properties are available for use in interfaces. Besides that, you can change this record view design as you would any other interface.

For more information on referencing process and process model properties, see Referencing record fields and field values.

When working with record types that use a process as their source, you are able to create quick tasks and use them as related actions in your record type.

If the process model you used as the source for the record had quick tasks, the available quick tasks would automatically appear in the list of related actions for those records. Quick tasks only appear in this list and can't be used as related action shortcuts on record views.

Open in Github Built: Wed, Aug 17, 2022 (01:05:05 PM)

On This Page

FEEDBACK