I’m writing a plugin that has a BasePluginService class which provides functions to add/remove/update records in a plugin DB. There is also a BasePluginResource class providing the Rest endpoints for utilizing the methods from the Service class. The rest endpoints are used to read/create/update/delete entries in the plugin DB table.
I would like to re-use the DB functions in a customization rule to read data from the Plugin DB entries, instead of calling the rest API endpoints.
I have added the Resource and Service package names to the “scriptPackages” section in the plugin manifest, but getting some issues when calling the plugin functions in the customization rule.
Any advice on how to best expose the plugin functions for use in a customization rule?
I’m assuming your main objective is simply having an easy way to access data in the Plugins DB? If so, you should be able to initialize an instance of sailpoint.rest.plugin.BasePluginResource via: BasePluginResource bpr = new BasePluginResource();
Once that’s instantiated, you should then be able to get a java.sql.Connection to interact with the plugins DB via: Connection conn = bpr.getConnection();
At this point, you should have the connection and be able to read and manipulate data as needed using standard Java SQL techniques.