Skip to main content

Examine Decision Tables, Batch Jobs, and Data Processing Engine

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe how decision tables provide outcomes.
  • Explain the use of Batch Management.
  • Describe how Data Processing Engine transforms data.

Dive into Decision Tables

For business scenarios with multiple if-else conditions and rules for those conditions, decision tables come in handy. You can define business rules and let decision tables decide the outcome.

Let’s understand how decision tables work. According to Mary’s research, there’s a decline in the sale of products in the Winter Collection catalog. And because of low member engagement, Cloud Kicks has lost some members in the Platinum tier, which is the highest tier of the loyalty program. Mary decides to create a promotion to boost sales and to give Platinum members an extra incentive. Members who buy any product from the Winter Collection catalog earn non-qualifying points based on their tier and order amount. She summarizes the rules as follows.

Product Category Rule Outcome

Winter Collection catalog

The transaction amount is >200
AND
Member belongs to the Platinum tier

Credit 3 points for every $1 spent

The transaction amount is <= 200
AND
Member belongs to the Platinum tier

Credit 2 points for every $1 spent

Member doesn’t belong to the Platinum tier

Credit 1 point for every $1 spent

Linda can set up the rules using Promotion Setup or a decision table. She decides to use the latter. 

Business Rules

Linda adds the rules to a custom object that contains five records, each containing the details of one rule. She can also use a standard object to add the rules. Here are the details of each rule. 

Rules Product Category Minimum Transaction Amount Maximum Transaction Amount Member Tier  Points

Rule 1

Winter Collection catalog

201

-

Platinum

3x


Rule 2

Winter Collection catalog

0

200

Platinum

2x

Rule 3

Winter Collection catalog

0

-

Silver

1x

Rule 4

Winter Collection catalog

0

-

Gold

1x

Rule 5

Winter Collection catalog

0

-

Diamond

1x

The decision table provides outcomes based on the business rules. 

Inputs 

The decision table requires inputs to evaluate records. Fields from the object, in which the decision table is defined, are used as inputs. Linda selects Product Category, Minimum Transaction Amount, Maximum Transaction Amount, and Member Tier as the inputs. For each input, she selects the operator, which identifies how values are evaluated against the input field. For example, for the Product Category input field, Linda selects the operator as Equals. And for the Transaction Amount, she selects Greater or Equal, or Less or Equal

Outputs

When one or more rules match, the decision table provides the value of the output field of the matched rule as the outcome. If a value matches multiple rules, the decision table provides a list of outcomes. Linda selects the Points field as the output.

Call a Decision Table

Linda creates a dataset link, which creates a mapping between fields in an object or multiple objects and the input fields of the decision table. The mapping informs the decision table of the field value to be evaluated by an input field. The decision table determines outcomes based on field values from different source objects. 

For a decision table to provide outcomes, it has to be called using an action in Promotion Setup or a flow. Linda specifies the values for each input field in the action. 

The decision table assesses each input value against the business rules. If the value matches one or more rules, the decision table provides an outcome that can be used in the subsequent steps of process rules or the flow.

Let’s now look at how many points the decision table credits to members based on their tier and transaction amount. Three members of the Cloud Kicks Inner Circle loyalty program have each made a purchase from the Winter Collection catalog.

  • Michelle Smith, a Platinum tier member, purchases a pair of sneakers for $250. She earns 750 non-qualifying points.
  • Alan Johnson, a Gold tier member, purchases the same pair of sneakers. He earns 250 non-qualifying points.
  • Adria Darby, a Platinum tier member, purchases a pair of boots for $150. She earns 300 non-qualifying points.

In short, you use decision tables to automate the process of deciding the outcome for any given business scenario. And that helps you solve many business problems.

Note

Decision tables can be used in redemption processes to dynamically vary the points needed, based on aspects like seasonality and location.

Process Data with Batch Management

Batch Management automates the batch processing of high volumes of records through the rules defined in Promotion Setup or flows. Batch jobs chunk the records into small batches, which are easier to process. 

You create batch jobs for loyalty program processes or flows. 

  • Create batch jobs of type loyalty program process to execute pending transaction journals. The job uses the loyalty program process record whose journal type and subtype match the transaction journal record.
  • Create batch jobs of type flow to process records for a specific flow. Ensure the flow has at least one input variable that helps the batch job identify records to process.

Schedule batch jobs to run at a particular time using flows, and use Monitor Workflow Services to check the status of the batch job run. 

Transform Data with Data Processing Engine

Data Processing Engine (DPE) is designed to address high-volume data transformations and computations. It helps transform data that's available in the Salesforce org and writes back the transformed results as new or updated records. DPE definitions are used to transform data for standard and custom objects. You can join, filter, group, and aggregate various fields and objects in a DPE definition.

Let’s look at how Linda uses a DPE definition. Points expiry is an effective way to encourage members to engage with the program. When you set up currencies, or points, for your loyalty program, you must define how the non-qualifying points expire. You can set them to expire after a specified fixed period, say six months after they’re issued. Or you can set them to expire after a specified duration of member inactivity, for example, three months after the last date of member engagement with the program. 

The Cloud Kicks Inner Circle loyalty program uses the fixed model. To set up the points expiry process, Linda uses an out-of-the-box DPE job. This job expires the entire non-qualifying points balance on a specific date. You learn more about points expiration and the DPE job later in the module.

For a full list of the out-of-the-box loyalty DPE templates, refer to the Data Processing Engine Definitions help page.

Connect Loyalty Processes

After all the loyalty processes are set up, they’re stitched together using flows. Linda uses batch jobs and DPE jobs—they appear as invocable actions in the flow—to connect all the loyalty processes. She then schedules them to run at regular intervals.

You’ve explored decision tables, batch management, and DPE. In the next unit, you take a closer look at loyalty processes and how they’re set up. 

Resources

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities