10.2 Decision Tables & Decision Matrices for Policy Decisioning

Key Takeaways

  • Decision Matrices are high-performance, in-memory tabular lookup structures defined within BRE metadata (0 SOQL queries), whereas Decision Tables evaluate business rules directly against standard or custom Salesforce sObjects.
  • Standard Decision Matrices support both Exact Matching (equality) and Range Matching (numeric, currency, or date intervals) across multiple input columns with combinatorial AND logic.
  • Grouped Decision Matrices partition massive rule sets by a high-cardinality key (e.g., County or Jurisdiction) to optimize lookup performance and simplify delegated administration.
  • Decision Explanations provide statutory transparency by linking explanation codes and message templates to matrix outcomes, generating legally defensible audit logs on public sector applications.
  • Policy tables support bulk administration via CSV template export/import, draft/active versioning, and rigorous simulator testing across boundary thresholds.
Last updated: September 2026

10.2 Decision Tables & Decision Matrices for Policy Decisioning

Exam Focus: Policy decisioning in government requires structured evaluation of complex, multi-dimensional rules—such as zoning hazard classifications, inspection frequencies, and tiered license eligibility. On the AP-222 examination, candidates must clearly differentiate between Decision Tables and Decision Matrices, configure standard and grouped matrices, implement exact and range matching logic, enforce statutory transparency through Decision Explanations, and manage policy lifecycle updates via CSV import/export and version control.


Decision Tables vs. Decision Matrices: Architectural Distinctions

Within the Salesforce Business Rules Engine (BRE), policy lookups can be implemented using either Decision Matrices or Decision Tables. While both provide tabular rule evaluation, their underlying data sources, performance profiles, and governance models differ significantly. Choosing the correct pattern is one of the most frequently tested competencies on the AP-222 exam.

+-----------------------------------------------------------------------------------+
|              Architectural Comparison: Decision Matrix vs Decision Table          |
+-----------------------------------------------------------------------------------+
|  [DECISION MATRIX (In-Memory Engine)]                                             |
|  • Data Source: BRE Metadata (Self-contained, in-memory storage)                  |
|  • Database Impact: 0 SOQL Queries, Zero Database Locks                           |
|  • Latency: Ultra-low (~2 to 10 milliseconds)                                     |
|  • Maintenance: System Admins via Setup UI, CSV Import/Export, Metadata Pipeline  |
|  • Best Use Case: Static statutory tax tables, permit fee matrices, zoning rates  |
|                                                                                   |
|  [DECISION TABLE (Object-Backed Engine)]                                          |
|  • Data Source: Salesforce sObjects (Standard: Product2, Custom: Policy_Rate__c)  |
|  • Database Impact: Executes targeted queries against underlying database tables |
|  • Latency: Low (~20 to 80 milliseconds, subject to record-level sharing)         |
|  • Maintenance: Business Caseworkers via Standard CRM Records & List Views        |
|  • Best Use Case: Dynamic agency programs, frequently changing operational rates  |
+-----------------------------------------------------------------------------------+

Comprehensive Architectural Comparison:

Capability / DimensionDecision MatrixDecision Table
Underlying Data StoreBRE Metadata / In-Memory CacheSalesforce Standard or Custom sObjects (e.g., Product2, Custom_Rate__c)
SOQL Limits Consumed0 SOQL Queries (Pure in-memory lookup)Consumes SOQL queries to scan source object records
Record-Level Security (OWD/Sharing)Bypasses record sharing; available org-wide as metadataStrictly enforces Salesforce Object, Field-Level, and Record-Level Sharing
Data Volume CapacityOptimized for tens of thousands of rows via CSV bulk uploadDependent on underlying sObject volume and SOQL index optimization
Matching CapabilitiesExact Match (Equals) and Numeric/Date Range MatchingStandard operators (=, !=, >, <, >=, <=, Between, In)
Target AdministratorSystem Administrators, Release Engineers, IT AnalystsBusiness Users, Policy Analysts, Program Operations Managers
Update MechanismSetup Builder, CSV Upload, Metadata API, Versioning LifecycleStandard Salesforce Record CRUD (List Views, Flow, Data Loader, Import Wizard)
Primary Public Sector Use CasesMunicipal building permit fee schedules, state tax brackets, fire hazard multipliersProgram eligibility matched against live Product2 catalogs, local branch office routing

