Creating a custom operator
Prerequisites
To create custom operators, we recommend using DIS with Visual Studio. DIS does not provide a direct template to create a custom operator; however, the template for an ad hoc data source can be reused. The source code of custom operators can also be viewed and edited in the Automation module within Cube, but this is not meant for maintaining extensions.
In order to create a GQI custom operator, you need to reference the GQI extension API.
Operator creation
Creating a new custom operator source project
Create a new project in Visual Studio.
Search for the DataMiner Ad Hoc Data Source Solution template.
Specify a name for the solution.
Under Additional information, fill in the name and author for the operator, and select the lifecycle interfaces you want to implement.
Click Create.
The template creates a C# class file with the name of the data source.
To alter the file to be a custom operator, find the class that currently implements the IGQIDataSource interface and instead have it implement the IGQIOperator interface.
Any class within the project that implements this interface will be discovered by GQI and used as an operator.
Above the class, the GQIMetaData attribute is set. This attribute sets the display name of the operator in the Dashboards app or Low-Code Apps. If this attribute is not present, the name of the class is displayed instead, which may not be very user-friendly.
Tip
For a full example of a custom operator implementation, see Optimizing your custom operator.
Deploying the custom operator
The custom operator can be deployed similar to how you deploy an automation script using DIS. For more information, see Publishing with DIS.
Using the custom operator
In the Dashboards app or Low-Code Apps, when selecting an operator, select Apply custom operator.
In the Operator dropdown box, select the name of your custom operator.
Depending on how the script is configured, there can be additional configuration possibilities. You can for instance use the IGQIInputArguments interface in the script to define that a specific argument is required.
Important
Custom operators are identified by a combination of their script name, library name, and class name. Changing any of these values will cause existing queries to stop working, because they will no longer be able to find the script based on the identifier they are using.
Tip
See also: Best practices for developing GQI extensions.