Free cookie consent management tool by TermsFeed Configure Record Events [Appian Records]
Configure Record Events

This page describes how to configure record events, capture event data, and use that data to monitor and improve your business processes.

Overview

Your enterprise is built on key business processes. Whether it’s logging support cases, completing orders, or managing employees, keeping track of who does what and when can help you better understand your business and improve how it operates.

For example, in a retail application, you can construct a clear history of how orders are completed if you know who created, updated, or shipped each order and when. Then, you can answer critical questions like: Which activities were completed on a given order and by whom? How long does it take to complete an order on average? Which order activities take the longest: creating, updating, or shipping?

That’s where record events come in. Record events allow you to seamlessly track who takes action on your records and when, with minimal configuration on your part. You’re able to generate and capture data about your processes within your standard Appian workflows. Then, you can easily surface that history for analysis—or even better, leverage our process mining capabilities to identify actionable insights to improve your processes.

To configure and use events in your applications:

  1. Configure record events on your record type.
  2. Set up your process models to write events.
  3. Display and mine event data.

Configure record events

You can configure record events on any record type that uses a database as the source and has data sync enabled.

To configure record events, you will specify two record types to store your event information:

  • Event History: The record type used to store who completed an event and when. For example, John Smith created order SO1234 on February 28, 2023.

  • Event Type Lookup: The record type used to store the different types of events that can occur in your business processes. For example, Created Order, Updated Order, Reviewed Order, Shipped Order. This data is static and allows you to consistently reference the types of events that can occur. In a database, this would be considered a lookup table.

If you’re tracking events for the first time or you want to standardize your event data, you can generate these two new record types. Alternatively, if you have record types that already store this data, you can use those existing record types as your Event History and Event Type Lookup record types.

Generate new record types

Tip:   If you haven't tracked business events before, check out the following considerations before getting started.

When you generate new record types to store your event data, Appian will also generate the underlying database tables for the new record types. The new tables will always be written to the same source used for the base record type. This source must be a MariaDB, MySQL, Oracle, or SQL Server database.

To generate new record types:

  1. In the record type you want to track events for, go to Events.
  2. Click GENERATE EVENT RECORD TYPES.
  3. Under Types of Events, specify the types of events that can occur in your business processes. The event types will be written as values in the generated Event Type Lookup record type.

    Option Action
    Include Common Event Types Keep the Created records, Updated records checkbox selected to capture events for creating and updating records in the base record type. This will automatically configure any generated Create or Update record actions to write records and events.

    If you've already configured or generated record actions before you configured record events, you will need to manually update your Write Records nodes in your process models to also write events. Learn more.
    Other Event Types Enter any additional event types that you’d like to capture. If you included common event types, they will be automatically included with any other event types you enter.

    Enter each additional event type on a separate line and format them in the past tense. For example:
    Reviewed Order
    Approved Order
    Canceled Order
    Shipped Order
    Delivered Order
  4. Under Record Type Names, specify the names of the two record types that will be generated to store the event history and the types of events.
    • Event History: By default, this value is the base record type’s name appended with Event History. For example, Order Event History. Keep the default or update as necessary.

    • Event Type Lookup: By default, this value is the base record type’s name appended with Event Type. For example, Order Event Type. Keep the default or update as necessary.

  5. For Application, specify where you want Appian to create the two new record types. This option only appears if your base record type is associated with more than one application and you have permission to view those applications.
  6. Keep the Download database script checkbox selected to download an auto-generated database script when you click GENERATE. This script contains the SQL commands that Appian will use to create database tables for the two new record types.

    Caution:  The auto-generated database script is not saved in Appian, so we strongly recommend downloading the script now and storing it locally.

  7. Click GENERATE to generate the two new record types and configure record events.
  8. Click SAVE CHANGES.

Generated Event History record type

The generated Event History record type has the following configurations:

  • Security:
    • The generated record type copies the group object security of the base record type. Individual user security is not copied.

  • Relationships: Relationships for the generated record type include:

    Base record Type Relationship Related Record Type Purpose Example
    Where you're configuring record events One-to-many Event History Allows you to reference the different events associated with each record. The Order record type has a one-to-many relationship with the Order Event History record type.
    Event History Many-to-one Where you're configuring record events Allows you to reference the record associated with each event. The Order Event History record type has a many-to-one relationship with the Order record type.
    Event History Many-to-one Event Type Lookup Allows you to reference the types of events that can occur. The Order Event History record type has a many-to-one relationship with the Order Event Type record type.
    Event History Many-to-one User Allows you to reference the user who completes an event. The Order Event History record type has a many-to-one relationship to the User record type.

  • Fields: The Event History record type contains five required fields by default:

    Default Field Data Type Description
    Id Number (Integer) This is the primary key field, which is the unique identifier for each event.
    recordId Number (Integer) The common field that establishes a relationship between the Event History record type and the base record type.

    This field has a foreign key constraint in the generated database table.
    timestamp Date and Time The date and time when the event occurred.
    user User The user who completed the event. If this value is null, Appian assumes the event occurred due to an automated activity in the process model.
    eventTypeId Number (Integer) The common field that establishes a relationship between the Event History record type and the Event Type Lookup record type.

    This field has a foreign key constraint in the generated database table.

    Note:  You can modify the generated Event History record type to meet any additional business requirements.

    For example, you may choose to add a description field to collect more detailed information about an event. Any fields you add to the record type will appear in the Write Records smart service so you can specify the values to write for the event.