Standard Decision Matrices: Structure, Matching Modes & Evaluation Logic

A Standard Decision Matrix is an in-memory lookup structure composed of Input Columns and Output Columns. When invoked by an Expression Set, the matrix evaluates incoming input values against each row's criteria and returns the corresponding output values.

+-----------------------------------------------------------------------------------+
|                    Standard Decision Matrix: Commercial Permitting                |
+-----------------------------------------------------------------------------------+
| [INPUT COLUMNS (Conditions)]                   │ [OUTPUT COLUMNS (Results)]       |
| Zoning_District (Text) │ SqFt_Range (Range)    │ Base_Fee (Cur) │ Inspector_Hrs   |
+────────────────────────┼───────────────────────┼────────────────┼─────────────────+
| Commercial_Downtown    | 0 to 1,500            | $350.00        | 2.0             |
| Commercial_Downtown    | 1,501 to 5,000        | $750.00        | 4.5             |
| Commercial_Downtown    | 5,001 to 20,000       | $1,800.00      | 8.0             |
| Industrial_Heavy       | 0 to 5,000            | $1,200.00      | 6.0             |
| Industrial_Heavy       | 5,001 to 999,999,999  | $3,500.00      | 15.0            |
+-----------------------------------------------------------------------------------+

Column Classifications:

  1. Input Columns: Attributes required to perform the lookup. Multiple input columns evaluate with a logical AND condition across the same row. Every input condition specified in a row must be satisfied for that row to match.
  2. Output Columns: Values returned when a match is found. A single row can return multiple distinct output values (e.g., returning both Base_Fee and Inspector_Hours_Required).

Matching Modes:

  • Exact Match (Equals): The input attribute must match the row value identically. Commonly used for text strings, picklist API values, codes, and Boolean flags (e.g., Zoning_District == 'Commercial_Downtown').
  • Range Matching (Range): Evaluates whether an incoming numeric, currency, or date value falls within a bounded interval. Range matching is essential for public sector fee schedules that tier costs by building square footage, project valuation, or applicant income brackets.
    • Boundary Definitions: Range columns specify a lower bound and an upper bound (e.g., 1501 to 5000).
    • Inclusive vs. Exclusive Boundaries: By default, ranges evaluate with inclusive lower and upper bounds (LowerBound <= Input <= UpperBound). Architects must design tier boundaries carefully to eliminate gaps (where an input matches nothing) or overlaps (where an input matches multiple rows ambiguously).
    • Open-Ended Tiers: For maximum or uncapped brackets (such as "Over 20,000 square feet"), architects specify a high ceiling value (e.g., 20001 to 999999999) to ensure all large-scale projects match successfully.

Evaluation Modes: First Match vs. All Matches

When configuring how an Expression Set calls a Decision Matrix, the architect selects the evaluation mode:

  1. First Match (Default): The engine scans the matrix rows and halts execution upon encountering the first row where all input criteria evaluate to true. First Match is optimal for mutually exclusive fee tiers, tax brackets, and priority-ranked rules where specific exceptions precede general defaults.
  2. All Matches: The engine evaluates all rows in the matrix and returns a Collection (Array) of every row that satisfies the input criteria. This mode is critical in public assistance and social service eligibility, where an applicant's demographic profile (e.g., Income < 35000, HasDependents == TRUE) may simultaneously qualify them for multiple distinct aid programs (e.g., SNAP, Medicaid, and Childcare Subsidies).

Wildcards and Default Fallback Rows

