The first bit of information I have to share is about the scope of your rule. The documentation describes three scopes, activity, workflow, and project. However, the documentation doesn’t describe how you can set the scope of your rule. Moreover the code examples only show rules that will return the Activity scope. Here is how you can determine what scope your rule affects:
Here is the VariableLengthRule that is given as an example in the documentation:
Here is the code Get Method:
internal static Rule<IActivityModel> Get()
Note the method returns an object that implements the IActivityModel interface. This rule is scoped to the activity.
The rule for HardCodedDelays checks workflows for violations.
internal static Rule<IWorkflowModel> Get()
Note it’s return type is an object of the IWorkFlowModel interface. The scope of this rule will be the workflow.
Lastly, we have CheckProjectJSONFile exists. This rule applies to the project level.
internal static Rule<IProjectModel> Get()
The return object is of the IProjectModel interface.