Best Practices to limit application of LogicModules?
I have a user who wants a couple of LogicModules installed to our LM portal. They don't want to impact the rest of the portal, and I agree. Therefore we would like the LogicModule to apply only to a specific resource group (and its children).
However the LogicModule uses "hasCategory" in the AppliesTo and it would be added to 6000+ devices on the portal, which have that category. The only way I know to limit the application of the LogicModule would be to make a custom edit to the datasource, which I dont want to do, OR to disable the datasource on resource groups where I dont want it applied.
But the problem with disabling it at the resource group folder is that I believe the parent folder overrides the children. So I cant turn it off at the top levels and then enable it on one folder deep within the resource tree. I believe I would have to disable it at every folder under (root) except the one containing the sub-folder, and then go into that sub-folder and disable it on all the child resource group folders EXCEPT the one containing the target, and disable it there too, and keep repeating that disable-as-I-zoom in technique, in order to make it work.
Is there any better way to do this that I havent thought about? Thanks.
Your initial notion of using the resource group in the AppliesTo is what I would recommend as the most scalable way to handle this. With the current module exchange, you can preserve the AppliesTo through module updates and the module would otherwise be as designed and support would be able to assist should issues arise in the future as no functional changes were made, just the appliesTo field. Make sure when you save the edits, you clarify the changes in the notes.
My recommendation would be to make the AppliesTo of the datasource something like
hasCategory(<example>) && join(system.groups,",")=~"<examplegroupname>"
so it only applies to the desired devices that reside within the example group and which also receive the correct system.category value. Trying to manage the application of modules at the group level isn't that sustainable as it will respect the current group membership, but new devices could still be added.