To prevent calculation failures when constituent inputs do not match standard tiers, architects can configure fallback rows:

  • By leaving an input column blank or configuring a wildcard (*), that column acts as a catch-all for any incoming value.
  • Placing a fallback row at the bottom of a First Match matrix ensures that unmapped or edge-case inputs receive a predefined default rate or route to an administrative review tier rather than throwing a fatal null lookup exception.

Grouped Decision Matrices & Object-Backed Decision Tables

Grouped Decision Matrices: High-Density Partitioning

When a public sector implementation spans a large state with 50+ counties, or an agency with 30 distinct regulatory bureaus, a single flat Decision Matrix can easily grow to tens of thousands of rows. Maintaining a monolithic matrix creates performance degradation and administrative gridlock, as changes made by one county risk corrupting rules for another.

Grouped Decision Matrices solve this scalability challenge by partitioning the matrix using a high-cardinality Grouping Column:

+-----------------------------------------------------------------------------------+
|                     Grouped Decision Matrix Architecture                          |
+-----------------------------------------------------------------------------------+
|  [Group Key: County_Code]                                                         |
|  ├── Group Partition 'ALAMEDA'                                                    |
|  │   ├── Commercial_Retail  │ 0 - 2,500 sq ft   │ Base Fee: $450  │ Plan Rev: $200 |
|  │   └── Commercial_Retail  │ 2,501+ sq ft      │ Base Fee: $900  │ Plan Rev: $400 |
|  ├── Group Partition 'ORANGE'                                                     |
|  │   ├── Commercial_Retail  │ 0 - 2,500 sq ft   │ Base Fee: $320  │ Plan Rev: $150 |
|  │   └── Commercial_Retail  │ 2,501+ sq ft      │ Base Fee: $680  │ Plan Rev: $300 |
|  └── Group Partition 'SAN_DIEGO'                                                  |
|      ├── Commercial_Retail  │ 0 - 2,500 sq ft   │ Base Fee: $400  │ Plan Rev: $180 |
|      └── Commercial_Retail  │ 2,501+ sq ft      │ Base Fee: $820  │ Plan Rev: $350 |
+-----------------------------------------------------------------------------------+

Operational Advantages:

  • Targeted Lookups: At runtime, the Expression Set passes the grouping key (e.g., County_Code = 'ORANGE'). The engine instantly scopes its search to only the Orange County partition, ignoring rows from all other counties. This drastically accelerates lookup speeds and conserves CPU memory.
  • Delegated Administration: Different regional administrative teams can manage their respective partitions without risking unintended modifications to neighboring jurisdictions.

Decision Tables Querying Salesforce Objects

While Decision Matrices excel at in-memory rate schedules, public sector agencies often require business rules that evaluate live CRM records. For example, an economic development grant program may maintain available grants in the standard Product2 or custom Funding_Program__c object, where non-technical caseworkers create and retire programs daily.

A Decision Table links the Business Rules Engine directly to a Salesforce sObject:

  1. Source Object Selection: The architect selects the source object (e.g., RegulatoryAuthorizationType or Program_Eligibility_Criteria__c).
  2. Field Mapping: Specific fields on the sObject are mapped to Input Conditions (supporting operators: =, !=, >, <, >=, <=, Between, In) and Output Fields.
  3. Real-Time Data Reflection: Whenever caseworkers update a funding balance or adjust an eligibility threshold directly on an sObject record, the Decision Table instantly reflects the updated policy in real time without requiring metadata deployment or CSV re-uploads.

Statutory Transparency: Decision Explanations & Audit Trails

In commercial commerce, an e-commerce platform has no legal obligation to explain to a consumer why a price was discounted by $10 or why a shipping charge was assessed. In stark contrast, public sector administrative law mandates absolute transparency.

Under constitutional due process, the Administrative Procedure Act (APA), and Freedom of Information regulations, whenever a government agency imposes a fee, denies a permit, or calculates a benefit award, the constituent has the statutory right to receive the exact legal justification, municipal code citation, and formula basis for that decision.

