ClassLoader and 3rd-party libraries in Plugin

You can expose classes from a plugin by mentioning them in manifest:

<Plugin>
    <Attributes>
        <Map>
            <entry key="scriptPackages">
                <value>
                    <List>
                        <String>Put Package names here (package, not class)</String>
                        <String>com.abc.package1</String>
                    </List>
                </value>
            </entry>
        </Map>
    </Attributes>
</Plugin>

Then you can access them (e.g. inside a rule), using the class PluginsUtil:

sailpoint.plugin.PluginsUtil.instantiate(...)

to obtain an instance of that a class exposed from manifest. IIRC you can also use PluginsUtil from inside a plugin.

Inside BeanShell (rule, workflow, etc.) you can depend on lazy binding and just call the methods on the object instance returned by PluginsUtil.instantiate().

Inside a Plugin you’ll be using Java, so you will have to use Reflection to get access to the methods and members.

1 Like