Explain Business Rule Results to End Users
Learning Objectives
After completing this unit, you’ll be able to:
- Add explanation messages in expression sets.
- Discuss how to show explanations to users.
- Disable explanations in expression sets.
Create Explainability Message Templates
The Zercovanian government is trying to build trust with their citizens. It’s easiest to form trust when you act transparently. Jessica knows how important this initiative is, so she bakes a little special something into her expression set by adding explanations to rules. These explanations tell the citizens how a certain rule was executed and what the results are.
Zercovana’s Salesforce admin has already created and stored these explanations as explainability message templates.
Expression Set Element Name |
Explainability Message Template Name |
Message |
---|---|---|
Base Premium |
FamilyPremiumPass |
We've calculated your family premium based on your number of dependents. |
FamilyPremiumFail |
Something went wrong. We weren't able to calculate your family premium. |
|
Disability Severity |
DisabilitySeverityPass |
We've captured your disability severity status based on the status you entered from the provided options. |
DisabilitySeverityFail |
Something went wrong. We weren't able to capture your disability severity status. |
|
Additional Subsidy |
AdditionalSubsidyPass |
We've calculated the subsidy based on your disability severity and veteran status. |
AdditionalSubsidyFail |
Something went wrong. We weren't able to calculate the subsidy based on your disability severity and veteran status. |
|
Applicant Age |
AgeCalculationPass |
We've calculated your age based on the birthdate you provided in the contact details. |
AgeCalculationFail |
Something went wrong. We weren’t able to calculate your age based on the birthdate you provided. |
While creating expression sets, Jessica uses these templates to easily add explanations to expression set elements.
Add Explanations in Expression Sets
Jessica already has the explainability message templates available to her. She just has to associate them with the corresponding steps in the expression set to show the messages to users if the step conditions are met.
Here’s how to associate the explainability message templates to the Insurance Premium Calculation expression set.
- Click
[Alt text: App Launcher], then find and select Expression Sets.
- Select Insurance Premium Calculation.
- Select the Insurance Premium Calculation V1 expression set version to open it in the expression set builder.
- Click Deactivate if the expression set version is active.
- Click
.
- Select the Show decision explanation checkbox.
- Click Save.
- In the expression set builder canvas, select the Base Premium lookup table element.
- Click
.
- Under the Decision Explainer section, select Show decision explanation and specify these details.
- When Step Returns Output: FamilyPremiumPass
- When Step Errors: FamilyPremiumFail
- Similarly, assign these explainability message templates to the respective expression set elements.
Expression Set Elements |
When Step Returns Output |
When Step Errors |
---|---|---|
Disability Severity |
DisabilitySeverityPass |
DisabilitySeverityFail |
Additional Subsidy |
AdditionalSubsidyPass |
AdditionalSubsidyFail |
Applicant Age |
AgeCalculationPass |
AgeCalculationFail |
- Click Save.
Show Explanations to Users
Jessica is now excited to validate the explanations that she added in the expression set and see how it will appear to the users.
Here’s how she validates the explanations.
- Open the Insurance Premium Calculation V1 expression set version in expression set builder.
- Click Simulate.
- Enter the following details in the Variables section.
- Dependents:
3
- Veteran: True
- Dependents:
- Enter the following details in the Field Aliases section.
- InsurancePremium.DisabilitySeverity:
Mild
- InsurancePremium.ApplicantBirthdate: May 14, 1980
- InsurancePremium.ApplicantIncome:
35000
- InsurancePremium.DisabilitySeverity:
- Click Simulate.
- To view the explanations, click the Detailed View drop-down menu and select Concise View.
Here’s how the explanations appear.
Click View Details to view the element output or calculations.
You can see the output of the Base Premium lookup table calculated based on the number of dependents and veteran status input values.
Disable View Details
Jessica has been informed by the Zercovanian leadership that certain steps contain sensitive data and shouldn’t be shown to users. So, she disables the View Details section for a step element.
- In the Insurance Premium Calculation V1 expression set version, select the Base Premium lookup table element.
- Click
.
- Deselect Include in Output.
- Click Save.
Here’s how to validate the change.
- Click Simulate.
- Enter the following details in the Variables section if they aren’t populated by your last test.
- Dependents:
3
- Veteran: True
- Dependents:
- Enter the following details in the Field Aliases section if they aren’t populated by your last test.
- InsurancePremium.DisabilitySeverity:
Mild
- InsurancePremium.ApplicantBirthdate: May 14, 1980
- InsurancePremium.ApplicantIncome:
35000
- InsurancePremium.DisabilitySeverity:
- Click Simulate.
- To view the explanations, click the Detailed View drop-down menu and select Concise View.
The View Details section is now disabled for the Base Premium element.
Jessica can now enable or disable the View Details section while showing the decision explanations for any expression set element.
Disable Explanations for a Step Element
Now, Jessica is aware that there are situations where she doesn’t want to show the explanations for certain step elements.
Here’s how she disables explanations for an element.
- In the Insurance Premium Calculation V1 expression set version, select the Disability Severity calculation element.
- Click
.
- Deselect Show decision explanation.
- Click Save.
Here’s how she validates this change.
- Click Simulate.
- Enter the following details in the Variables section if they aren’t populated by your last test.
- Dependents:
3
- Veteran: True
- Dependents:
- Enter the following details in the Field Aliases section if they aren’t populated by your last test.
- InsurancePremium.DisabilitySeverity:
Mild
- InsurancePremium.ApplicantBirthdate: May 14, 1980
- InsurancePremium.ApplicantIncome:
35000
- InsurancePremium.DisabilitySeverity:
- Click Simulate.
- To view the explanations, click the Detailed View drop-down menu and select Concise View.
Here’s how the output with decision explanation looks like.
Notice that the decision explanation for the Disability Severity element is no longer shown.
Healthy Outcomes for Zercovana
Jessica is excited to know that the Zercovana government’s initiatives and requirements are easily captured digitally using Business Rules Engine components. She can add complex rules to calculate the subsidies for the citizens who meet different subsidy criteria. Now, it’s easy to calculate the final health insurance premium amount for the various sections of the society. The Zercovana government is ready to implement its various social programs faster through digital transformation tools such as Business Rules Engine.
In this module, you learned how to create decision matrices and use them in expression sets to create advanced rules. You got to know how to test an expression set using Salesforce Flow. Plus, you explored how to add decision explanations to step elements to see additional details for a step. Now, you’re ready to build more advanced rules using Salesforce Business Rules Engine.
Resources