+-----------------------------------------------------------------------------------+
|                     Decision Explanation Processing Pipeline                     |
+-----------------------------------------------------------------------------------+
|  [Decision Matrix Lookup / Calculation Step]                                      |
|    • Condition Matched: Historic District Commercial Renovation                   |
|    • Fee Output: $1,250.00                                                        |
|                               │                                                   |
|                               ▼                                                   |
|  [Decision Explanation Linkage]                                                   |
|    • Explanation Code: CODE_HISTORIC_PRESERVATION_ACT_SEC_4                       |
|    • Explanation Token: Token_Historic_Surcharge                                  |
|                               │                                                   |
|                               ▼                                                   |
|  [Decision Explanation Message Template]                                          |
|    "Assessed a mandatory {0} historic preservation review surcharge in            |
|     accordance with Municipal Code § 14-B for commercial structures within        |
|     the designated Old Town Architectural Overlay District."                      |
|                               │                                                   |
|                               ▼                                                   |
|  [Public Sector Solutions Ledger / Audit Trail]                                   |
|    • RegulatoryTrxnFeeItem.Comments ──> Persists full statutory text              |
|    • BusinessLicenseApplication     ──> Logs decision audit record                |
|    • Citizen Portal Fee Breakdown   ──> Displays clear legal justification        |
+-----------------------------------------------------------------------------------+

Components of Decision Explanations in BRE:

  1. Explanation Codes & Tokens: Unique metadata identifiers associated directly with a Decision Matrix row, Decision Table outcome, or Expression Set step.
  2. Message Templates: Parameterized, human-readable text strings with placeholder tokens (e.g., {0}, {1}). The BRE engine dynamically injects runtime context variables—such as calculated fee amounts, applicant categories, or statutory citation references—into the template.
  3. Audit Trail Persistence: The generated explanation messages are passed out of the Expression Set and persisted onto child records (RegulatoryTrxnFeeItem.Comments, AssessmentQuestionResponse, or dedicated audit logs). When constituents download their official fee notice or dispute a charge during an administrative hearing, the agency produces an immutable, step-by-step record proving full statutory compliance.

Table Lifecycle Governance: CSV Import, Versioning & Simulation

Managing statutory tables containing thousands of rate combinations requires disciplined administrative workflows.

Bulk Management via CSV Import/Export

Configuring thousands of matrix rows through a web browser UI is slow and prone to human error. BRE provides native CSV lifecycle workflows:

  1. Template Export: Administrators generate and export a standardized CSV template from Setup containing the exact column schema (data types, input/output flags, range boundaries).
  2. Offline Authoring: Policy teams populate rate lines using spreadsheet software (Excel, Google Sheets), applying data validation rules and formulas to ensure formatting integrity.
  3. Validation on Upload: When uploading the CSV back into Salesforce, the BRE engine validates data types, verifies that numeric ranges do not contain corrupt characters, and confirms that picklist values match active platform definitions.

Versioning and Date-Effective Scheduling

Like Expression Sets, Decision Matrices and Tables support Draft, Active, and Obsolete states:

  • Draft Matrix Versions: Allow administrators to upload new CSV files, reorder rows, and adjust ranges offline without disrupting active production transactions.
  • Date-Effective Scheduling: Specifying Start DateTime and End DateTime on matrix versions enables automated policy rollovers aligned with fiscal years.
  • Simultaneous Activation: An architect can prepare Version 3 of an Expression Set that references Version 2 of a Decision Matrix, schedule both to become active at midnight on July 1, and ensure synchronized policy deployment across the entire platform.

Simulator Verification of Boundary Conditions

Before activating any matrix version, technical specialists must execute simulation test cases specifically targeting boundary edge conditions:

  • If a matrix defines Tier 1 as 0 to 2500 and Tier 2 as 2501 to 10000, the tester must execute simulations at 2500, 2501, and 2500.50.
  • Testing verifies that decimal inputs between whole numbers do not slip into unintended coverage gaps, and ensures that exact equality rows trigger the intended outputs without ambiguity.

