Custom Rules
Release Note: Custom Rule Creation
We're excited to announce implement core 2.30 and with it, the ability to create custom rules! With this new feature, users can now define and enforce organization-specific standards and best practices tailored to their unique requirements by leveraging our compiler or creating completely customized typescript functions.
Key Features:
- Custom Rule Interface: Define custom rules that adhere to the
IRuleDefinition
interface, specifying properties such as name, label, description, supported types, and more. - Flexible Rule Configuration: Configure custom rules alongside default rules using the rules section of the scanner's configurations, allowing for fine-grained control over rule enforcement.
- Exception Handling: Specify exceptions at the flow, rule, or result level to exclude specific scenarios from rule enforcement, providing flexibility in rule application.
Getting Started with Custom Rule Creation:
- Rule Structure: Define a custom rule class following the structure outlined in the Custom Rule Interface section of our documentation.
- Implement Execute Method: Implement the
execute
method within your custom rule class to perform the desired logic for rule enforcement. - Adhere to Interface: Ensure your custom rule class adheres to the
IRuleDefinition
interface, defining required properties and methods for a rule definition. - Configure Rules: To load custom rules using the Lightning Flow Scanner Core, you can utilize the
path
attribute within the rules section of your configurations. This attribute allows you to specify the path to your custom rule class.
{
"rules": {
"<RuleName>": {
"path": "<Path>"
}
}
}
By leveraging the path
attribute, you can easily incorporate custom rule definitions into the Lightning Flow Scanner Core, tailoring rule enforcement to your organization's specific requirements.
For more details and examples, refer to our Custom Rule Creation Guide