Activation of Configurable rules multiple times

Hello,

i wrote a custom rules to check if some methods are annotated with a configurable annotation. As it is configurable i may want to check if both “MyAnnotation” and “AnotherAnnotation” is present but i can activate the rule only one time in a profile and if i create a parent profile with a different rule configuration the rule is overridden.

Hello @tassadar

If I understand your question correctly, I think you are looking for “Rule Templates”. See “Rule Templates and Custom Rules” in the Rules documentation.

Concretely, you simply have to add the key of your rule to this list in the JavaRulesDefinition.

Hope it helps,
Quentin

Hello @Quentin,

i’ve modified my code as you suggested and it perfectly works like as i need thanks!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.