Process Modeling Tutorial

Overview

This tutorial will help you create a process model that end users can start as an application action.

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 use them later. Then, we'll add a process flow that lets the user cancel 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.

Before you begin

  • Complete the Interface Tutorial first, so that you have both the Appian Tutorial application and the AT_expenseReportForm interface needed to complete this tutorial.

  • Make sure you're a member of the Process Model Creators system group. Contact your system administrator if you are unsure if you belong to this system group.

Create an application action

Let's start by using the AT_expenseReportForm interface to create an application action.

To create the application action:

  1. In the application view, click AT_expenseReportForm to open the interface.
  2. In the settings menu , select Save as…. This action will display the Save Interface As form.
  3. Select Application Action.
  4. Configure or verify the following properties:

    Property Description
    Action Name Enter: Submit Expense Report
    Application Leave the default value unchanged. By default, the current application is selected.
    Folder

    Select AT Models. If that folder doesn't exist yet, create it:

    • Click Browse Folders.
    • Click NEW FOLDER.
    • For Name, enter AT Models.
    • Click CREATE.
    • Click OK to close the browse dialog.

    For example:

  5. Click SAVE.
  6. In the Review Process Model Security dialog, set the permissions so that administrators can view and edit the process model:
    • Click Add Users or Groups.
    • For User or Group, select AT Administrators.
    • For Permission Level, select Administrator.
  7. Set the permissions so that users can view and start the process model:
    • Click Add Users or Groups again.
    • For User or Group, select AT Users.
    • For Permission Level, select Initiator.
  8. Click SAVE. The Appian Process Modeler opens automatically and displays the Submit Expense Report process. You can leave the modeler open, because we'll be returning to it in a moment.

You have just created a process model for submitting expense reports and made it available in Tempo as an action. This step essentially does the following:

Test the application action

To test out the application action:

  1. In the application view, go to the navigation menu, and click Tempo.
  2. Click the Actions tab.
  3. If your environment contains multiple applications, select the Appian Tutorial application from the left navigation panel.
  4. In the actions list, click Submit Expense Report. You should see the following:
  5. Complete and submit the form.
  6. Return to the application view, and click MONITORING in the header bar.
  7. Click PROCESS ACTIVITY to view the list of processes. You should see your process instance with the name Submit Expense Report in the list.
  8. Click your process instance. The monitoring view of the process instance displays in the Appian Process Modeler. The flow that your process instance followed is highlighted in blue.

    process_model_monitor_process_view_simple

    In this case, the flow was straightforward: it started at the Start Node and successfully continued to the End Node.

  9. In the toolbar, click Process Details. By default, the Process History tab is active.

    For example:

    In this example, you can see each event Appian logged as you started the application action, completed the input fields, and submitted the form.

  10. Go to the Variables tab. If your process instance was successful, this tab displays the values that Appian populated to the process variables based on your field inputs.

    For example:

  11. Click CLOSE.
  12. Close the monitoring view for this process instance.

Make process instance names dynamic

In the PROCESS ACTIVITY list, you might have noticed that the process name is simply Submit Expense Report. As more expense reports are submitted and other applications are introduced into this environment, it will become difficult to distinguish processes from each other if the process instance names are generic.

So, let's update the name to include information that's specific to each process instance.

To make the process instance names dynamic:

  1. Return to the Submit Expense Report process model.
  2. In the menu bar, click File > Properties. Alternatively, you can select the Properties icon Image:Properties_icon.png next to the swimlane icon.
  3. On the General tab, next to Process Display Name, click Edit as Expression .
  4. In the Expression Editor dialog, enter ="Expenses Submitted: " & pv!expenseItem. This expression adds expense item information to the display name of every process instance.
  5. Click SAVE AND CLOSE.
  6. Click OK to close the Process Model Properties dialog.
  7. In the menu bar, click File > Save & Publish.
  8. Test the application action again. This time, in the monitoring view, notice that the process name includes the value from the Expense Item field of the input form:

    process_instance_history_dynamic_title

Add a cancel flow

We've enabled our users to submit a report, but we still need to handle the case when the user starts to fill out the form, then wants to cancel the action.

We'll do that by adding a cancel flow to the process.

The process variables we'll need were automatically set up when we created the application action from the AT_expenseReportForm interface. We just need to add a gateway to redirect the process flow if the user clicks CANCEL.

Add a decision node

To add a decision node:

  1. In the Submit Expense Report process model, drag the XOR node from the palette to the canvas, and drop it on top of the existing connector between the Start Node and End Node. The connector turns blue to indicate that you can add the node to the existing flow.
  2. Click the label of the new XOR gateway and change it to Cancel?.
  3. Drag an End Event node from the palette to the bottom of the Cancel? gateway. A red dot appears indicating that these two nodes will be connected.
  4. Drop the End Event node on the red dot. The two nodes are now connected.
  5. Rename this node Cancel End Event.
  6. Double-click the flow connector between the Cancel node and the End Node, and set the Label property to No.
  7. Double-click the flow connector between the Cancel node and the Cancel End Event node, and set the Label property to Yes.

    The process model should look like this:

    process_model_with_cancel_flow.png

