Loading
Public Sector Documentation
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
          Automatically Create a Fee for an Inspection or Enforcement Action

          Automatically Create a Fee for an Inspection or Enforcement Action

          Build automation that creates a regulatory transaction fee from an inspection visit or a violation enforcement action in Public Sector (formerly Public Sector Solutions).

          Required Editions

          View supported product editions.
          User Permissions Needed
          To create decision matrices: Rule Engine Designer
          To create, update, and delete expression sets: Rule Engine Designer

          Create a Decision Matrix to Calculate a Fee for an Inspection or Enforcement Action

          Create a decision matrix that calculates a regulatory transaction fee from an inspection visit or a violation enforcement action.

          Use Business Rules Engine to automatically calculate fees associated with inspections or enforcement actions. First, set up a decision matrix that contains input values in one column and output values in another column. When an expression set calls the decision matrix, it finds the table row that matches the input values, and returns that row’s output values. For example, set a base fee for each zip code that you serve in a lookup table.

          1. From the App Launcher (App Launcher icon) find and select Business Rules Engine.
          2. Click the app navigation menu and select Lookup Tables.
          3. Click New, and then select Decision Matrix.
          4. Click Next.
          5. Specify these details.
            1. For Name, enter Base_Application_Fee.
            2. For Type, select Standard.
          6. Save your work.
          7. On the record page of the decision matrix, on the Related tab, select version 1 of the matrix.
          8. To define your input and output data, add columns to the matrix.
            1. Click Add Column. For Column Header, enter ZipCode, for Header Type select Input, and for Data Type select Number.
            2. Click Add Column. For Column Header, enter BaseFee, for Header Type select Output, and for Data Type select Currency.
            3. Click Done.
          9. Add these input and output data values in separate rows of the matrix.
            Input Data Output Data
            Zip Code (Number) BaseFee (Currency)
            73933 $116
            49448 $153
            18195 $85
            85215 $118
            72366 $163
            07305 $142
            11581 $82
            43027 $112
          10. Activate the decision matrix.

          Build an Expression Set to Calculate a Fee for an Inspection or Enforcement Action

          Create an expression set that calculates regulatory transaction fees using a lookup table and variables.

          In the expression set, configure a step to call the input and output values in a decision matrix. Create variables to assign values for additional fees and other parameters. Then, configure calculations that use the lookup table and variables to calculate an additional fee and a total fee.

          For example, create an expression set to calculate a base fee using the zip code of the establishment, an additional fee based on the number of seats in the establishment, and a total fee that combines the two fees.

          Create an Expression Set

          Create the expression set to perform fee calculations based on the lookup table inputs and outputs and other parameters.

          1. From the App Launcher (App Launcher icon) find and select Business Rules Engine.
          2. Click the app navigation menu and select Expression Sets.
          3. Click New.
          4. For Name, enter Application_Fee.
          5. For Usage Type, select Default.
          6. Save your work.

          Create Expression Set Resources

          Create variables and constants to store values for calculations.

          1. On the record page for your new expression set, select version 1 of the expression set.
          2. Click Resource Manager icon, and then click Add Resource.
          3. Specify these options.
            1. For Resource Type, select Variable.
            2. For Resource Name, enter Base_Fee.
            3. For Data Type, select Currency.
            4. For Decimal, enter 0.
          4. Click Done And New.
          5. Specify these options.
            1. For Resource Type, select Variable.
            2. For Resource Name, enter Additional_Fee.
            3. For Data Type, select Currency.
            4. For Decimal, enter 0.
          6. Click Done and New.
          7. Specify these options.
            1. For Resource Type, select Variable.
            2. For Resource Name, enter Total_Fee.
            3. For Data Type, select Currency.
            4. For Decimal, enter 0.
          8. Click Done and New.
          9. Specify these options.
            1. For Resource Type, select Variable.
            2. For Resource Name enter Seating_Capacity.
            3. For Data Type, select Number.
            4. For Decimal, enter 0.
          10. Click Done and New.
          11. Specify these options.
            1. For Resource Type, select Constant.
            2. For Resource Name enter Seating_Capacity_Base_Fee.
            3. For Data Type, select Currency.
            4. For Decimal, enter 0.
            5. For Default Value, enter $25.
          12. Click Done.

          Configure a Lookup Table Element

          Add a Lookup Table element to call inputs and outputs from a decision matrix.

          1. Click Add Element icon in the Expression Set canvas and select Lookup Table. In the Lookup Table Details field, search for and select Base_Application_Fee. Then, click Element Details icon and name the element Get Base Fee.
          2. In the Set Base Fee element, select Map Variables.
          3. Expand Output Variables.
          4. For Action, select Map, and then search for and select Base_Fee.
          5. Click Done.
          6. In the Element Details panel, name the lookup table element Set Base Fee and select Include in Output.

          Configure Calculation Elements

          Add Calculation elements to calculate the additional fee based on seating capacity and the total fee.

          1. Click Add Element icon after the Decision Matrix and add a Calculation element.
          2. For Formula, enter Seating_Capacity * Seating_Capacity_Base_Fee.
          3. For Output Variable, enter Additional_Fee.
          4. In the Element Details panel, name the calculation element Compute Additional Fee and select Include in Output.
          5. Click Add Element icon in the canvas and add a Calculation element after the Compute Additional Fee step.
          6. For Formula, enter Base_Fee + Additional_Fee.
          7. For Output Variable, enter Total_Fee.
          8. In the Element Details panel, name the calculation element Compute Total Fee and select Include in Output.
          9. Save your work.
            Before activating your expression set, run simulations with default and custom test input variables. For example, enter a number for seating capacity and enter a zip code that’s listed in the decision matrix, and click Simulate. If the expression set doesn't work as expected, edit the elements and simulate again. When you're satisfied, activate it.
           
          Loading
          Salesforce Help | Article