Generated Event Type Lookup record type

The generated Event Type Lookup record type has the following configurations:

  • Security:
    • The generated record type copies the group object security of the Event History record type. Individual user security is not copied.

  • Fields: The Event Type Lookup record type contains two fields by default. Appian does not recommend adding fields to this record type, because it's meant to serve as a lookup table for the Event History record type.

    Default Field Data Type Description
    Id Number (Integer) This is the primary key field, which is the unique identifier for each activity.

    This field is also the common field that establishes the relationship between the Event History record type and the Event Type Lookup record type.
    name Text The name of the event that occurred.

Use existing record types

You may already have record types that store your event history and event types. If so, you can easily configure record events using those existing record types. However, to use existing record types for this purpose, a relationship must be configured between the existing record types and the base record type.

Once you choose your record types, you’ll need to specify the fields to use for the User, Timestamp, and Event Name. These field mappings will allow you to write events from the Write Records smart service.

To use existing record types:

  1. In the record type you want to track events for, go to Events.
  2. Click USE EXISTING RECORD TYPES.
  3. Configure the following properties:

    Properties Value
    Event History Select a related record type to store all event data. The base record type must have a one-to-many relationship to this record type.
    User Field Select a field of type User from the selected Event History record type. This field will store the users who complete each event.
    Timestamp Field Select a field of type Date and Time from the selected Event History record type. This field will store the date and time when each event occurred.
    Event Type Lookup Select a related record type to store the different types of events. The Event History record type must have a many-to-one relationship to this record type.
    Event Name Field Select a field of type Text from the selected Event Type Lookup record type. This field will store the names of the different event types.
  4. Click FINISH to configure record events.
  5. Click SAVE CHANGES.

Write events

Once you configure record events, you can incorporate event tracking into your new and existing processes using the Write Records smart service. When you configure the smart service to write records, you can also specify what events to write and when.

Note:  You can only write records and events using the Write Records smart service. You cannot use the a!writeRecords function to write records and events at the same time.

If you generate Create or Update record actions, Appian will automatically configure the Write Records node to write events—no further configuration needed. If you do not generate your record actions, or you want to write more specific types of events (like Reviewed Order or Shipped Order), you can manually configure the Write Records node to write events.

To write events:

  1. In your process model, open a Write Records node.
  2. Go to the Setup tab.

    Tip:  If you do not see the Setup tab in your node, replace the current node with a new Write Records node.

  3. For Records Input, select a process variable or write an expression to specify the records to update. You can write a total of 50,000 records and events combined per node.
  4. For Record Type, specify the record type you are updating. If you selected a process variable for your Records Input, this value is auto-populated by default with the selected record type.
  5. If the selected record type has record events configured, specify when to write events for the selected record type under Choose when to write events:
    • Select Always to write events whenever the node executes.
    • Select Never to never write events whenever the node executes.
    • Select Only when… to specify the condition in which events are written. Then, click Edit Condition to write an expression defining the specific condition.
  6. Select the values to write for the event. The field inputs are populated from the related Event History record type. You must map values for the following field inputs:

    Input Value
    Event Type Use the dropdown to select an event type or use an expression to specify the event type. The dropdown list is populated from the values in the Event Type Lookup record type. If you use an expression, you must use the event type identifier to indicate the type of event. Learn more about conditionally choosing event values.
    User Use the dropdown to select the Process Initiator or a process variable of type User or Text, or use an expression to specify the user. If the event will be completed by an automated task, set the value to Null (Set as System Event).
    Timestamp Use the dropdown to select Now (the date and time when the node is executed) or a process variable of type Date and Time, or use an expression to specify the date and time.
  7. Click OK.
  8. Click Save & Publish in the process model.

Tip:  There are some scenarios where you may only want to write events and not records, like when you want to capture events for an automated task or a task escalation. See the Write Records smart service to learn how to write events without writing records.

Display and mine event data

As you collect event data, you can display a history of events in your record views, interfaces, and reports using the Event History List component.

You can display your event history as a timeline or as a list to show a snapshot of your business operations. Use the component to display a full history of events for all records, or only display the events for a specific record. This component is automatically added to any generated Summary view so users can quickly see a history of events related to their records.

To take your data a step further, you can mine your event data using Appian's process mining capabilities. Process mining helps you find new ways to optimize your business processes. Since your event data is stored in your record types, it's easy to load the data into Mining Prep and get started.

Open in Github Built: Mon, Apr 22, 2024 (07:50:02 PM)

Configure Record Events

FEEDBACK