I have created a custom activity and converted to a library successfully.
I wanted to add in workflow rule ST-USG-026 as a required activity of allowed activities
and Enforce analyzer to error when activity is not in the project.
But during run, other activity restrictions are showing that is also needed.
I did not add the custom activity in my project and wanted to see if it errors and it did not.
How can I make sure that the activity errors during run when custom activity is not in the project?
Can you please share screenshots on how you have defined the list in the rule?
Also please make sure that you are specifying the name of the activity properly in the rule like all other activities?
May be to cross check this, you can include that package in your project first and then see how does it appear in your project.Json file and then accordingly provide the same details in the analyzer rule and see?
Seems like some confusion, let’s get requirements clear first:
You want to ensure that activity that you have created should be there in your project, right? And if it is not there, then analyzer should throw error, right?
If answer is Yes to above question, then please note that the rule ST-USG-026
will throw error only when you are trying to use activities that are not allowed but if there are any activities that are allowed and are not part of the project, there wont be any errors.
To ensure the presence of required packages in your project, you need to use another rule ST-USG-027 which does a check on all required packages/activities and if those are not there in the project, an error will be thrown.
As an example, if I add below to the list of required packages and if I have not added this package in my project or even if it is added in the project but version is <20.10.8, then an error will be thrown. I believe this is your requirement(to ensure the presence of your custom package in the project), right?
This behavior can be enforced using ST-USG-027 itself which ensure if activity is not there, error is thrown.
Please note, when you are mentioning activity , you are referring to the custom package itself that you have created. I think its just a different terminology you are using here.
After adding this custom activity/package details in rule ST-USG-027, you will notice if you don’t add this dependency in your project, you are being thrown error.
ST-USG-026 is not about ensuring what is required in the project but about what is allowed and what is not allowed to be in the project. And if anything is being used what is not allowed, then only error will be thrown. You wont see an error thrown if some activity is allowed but you have not used it.
I understand that the package is enforced if ST-USG-027 is chosen.
I have successful behavior using this. ST-USG-027 only requires the package in the project.
Now, assuming the custom package is already in project dependencies and in the list of activities, if I did not use the activity in my project, I wanted to flag an error that the activity is not chosen/added/used. Is there a rule to require activity in the project?