A tool action is a class that can be instantiated to run a process on a data stream.

Tool actions are used in the Rule Engine and in the Toolbox.

Creating a new Tool Action

To create a new Tool Action, you need to inherit from either :

  • ActionIn<Input> : Inherit from this class to create an end point (it takes data in but doesn't output anything)
  • ActionInOut<Input, Output> : Inherit from this class to create an in and out action (the most common type of action)
  • ActionOut<Output> : Inherit from this class to create a starting point (it takes no data in but ouputs data)

You can use Pixyz > Toolbox > Create new Toolbox Action or Pixyz > RuleEngine > Create new RuleEngine Action to create a new script template.

The scripts needs to be in an Editor folder to work.

Adding Parameters

Parameters can be added by adding fields and marking them with the [UserParameter] attribute.

A parameter can by of type class, struct, list, enum or base type such as string or int.

For each parameter, the GUI (in the Toolbox or Rule Engine) will automatically display the proper input.

Adding Helper Methods

Helper Methods are parameterless methods that can be executed through the Rule Engine

To create one, mark your method with the [HelperMethod] attribute.

Then, the helper method can be access through the [...] button on the Action block in the Rule Engine :

Errors, Warnings and Infos

It is possible to override methods such as getErrors() to implement -for example- a parameter checking method to display an error when a parameter is incorrectly entered.

For more information, please check the API Documentation.