Load plugin based on Nx Witness version



1 comment

  • Avatar
    Andrey Terentyev


    The case is that user copy both plugins to the "plugins" folder.

    In this case, since the binary filename is the same, the only file remains.

    Is it feasible that for Nx Witness Server 4.2, it can load A plugin, and do not load B plugin?

    No, it's not. Most probably, the plugin for the v5 won't be loaded into v4.2 Server. V5.0 feature won't work in v4.2. Anyway, we don't recommend doing that.

    You could refactor your plugin code in two ways.
    1. Detect server version and organize computation flow depending on the Server version.

    Server version can be obtained by the IUtilityProvider::serverSdkVersion() of the Plugin class.

    2. Refactor your code into sections designed for v4.2 and v5.0 respectively. When your plugin is being loaded, you could detect server version and select the corresponding code.

    Here is how you could be implemented technically.

    In the Plugin::doCreateEngine() you detect the Server version and return either v4.2 Engine class instance or v5.0 Engine class instance.


    Comment actions Permalink

Please sign in to leave a comment.