Container components

Container components provide a way to create a data structure similar to a database table in your trigger systems. You use the Container to define the table that holds the data inserted by a Container Manipulator.

Optionally, you can also define the following.

  • The aggregation, or database function, applied to each field in the table
  • The number of records that are retained and how long to retain them

The Container never fires an event.

Container usage

Containers can store data from multiple data sources. A single Container can also be used by multiple trigger systems.

Multiple data sources

Here is an example of a trigger system with a Container that holds data from two data sources. Suppose you have transaction data from two channels: your web site and in-store purchases. Fields in the data from each channel may differ, but both channels include the following fields.

  • date of purchase
  • SKU number
  • quantity
  • price

You could use a single Container to hold data from both feeds, and use this Container in a trigger system designed to respond when a customer's activity declines. The trigger system illustrated by the following diagram evaluates the average customer spending from two time periods, and responds when spending decreases.


Diagram illustrating a workspace with a Container holding data from two data sources.

Multiple trigger systems

Containers can be designed to be useful within a single trigger system, or across multiple trigger systems. For example, a Container could be limited to hold information on only the color and size of garments a customer purchases. You might draw data from this Container for use within a single trigger system.

In contrast, you could define a Container that holds as much data as is required across all the trigger systems that will use it, and then share the Container across trigger systems.

You should consider processing efficiency when deciding whether to create a limited or broad Container. Containers that are expected to hold a very high number of records should generally limit the number of fields per record.

Types of data that a Container can hold

The fields you define in Container components can hold any of the following data types.

  • Boolean
  • Currency
  • Date
  • Double
  • Integer
  • String

Table Definition

For each field you want to define, you select a data type and an aggregation function to apply to the field. You also give the field a name.

In a Container Manipulator, you specify what data is inserted into the fields you define in the Container.

Aggregation

You use Aggregation to apply commonly used database functions to a field to reduce multiple data items to a single data item.

The aggregation methods available for a field depends on the data type. The following table describes all of the aggregation methods.

Table 1. Aggregation methods
Aggregation method Description
Last Inserted Use the most recently inserted value in the field.
Minimum Use the lowest value in the field. In string fields, this returns the string that comes first in an alphabetical sort.
Maximum Use the highest value in the field. In string fields, this returns the string that comes last in an alphabetical sort.
Sum Use the total of the values in a numerical field.
And For Boolean values, use the False value if one is present; if no False value is present, use the True value.
Or For Boolean values, use the True value if one is present; if no True value is present, use the False value.

Overflow

In the Overflow panel of the Container component, you can set a limit on the number of records the component stores. You can specify whether to delete records based on the lowest or highest value of any defined field.

Detailed Container example

Suppose that your goal is to offer customers a discount for printer paper when they purchase more than $200 in printer paper in a calendar month. You can set up a trigger system as follows.

  • Create a Simple Event component that fires an event when it receives printer paper purchase data.
  • Create a Container component to store dollar amounts of printer paper purchases.
    • In the Time Span panel, set a calendar month time span to set a limit on the length of time that the data is retained. The Container is cleared at the end of every month.
  • Create a Container Manipulator, CM1, that listens for the Simple component event.
    • In the Action panel, specify that the purchase amount is inserted into the Container.
  • Create an Action component that listens for the CM1 event.
    • In the Firing Condition panel, define a Boolean expression that applies the Sum function to the dollar amount field in the Container and returns True when the amount is equal to or greater than $200.
    • Optionally, add the same Boolean expression in the Additional Information section of the Outcome panel. This includes the dollar amount in the data that is written to the Outcome table.

Each time a customer purchases printer paper during a calendar month, the dollar amount is saved. If the total amount is equal to or greater than $200 in any month, the Action component fires for that customer.

Tip: This example uses a limited Container that contains only the data needed for the single trigger system described in this scenario.

Diagram of the trigger system described in this section