Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Calling a function defined in a plug-in is done via the intrinsic functions RUNPLUGIN (returning a value) and RUNPLUGIN$ (returning a string).

Knowledge Engineer Side

Place the plug-in (the .dll file) in the knowledgebase folder under Applic\Plugins\

The KE has to define the return type, the name, the version and  the input parameters for the function.

...

The communication with Quaestor is done by implementing the interface IQFunctionPlugin and using the attributes defined in the IQPluginMetadata interface. Both of them are defined in the QInterfaces.dll . This library will soon be is available on the MARIN nuGet server.

Code Block
languagecsharp
titleIQFunctionPlugin
linenumberstrue
    /// <summary>
    /// Defines a method to be called by Quaestor.
    /// </summary>
    public interface IQFunctionPlugin
    {
        /// <summary>
        /// Defines a function to be executed by Quaestor.
        /// The KE must inform the developer about the return type and the order and types of the input values
        /// </summary>
        /// <param name="errorMessage"></param>
        /// <param name="inputValues">Contains the input values; it can contain only string and double.
        /// The order and type are specified by the KE.</param>
        /// <returns>The result of the calculation. It can be only string or double.</returns>
        object Compute(out string errorMessage, List<object> inputValues);
    }

Implementation

Steps in implementing a Quaestor plug-in:

  1. Create a class library project in Visual Studio
  2. Add reference to the QInterfaces.dll (available via the MARIN nuGet server)
  3. Add reference to System.ComponentModel.Composition
  4. Create a class that will implement the method called by Quaestor
  5. Add the Export and ExportMetadata attributes to the class
  6. (optional) Create as many classes as needed to be called by Quaestor; create a GUI project to test the classes

Each new function needs to be implemented in a separate class that inherits from the IQFunctionPlugin interface.

...