Loading
Business Rules Engine
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Create and Configure Your Expression Set Version

          Create and Configure Your Expression Set Version

          When you create an expression set, the first version is created automatically and suffixed with V1. An expression set version is a blank and usable version of your expression set. Configure variables and constants in your expression set and then create steps that call decision matrices or decision tables and perform calculations or evaluate conditions.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Unlimited, and Developer Editions for clouds that have Business Rules Engine enabled
          User Permissions Needed
          To create, update, and delete expression sets Rules Engine Designer
          To run expression sets in Business Rules Engine Rules Engine Runtime
          Important
          Important Create and activate all decision matrices, decision tables, or sub expressions that you plan to call in your expression set.

          Create an expression set named StudentDiscountCalculation. This expression set calculates the fee for students based on the values that they enter in a form and the eligibility for discounted fees defined in our decision matrix.

          Note
          Note Ensure that the name of an expression set and the expression set version starts with a letter and doesn't exceed 75 characters, including spaces. Don't start names with numbers and special characters.
          1. From App Launcher (App explorer icon.), find and select Business Rules Engine.
          2. Click the app navigation menu, and then select Expression Sets.
          3. Click New.
          4. For name, enter StudentDiscountCalculation.
          5. Select a usage type, and save the expression set.
            The expression set’s first version is created by default.
          6. If needed, select Initiatlize resources with default values.
            If this checkbox isn't selected, expression set version resources are initialized with null values.
          7. To open the version in Expression Set Builder, from the Expression Set Versions area, select StudentDiscountCalculation V1.
          8. Set the version’s properties:
            1. Click Gear icon, which opens the properties panel., and then enter a start date time and an end date time for the expression set version.
            2. Enter a rank number.
              Note
              Note When more than one enabled versions match an expression set call, and the date-time periods overlap, the version with the highest rank is chosen. For example, if two enabled versions have rank values set to 1 and 2, the version with rank 2 is chosen.
            3. Close the Expression Set Properties panel.
          9. Create resources to use in the version steps:
            1. Click resource manager icon.
            2. Click Add Resource, and then create these resources.
              Note
              Note After adding a resource, to add the next resource, click Done and New. After adding all required resources, click Done.
              Variables
              Variable NAME Data Type Decimal
              StudentBirthdate Date 0
              StudentAge Number 0
              GPA Number 2
              QuoteAmount Currency 2
              QuoteAmountAdjusted Currency 2
              Constants
              Constant Name Data Type Decimal Default Value
              Discount Percent 0 15
              HundredPercent Percent 0 100
          10. To calculate the age of a student based on their birth date, add a Calculation step to the version.
            1. Click Add icon in expression set builder canvas. in the expression set canvas, and then select Calculation.
            2. In the Formula field, search for and select AGE (Date).
            3. Replace Date in Age (Date) with StudentBirthdate so that the Formula looks like this: Age(Birthdate).
            4. In the Output Variable field, search for and select StudentAge.
          11. To look up the discount eligibility of a student based on a combination of age and GPA, add a decision matrix:
            1. Click Add icon in expression set builder canvas. in the expression set canvas, and then add a Decision Matrix element after the Calculation step.
            2. Search for and select StudentDiscountEligibility.
              The variables and constants from the decision matrix appear automatically.

              Image showing the input and output variables from the decision matrix that is added to the expression set.

          12. To calculate the quoted fee, add another Calculation step:
            1. Click Add icon in expression set builder canvas. in the expression set canvas, and then add the Calculation element after the Decision Matrix step.
            2. In the Formula field, search for and select QuoteAmount.
            3. In the Output Variable field, search for and select QuoteAmountAdjusted.
          13. To evaluate whether a student is eligible for a discount, and then to calculate the discounted fee, add a Conditional Group step:
            1. Click Add icon in expression set builder canvas. in the expression set canvas, and then add the Conditional Group element after the Calculation step.
            2. In the Condition element that's part of the Conditional Group, for Resource search for and select StudentDiscountEligibility__Qualified.
            3. For operator, select Equals.
            4. For Value, select true.
            5. Click Add icon in expression set builder canvas. in the Conditional Group, and then add the Calculation element within the conditional group.
            6. In the Formula field, search for and select this series of variables and operators: QuoteAmount * (HundredPercent – Discount).
            7. Select the Include in Outputcheckbox.
            Important
            Important The Conditional Group step runs only if the condition in the group evaluates to true.
          14. Save the version.
           
          Loading
          Salesforce Help | Article