Instantiating Nested Configurators


When your user instantiates a nested configurator at run time, you can choose how and where it will appear.  It can be added either at the root level of the page tree, or beneath a page you specify. Instantiation may be done by rules or by user interaction in the UI. Both methods allow for the addition and removal of nested configurators. Other actions, such as copying, may only be done by user interaction.

Instantiation By User Interaction (Configurator Level)

When a configurator is specified to be added at the configurator level, the 'Add' hotspot will appear at the bottom of the tree when ever a root level page has the mouse focus. Clicking the hotspot will add a nested configurator.

'Copy' and 'Remove' hotspot will appear at the top of the middle pane whenever the instantiated configurator has the mouse focus. Clicking the hotspot will copy or remove the configurator with focus.

Instantiation By User Interaction (Page Level)

Instantiation Through Rules

When a configurator is specified to be added at the page level, the 'Add' hotspot will appear at the top of the middle pane whenever the specified page has the mouse focus. Clicking the hotspot will add a nested configurator.

'Copy' and 'Remove' hotspot will appear at the top of the middle pane whenever the instantiated configurator has the mouse focus. Clicking the hotspot will copy or remove the configurator with focus.

Adding

Instead of allowing your user to add as many nested configurators as they want, you can add them programmatically to follow business rules.

Removing

Instatiation of nested configurators though the rules is usually done in the 'Loaded' or 'Value' rules. One or more children may be instantiated at the same time. To add a single instance, the 'Add nested configurator' Snap block is usually used as in the following example.

In the above example, the configurator will be added only if an instance with the name "Pin 1" does not already exist.

The 'Set number of nested configurators' Snap block is used to instantiate a total number of children as in this example that sets the quantity to 2.  If there are any more configurators already existing at that location than the number you specify, they will be removed.

Note that if the above example is done in the Loaded rule, which runs only once, the user will be able to add more or delete the current instances during run time. If done in a Value rule, which runs after every user change to the UI, adding or removing an instance manually does not matter: this rule will always set the total number back to two.

The 'Remove nested configurator' Snap block is used to remove a specific instance. Either the name or object reference may be used to specify which instance to remove. In the below example, the first rule uses the name to remove an instance with the name of "Pin 1". The second rule uses an object reference to remove the 2nd child in the nested configurators collection.

Was this article helpful?