Configure the decision logic

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

  1. Double-click the Cancel? node.
  2. In the Configure Cancel? form, go to the Decision tab.
  3. Click NEW CONDITION.
  4. Configure properties for the new condition:
    • For Condition, enter pv!cancel.
    • For Result, in the go to dropdown list, select Cancel End Event.
  5. Configure properties for the Else if none are TRUE condition:
    • For Result, in the go to dropdown list, select End Node.
  6. Click OK.
  7. In the menu bar, click File > Save & Publish.
  8. Test the application action again, but click CANCEL instead of SUBMIT. This time, in the monitoring view, click the process instance to review the process flow. You can see that the process followed the cancel flow. process_instance_with_cancel_flow

Configure the end nodes

It's best practice to formally terminate a process when it reaches an end event, so we'll want to configure both the End Node and the Cancel End Event to terminate the process on completion of the node action.

In the process model, do the following for each of these nodes:

  1. Click the node.
  2. Go to the Results tab.
  3. Click Terminate Process.
  4. Click OK. Your end nodes should now look like this: process_model_terminate_end_nodes
  5. In the menu bar, click File > Save & Publish.

Add the approval step

In the Interface Tutorial, we first configured the interface to allow an employee to submit an expense report, then configured it to allow a manager to approve or reject the expense report as well. Based on the value of a rule input, that interface displays each form field as read-only and adds Approved and Rejected radio buttons.

Now, let's add an approval step to the process model and assign it to the process initiator's manager.

Add a managers group

We've configured the process so that anyone in the AT Users group can submit an expense request. Now, we need an AT Managers group that includes managers who can review and approve those requests.

To add a managers group:

  1. In the application view, click New > Group.
  2. Configure the following properties:

    Property Description
    Name Enter: AT Managers
    Parent Group Select AT Users.
    Group Members Select your user account. In a real environment, employees probably wouldn't be in a managers group, but for this tutorial we need you to be able to act as a manager to test the process.
  3. Click CREATE.
  4. Keep the security settings inherited from the parent group.
  5. Click SAVE.

Add the approval task to the process model

Now, it's time to update the process model, so that, when an employee submits an expense request, Appian assigns the task to the AT Managers group.

To add the approval task to our process model:

  1. Drag a User Input Task node from the palette to the existing connector with the No label. This step connects the nodes as shown below. The logic in the Cancel? node is automatically updated so that the User Input Task node is selected for the second go to results.

  2. Change the label of the User Input Task to Review Expense.
  3. Double-click on the Review Expense node to view the properties.
  4. On the General tab, make the task display name dynamic:
    • Next to Task Display Name, click Edit as Expression .
    • In the Expression Editor dialog, enter the following expression:

      ="Approve Expenses for " & user(pp!initiator,"firstName") & " " & user(pp!initiator,"lastName")

      This change 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.

    • Click SAVE AND CLOSE.
  5. On the Forms tab, for Interface, select the AT_expenseReportForm interface.
  6. When asked if you want to Create Process Parameters to match your interface's inputs, click YES. This adds the rule inputs from our interface into the process model.

    For example:

    PM_Tutorial_Forms_Tab

  7. Go to the Data tab. In the Node Inputs pane, you'll see an input for each rule input in the interface you selected.
  8. For the following inputs, click the input, then configure the specified field property:

    Input Description
    expenseItem For Value, enter: pv!expenseItem
    expenseDate For Value, enter: pv!expenseDate
    expenseAmount For Value, enter: pv!expenseAmount
    comments For Value, enter: pv!comments
    step For Value, enter: REVIEW
    approve For Save into, select approve.
  9. On the Assignments tab, for Assign to the following, begin typing AT Managers and then select it from the auto-complete list displayed.

    We're selecting this group for testing purposes. Later, when you're ready to build your own process model, you can configure this input using the supervisor() function instead.

  10. Click OK.
  11. In the menu bar, click File > Save & Publish.

Test the full workflow

Our process model now contains two steps: one to enter the expenses information as an action, and one to approve the expenses. Now it's time to test both steps.

To test the full workflow:

  1. Submit a request:
    • In Tempo, go to the ACTIONS tab.
    • In the actions list, click Submit Expense Report.
    • Complete and submit the form.
  2. Review the request:
    • Go to the TASKS tab. You should see a task like the following: task-review-expense-report
    • Click the task. You should see the following: form-review-expense-report
    • Click ACCEPT.
    • Select either Approve or Reject.
    • Click SUBMIT.
  3. Check out the results.
    • Return to the application view, and click MONITORING in the header bar.
    • Click PROCESS ACTIVITY to view the list of processes.
    • Click your process instance. You should see the following:

    • In the toolbar, click Process Details.
    • Go to the Variables tab. The approve variable should be set to either True or False depending on whether you selected Approve or Reject in the review form.

      For example:

Congratulations!

Your process model now collects data from an employee, alerts the employee's manager that the data is ready for review, and saves the outcome of the manager's review to a process variable.

All of the data each user enters is available for viewing and reporting by accessing the process variables you configured. Learn more about writing data from the process variables to a data source.

Open in Github Built: Mon, Nov 29, 2021 (03:22:32 PM)

On This Page

FEEDBACK