/
Process Future Event

Process Future Event

Overview

 

  • Rules containing this step, must have a sister rule with a Create Future Events step to create the timers

  • This is the only rule type that does not start with a Real Time Input Step

  • When the timer expires, a following action can be implemented in the rule

  • The Process Future Event task can add many entries for the same Key

    • To ensure that the latest entry is valid, a filter condition should immediately follow the task

Plugin Configuration

General

Within the General tab:

image-20240123-145534.png

 

The following settings can be configured:

Setting

Description

Setting

Description

Server names(s)

The name of the cache server(s) you are using. If the rule is running in DDE then this will automatically be populated and the value will be ignored.

KeySpace

Tables exist in Keyspace (similar to a database). If the rule is running in DDE then this will automatically be populated with the client name within DDE and the value will be ignored.

Table

The name of the table which will be created in Cassandra. If left blank this will be the same as the key field name.

Key

The field that contains the unique key (primary key) which identify items in the cache. e.g. Customer ID or Order ID

Event loop count limit

Set the maximum amount of times that the same record (based on the Key) can be processed. For example you may want to limit the number of abandoned basket emails being sent to 1 individual to 3 separate emails.

If an event is processed more than this number of times then the data is sent to the error output. The rule should therefore have an error handling step to cater for events that exceed the event loop limit. e.g.

If an error handling step is not configured, any event exceeding the limit will be discarded.

Within the Test Data tab:

image-20240123-145731.png

Setting

Description

Setting

Description

Use Test Data

Do you want to use the test data from the Process Future event step

Delay Time (ms)

A delay can be set between the test data going through defaulting to 500ms.

Table

Where you can add the test data. Add a key, the message you want to use. timebox and latest.

Best practise

The Process Future Event task can add many entries for the same Key. For example, the same customer over a period of time can add many products to a shopping cart on a website. The Create Future Events will write many entries to the Cassandra table, but only the latest basket status would be valid for an abandoned cart email.
To ensure that the event being processed is the latest, a filter condition should immediately follow the Process Future events step:

Example

Scenario

A Sofa company wants to send a confirmation email once a product has been purchased, detailing when the product will be delivered. A follow-up email will be sent 1 day before the delivery date reminding the customer of the delivery datetime.

Solution

A rule is created that receives booking and delivery details once a purchase has been made. This rule is called from the order confirmation page on the website. The rule does the following:

  • Receives the data from the website e.g.

    • Order Date: 14/01/2020

    • Delivery DateTime: 16/01/2020 10:30:00

  • Work out how many minutes in the future 1 day before the delivery date is for the reminder email to be sent

    • 1440 (1 day = 1440)

  • Sends a confirmation email to the customer

  • Creates a future event for the reminder email, storing the order and delivery details

    • Sets the event to expire at 15/01/2020 10:30:00

 

A sister rule is created that runs the process future event. The rule does the following:

  • Processes any event data in the cache that has expired e.g.

    • The current datetime matches the expiry time of 15/01/2020 10:30:00

  • Check that the event is the latest

    • If the order details or delivery date is changed, then we only want to send a reminder using the latest update

  • Sends a reminder email to the customer 1 day before the delivery

 

 

 

 

Related content