Creating a Measure Factory Plugin

Plugins are installed in the /plugins folder of the factory project. Each plugin is a sub-folder and must have a cfg.factory-plugin file that defines the plugin inputs and outputs. Use the name specified in the factory-plugin script to name the subfolder.

Depending on the complexity of your plugin, you might want to construct and test the Integrator or Spectre Build script separately. Construct or collect some data that mimics the expected data set that the factory generates. Then, you can test the data transformations that are coded in the Integrator or Build script. If the script requires complex rules that the factory produces, try using data from a prior factory run. Ideally, you want to do basic testing without needing to run the entire factory. See Test Data for a Plugin.

First, create the plugin folder, the plugin file, and the data transformation script. This example uses Integrator.

  1. Open your factory project and locate the plugins folder.
  2. Right-click the plugins folder and select New > Folder.

    A new folder is created and selected.

  3. Name the folder for your plugin, for example, Concat.
  4. Select this folder. Right-click and select New > New Measure Factory Plugin.

    A new factory plugin file is created and selected.

  5. Rename the file to cfg.factory-plugin.

    New Plugin Template

  6. Right-click on your plugin folder (for example, Concat) and select New > Integrator Script.

    On the left side of the screen, in the Workbench Explorer pane, a new script is created and selected. On the right side of the screen, a blank data flow canvas displays.

  7. Rename the New Integrator Script.int. You can name it for its purpose, for example, concat.int.
  8. Construct or copy an Integrator script by doing one of the following steps:

    • Construct a new Integrator script by adding objects one-by-one and testing the results.

    • Copy your tested Integrator script into your new script file, for example concat.int, in the plugin folder.
  9. When testing is satisfactory:

    1. Select the input object in the Integrator script and change the input to $(input_cbase).
    2. Select the final output object in the script and change the output to output.cbase.

Next, update the factory plugin configuration file to define the plugin inputs and outputs:

  1. If needed, locate the cfg.factory-plugin script, right click and select Open with > Text Editor.

    The template opens:

    Measure Factory Plugin Script Template

  2. For the name tag, change "Plugin Name" to the name of your plugin, for example, Concat. Note that the name is case sensitive.
  3. Insert a description tag and describe the purpose of the plugin and the script that is invoked.
  4. For the input tag, change "Input Name" to the name of the expected input cBase. Typically the input cBase name is the same as the plugin name, for example, "Concat".
  5. In the input block, specify the column and data type for each cBase element to be used by the Integrator script.
  6. For the integrator-script tag, change "script-filename.int" to the name of your Integrator script, for example, "concat.int", to identify the script to run for the plugin.
  7. In the output block, for the dimension tag, change "Dimension Name" to the dimension output by the plugin. This dimension is used as a lookup key to join the plugin data back into the factory data set used as input to the plugin.

    IMPORTANT: If you are using this Plugin as input for a data set, or as a Setup Plugin, remove the dimension tag.

  8. For the column tag, change "Output Column Name" to the non-dimension column in the output which contains the results of the plugin logic. Be sure to include the data type.
  9. Edit the factory configuration file to bring the plugin's results into a data set. See Creating Plugin Rules and Using an Existing Data Set as Data Input.