Skip to content

A pluggable condition interpreter that will compare sobject field values to the defined conditions

License

Notifications You must be signed in to change notification settings

gavinhughpalmer/condition-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Condition Interpreter

This project is a utility in apex that can evaluate user defined conditions, for example it can be used to perform in memory matching based on rules defined by a user.

Installation

The simplest installation option would be to install the unlocked package using one of the following links

  1. Production
  2. Sandbox

Alternatively this can be done in the command line using sfdx force:package:install --package 04t4K000001hjhqQAA

Usage

Usage is highlighted in the ConditionInterpreterTest class, the conditions can be defined and stored in a custom object / custom metadata.

The project came about with seeing that many managed packages in Salesforce development use some kind of custom object (/custom metadata) to perform some kind matching logic to records in the system to apply some kind of rules to those. Seeing as this was a widely used process I thought it would be good to have some kind of reusable option for achieving this. The classes that I have written here is withdrawn from whichever option is chosen for users to define the criteria (wheather it is in a custom object, custom metadata or on a page).

Future Phases

  • Include logic to create a dynamic soql based on the conditions so that only the records that are being refrenced get queried
  • Add better error handling for the conditions, so that the correct name of the operator is output rather than the base operator that ends up being used

About

A pluggable condition interpreter that will compare sobject field values to the defined conditions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published