BrainGrid Controller
Workflow Builder
Triggers
Database Trigger

Database Trigger Setup

Database Triggers allow the Workflow Management module to react to changes in database records. This feature helps automate workflows based on specific database actions like adding, modifying, deleting, or restoring records.

Overview

Database Triggers can be configured to monitor both static and dynamic tables for various record changes. By setting up triggers, users can automate responses based on database actions, ensuring that workflows react appropriately to data changes.

Configuring Database Triggers

Configure Database Trigger for Internal Destination with Static Table

To configure a Database Trigger for adding records in a static table:

  1. Destination: Select Internal.
  2. Title: Provide a descriptive title for the trigger.
  3. Description: Explain the purpose of the trigger.
  4. Trigger Method: Select Add Record.
  5. Source Table: Choose the static table to monitor.

Example:

  • Title: Static Table Add Trigger
  • Description: Trigger for adding records in static table
  • Trigger Method: Add Record
  • Source Table: Static Table

Outcome: The Database Trigger will be set to monitor the selected static table (e.g., "User Roles") for added records.

Configure Database Trigger for External Destination with Dynamic Table

To configure a Database Trigger for modifying records in a dynamic table:

  1. Destination: Select External.
  2. Title: Provide a descriptive title for the trigger.
  3. Description: Explain the purpose of the trigger.
  4. Trigger Method: Select Modify Record.
  5. Source Table: Choose the dynamic table to monitor.

Example:

  • Title: Dynamic Table Modify Trigger
  • Description: Trigger for modifying records in dynamic table
  • Trigger Method: Modify Record
  • Source Table: Dynamic Table

Outcome: The Database Trigger will be set to monitor the selected dynamic table (e.g., "Employee Records") for modified records.

Configure Database Trigger for Deleting a Record

To configure a Database Trigger for deleting records:

  1. Destination: Select Internal.
  2. Title: Provide a descriptive title for the trigger.
  3. Description: Explain the purpose of the trigger.
  4. Trigger Method: Select Delete Record.
  5. Source Table: Choose the static table to monitor.

Example:

  • Title: Record Delete Trigger
  • Description: Trigger for deleting records
  • Trigger Method: Delete Record
  • Source Table: Static Table

Outcome: The Database Trigger will be set to monitor the selected static table (e.g., "User Departments") for deleted records.

Configure Database Trigger for Restoring Records

To configure a Database Trigger for restoring records:

  1. Destination: Select Internal.
  2. Title: Provide a descriptive title for the trigger.
  3. Description: Explain the purpose of the trigger.
  4. Trigger Method: Select Restore Record.
  5. Source Table: Choose the dynamic table to monitor.

Example:

  • Title: Restore Record Trigger
  • Description: Trigger for restoring records
  • Trigger Method: Restore Record
  • Source Table: Dynamic Table

Outcome: The Database Trigger will be set to monitor the selected dynamic table (e.g., "Invoice Records") for restored records.

Validating Database Triggers

To validate the configuration of a Database Trigger:

  1. Review Configuration: Ensure all fields are correctly filled with appropriate values.
  2. Check Trigger Method: Confirm that the correct trigger method is selected.
  3. Verify Source Table: Ensure that the appropriate table is selected for monitoring.

Validation Checklist:

  • Destination
  • Title
  • Description
  • Trigger Method
  • Source Table

Verifying Database Trigger Activation

Verify Record Add Trigger for Static Table

To verify the activation of a record add trigger for a static table:

  1. Trigger: Add a record to the monitored static table.
  2. Expected Outcome:
    • The Database Trigger should be activated.
    • The configured workflow should be executed.

Verify Record Modify Trigger for Dynamic Table

To verify the activation of a record modify trigger for a dynamic table:

  1. Trigger: Modify a record in the monitored dynamic table.
  2. Expected Outcome:
    • The Database Trigger should be activated.
    • The configured workflow should be executed.

Verify Record Delete Trigger for Static Table

To verify the activation of a record delete trigger for a static table:

  1. Trigger: Delete a record from the monitored static table.
  2. Expected Outcome:
    • The Database Trigger should be activated.
    • The configured workflow should be executed.

Verify Record Restore Trigger for Dynamic Table

To verify the activation of a record restore trigger for a dynamic table:

  1. Trigger: Restore a record in the monitored dynamic table.
  2. Expected Outcome:
    • The Database Trigger should be activated.
    • The configured workflow should be executed.

Summary

Database Triggers in the Workflow Management module provide a powerful way to automate responses to changes in database records. By configuring and validating these triggers, users can ensure that workflows react appropriately to data changes, whether they involve adding, modifying, deleting, or restoring records.