docs

Create a Rule

A rule consists of properties that test and advise on how possible issues can be resolved and a check function that tests the application for a specific issue. To create a rule, you need to set the properties and add a check function.

For more information on how to create rules in the user interface, see Rules Management.

You can find best practices on how to create rules in Guidelines and Best Practices .


Properties

You need to set the following properties :

Property Description
ID The ID of the rule. It must be a valid camelCase string consisting of between 6 and 50 alphabetic characters.
Title The name of the rule in a readable format. It must be a valid string consisting of between 6 and 200 characters.
Audiences Describes what audiences the rule is intended for. You can have multiple audiences selected.
Categories Describes what the rule tests. You can have multiple categories selected.
Min version The minimum version the rule should be checked at. Possible values are <empty string\> and versions like 1.28, 1.44, etc.
Async Defines if the rule check function will contain asynchronous operations.
Description A short description of the rule.
Resolution A short advice on what to do to fix the issue generated by the rule.
Resolution URLs An array of key/value pairs of texts and URLs providing the links to documentation where the user can find how to fix the issue generated by the rule. You can have multiple resolution URLs. Key is `text` and value is `href`.
Check function Function that checks the application against the rule. It is described in more detail in the next section.

Check Function

The check function has three main and one optional parameters. The main ones are oIssueManager, oCoreFacade and oScope, and the optional one is fnResolve. Here is more information about them:

Remember:

Make sure to call issueManager.addIssue() in your check function so that issues can be seen in the analysis results.

Related Information

API Reference: sap.ui.support.ExecutionScope

Common Rule Patterns