💡 Real-World AP-222 Exam Scenarios

Scenario 1: Multi-County Environmental Health Food Safety Matrix

A state department of public health regulates food service establishments across 35 distinct counties. Each county board of supervisors establishes its own food establishment inspection fee schedule based on restaurant seating capacity and risk tier (High, Medium, Low risk). High-risk restaurants in urban counties require quarterly inspections, while low-risk establishments in rural counties require annual inspections. The state technical team must build a solution that allows each county to update its fees independently without causing system-wide regression.

What is the recommended architectural solution?

  • Architectural Solution:
    • Implement a Grouped Decision Matrix where County_Code serves as the primary grouping key.
    • Within each group, define Input Columns: Risk_Tier (Text, Exact Match) and Seating_Capacity (Number, Range Matching).
    • Define Output Columns: Base_Permit_Fee (Currency), Annual_Inspection_Frequency (Number), and Statutory_Code_Token (Text).
    • At runtime, the citizen intake OmniScript captures the restaurant county, capacity, and menu risk classification, passing them to an Integration Procedure.
    • The Integration Procedure invokes the Expression Set, scoping the Grouped Decision Matrix lookup to that specific county partition. The resulting fee and frequency are returned in single-digit milliseconds without scanning thousands of rows from other counties.

Scenario 2: Administrative Due Process Appeal on Zoning Permit Denial

A commercial property owner submits an application for a mixed-use retail permit in an urban renewal zone. The automated Expression Set determines that the proposed project falls into a high-density traffic congestion tier, requiring a mandatory $15,000 Transit Impact Assessment Fee and an extended 60-day architectural review. The applicant files a legal appeal under the state Administrative Procedure Act, claiming the city acted arbitrarily and failed to disclose the legal authority for assessing the fee.

How does the Public Sector Solutions Business Rules Engine defend the city's determination?

  • Architectural Defense:
    • During the automated evaluation, the Decision Matrix utilized Decision Explanations linked to the congestion tier lookup row.
    • The engine generated a parameterized explanation message referencing Municipal Code § 18.24.080 - Urban Transit Mitigation Surcharges.
    • This explanation token and populated message were automatically saved onto the RegulatoryTrxnFeeItem.Comments field and linked to the parent BusinessLicenseApplication audit history.
    • When the city city attorney reviews the appeal, the system produces an immutable timestamped audit log showing the exact inputs provided by the applicant, the matrix version active on that date, and the statutory citation, conclusively proving that the fee was assessed strictly in accordance with published law.
Loading diagram...
Decision Matrix Evaluation and Decision Explanation Pipeline
Test Your Knowledge

A state department of economic opportunity manages 150 local workforce development training grants. Grant eligibility criteria (such as target industries, maximum subsidy per trainee, and regional funding balances) are maintained directly by non-technical program specialists in standard Salesforce records on the custom object Training_Grant_Program__c. Caseworkers need the system to automatically evaluate incoming employer applications against these live grant records to identify qualifying programs. Which Business Rules Engine component should the solution architect deploy?

A
B
C
D
Test Your Knowledge

An implementation consultant is configuring a Decision Matrix that calculates municipal stormwater drainage fees based on total property impervious square footage. The statutory ordinance specifies: Tier 1 covers up to 2,000 sq ft; Tier 2 covers projects from 2,001 to 10,000 sq ft; and Tier 3 covers projects exceeding 10,000 sq ft. How should the column and row boundaries be structured to ensure correct evaluation?

A
B
C
D
Test Your Knowledge

Under state administrative procedure law, an environmental regulatory agency must provide an itemized legal justification and statutory municipal code citation on every constituent fee invoice. If an applicant challenges an assessed fee, the agency must produce an immutable audit log proving which rule version and legal authority generated the charge. Which declarative Business Rules Engine feature directly satisfies this legal requirement?

A
B
C
D