Custom Template Behaviors (formally known as Master Behaviors)

To simplify repetitive configuration tasks you can create your own Template Behaviors. These are sometimes referred to as Master Behaviors in Reactor (like a MasterSlide in a Powerpoint or Keynote Presentation).

Lets say you want to create for example a custom behavior for an Encoder that performs a preset recall left turn and a preset store push on a right turn. Additionally you want such an encoder to have a green ring light.

Afterwards you want to reuse this encoder on several places inside your configuration, controlling different preset IDs. That is a use case for creating a Template Behavior.

Creating and configuring Template Behaviors

Template Behaviors are a Tree Element and can be defined on a layer, following the usual scheme for Inheritance as explained in the Tree Chapter.

To keep things simple we recommend to create Template Behaviors on the global Root Layer of your configuration or the configuration layer related to your panel. In this example we will use the second option. You can select the configuration layer related to your panel using the layer icon next to the Section Selector.

image

Then go ahead and add a Template Behavior. Additionally you can use the "CopyFrom" function to copy the current behavior of a component into a new Template Behavior.

image
Create a Template Behavior

After that you can configure your Template Behavior just like any other Behavior. 1

Using Constant Definitions to add fields to the Template Behavior

When creating Template Behaviors it can often be useful to make certain parts of the nested configuration available on the top of the Behavior form. This is best done using Constants.

Constants can be defined by adding Constant Definitions to your Template Behavior. Type a name for the new Constant (1) and press create (2)

image
Editing the new Constant, make sure to choose a Type for the new field (1)

Once added the new fields will be available on the top of the form. (3)

Click on the definition to edit the properties of the new Field. You can choose its type, choose if it shall have an extra 'label' and limit how many values it can hold.

image
Editing the new Constant, make sure to choose a Type for the new field (1)

Using a custom Template Behavior

Once you have created your Template Behavior you can use it in the Template Behavior field of any Behavior that inherits it.

image
Selecting the new Template on a normal Behavior
1

Keep in mind that some features of the form might not be available, like checking conditions and correctly filtered parameter lists (in the parameter selection helper window)