Operational Flow for Email Alerts and Deadlock Prevention

Usage Objective

  • Use of this operational flow in the environment

  • This maintenance process operates in the background to monitor events. It ensures timely detection of any stalled or delayed events, promptly notifying the relevant users via email.

  • Guarantee prompt alerts for any events that are stuck to prevent delays.

  • Mitigate process flow deadlocks to ensure smooth operations.

Problem statement

In Adeptia, activating a Trigger in sequence for any event triggers the process flow or transaction sequentially. As a result, when a transaction enters a running state, the event will pause until the first process is completed. This scenario may result in a deadlock, where the event is awaiting the transaction to execute while the transaction is at a standstill. To mitigate this issue, a solution has been devised to send an email notification to the user, ensuring prompt awareness and resolution.

Introduction

This guide provides a detailed step-by-step process for deploying the Adeptia event monitoring process. This includes configuring backend database information, setting misfire and hour parameters, updating email credentials, and scheduling the calendar event for regular execution.

Prerequisites

Before you begin, ensure you have the following:

  • Adeptia Connect installed

  • Email server details

  • Backend database details

How to Deploy

Step 1: Download Package ZIP

Step 2: Deploy Package Using Migration Utility

  1. Run MigrationUtility.exe.

1.1
image-20240723-101726.png
1.2

How to Use it?

Step 1: Update Backend Database Credentials

  1. Navigate to Configure > Accounts > Database Info.

  2. Update the database configuration with the following details:

    • Database URL: jdbc:your_database_url

    • Username: your_db_username

    • Password: your_db_password

  3. Click on Test Database Connection and ensure the connection is successful.

Step 2: Update Email Credentials

  1. Navigate to Configure > Target > Mail Target.

  2. Edit ADP_MD_sendEventDataInfo.

  3. Update the email server details with your SMTP server information.

  4. Update sender and receiver configuration in Mail Target.

Step 3: Set Miss Fire and Hour Parameter

  1. Go to the Process Flow section.

  2. Open ADP_PF_EventMonitoringProcessFlow.

  3. Set the Miss Fire parameter to the minimum time you want the event to misfire based on your requirement.

  4. Set the Hour parameter to the desired value (e.g., 2 if the event should be stuck for at least 2 hours).

Step 4: Update Database Query in Mapper

  1. Edit mapping ADP_DM_convertEventInfoToMail.

  1. Edit variable VarQuery according to your database:

    • For SQL Server:

      Copy code

      concat('select *,DATEDIFF_BIG(MILLISECOND, ',$apos,'19700101',$apos,', SYSDATETIMEOFFSET()) AS currentEpochTime from ABPM_TRIGGERS with(nolock)') concat('SELECT *, TIMESTAMPDIFF(MICROSECOND ',',', $apos,'1970-01-01 00:00:00',$apos,',',' NOW()) / 1000 AS currentEpochTime FROM ABPM_TRIGGERS')

      For Oracle:

      Copy code

      concat('SELECT a.*,(CAST(SYS_EXTRACT_UTC(SYSTIMESTAMP) AS DATE) - TO_DATE(',$apos,'1970-01-01',$apos,$apos, 'YYYY-MM-DD',$apos,')) * 86400000 AS currentEpochTime FROM ABPM_TRIGGERS a');
    • For MySQL:

      Copy code

      'SELECT *, UNIX_TIMESTAMP(NOW()) * 1000 AS currentEpochTime FROM ABPM_TRIGGERS

Step 5: Update Calendar Event to Run Flow Every 2 Hours

  1. Navigate to Configure > Event > Calendar Event.

  2. Select the event ADP_CE_eventMonitoringFlow.

  3. Update the event to trigger every 2 hours.

Process Flow Activities Description:

  1. Navigate to Configure > Process flow > ADP_PF_EventMonitoringProcessFlow

  2. Edit Process Flow ADP_PF_EventMonitoringProcessFlow.

This Process flow contains the following activities:

  1. Data Mapping and Query: The data mapping is utilized to query the backend database for a list of events that have been blocked for a duration exceeding the time specified in the process flow variable.

DataMapping ForEach Description:

  1. Gateway Condition: A gateway condition is implemented to verify if there is at least one event that satisfies the specified condition.

  1. Text Layout for Mail Notification: A structured text layout is utilized to encompass all necessary fields for the email notification. This layout is selected for its adaptability, facilitating the inclusion of additional fields as required in the future.

  1. Custom Plugin for XML to HTML Conversion: A custom plugin is employed to transform the XML stream into HTML format, enabling seamless integration with the mail notification system.

Custom code:

  1. Mail Target for Email Notification: A mail target is configured to dispatch the email notification to the intended recipient efficiently and reliably.

Conclusion

Following these steps will allow you to successfully deploy and configure the Adeptia process flow for sending email notifications for stuck events. For further assistance, please reach out to the Adeptia support team.

Â