Stepper Triggers

In a stepper, it is possible to automate data changes using triggers and enrichers.

Data changes run when certain events take place in the stepper. For example, when the user enters a stepper or a step, modifies a field value or leaves a step.

Triggers and Enrichers in Steppers

Automated data transformations include:

  • Stepper Triggers that execute database procedure calls when the stepper starts or finishes.

  • Step Triggers that execute enrichers or database procedure calls when the user enters, leaves or performs certain operations in the step.

  • Form Step Enrichers that run enrichers when the user opens a form step or modifies data in this form step.

Triggers refer either to Enrichers or Database Procedures.

Create Stepper Triggers

A stepper trigger can execute a procedure declared in the model. Enrichers cannot be attached to the stepper as procedures can. This is because enrichers always affect an individual record and must therefore be attached to the relevant step. Procedures may be attached to steps or to the stepper itself.

To create a stepper trigger:

  1. In the Stepper editor, scroll down to the Triggers table.

  2. In the table toolbar, select the Add Stepper Procedure Trigger Add Stepper Procedure Trigger button. The Create New Stepper Trigger wizard opens.

  3. In the Stepper Trigger wizard step, enter the following values:

    • Name: Internal name of the object.

    • Procedure: Select a Database function defined as a procedure in the model.

    • Event: Select the event that should cause this procedure to run.

  4. Click Next.
    The Configure Procedure step of the wizard displays the arguments of the selected procedure.

  5. For each argument, click the edit expression button Edit Expression button to create a SemQL expression that will be bound to the argument.

  6. Click Finish to close the wizard. A stepper trigger is created

  7. Select this stepper trigger and then use the Move Up and Move Down buttons in the toolbar to order the list of triggers. Triggers, for a given event, are executed in the list order.

Create Step Triggers

A step trigger can execute either a procedure or an enricher on specific step events.

To create a step trigger:

  1. In the Stepper editor, scroll down to the Steps tree table.

  2. Select the step you want to modify.

  3. In the Properties view, select the Step Triggers finger tab.
    This tab shows a table with the list of triggers for the step.

  4. In the table toolbar, select the Add Step Procedure Trigger Add Step Procedure Trigger button or the the Add Step Enricher Trigger Add Step Enricher Trigger button. The Create New Step Trigger wizard opens.

  5. In the Step Trigger wizard step, enter the following values:

    • Name: Internal name of the object.

    • Procedure/Enricher: Select a database function declared as a procedure or an enricher.

    • Event: Select the event that should cause this procedure or enricher to run.

  6. If you create a Step Procedure Trigger:

    1. Click Next. The Configure Procedure step of the wizard displays the arguments of the selected procedure.

    2. For each argument, click the edit expression button Edit Expression button to create a SemQL expression that will be bound to the argument.

  7. Click Finish to close the wizard. A step trigger is created

  8. Select this step trigger and then use the Move Up and Move Down buttons in the toolbar to order the list of triggers. Triggers, for a given event, are executed in the list order.

Configure Form Step Enrichers

A form step enricher executes an enricher when the user enters a form or modifies the value of a form field.

To configure step enrichers:

  1. In the Stepper editor, scroll down to the Steps tree table.

  2. Select the form step you want to modify.

  3. In the Properties view, select the Form Step Enricher finger tab.
    This tab shows a table with the list of enrichers defined for the fields that appear for this form step.

  4. Click the Synchronize Form Step Enrichers Synchronize Form Step Enrichers button in the table toolbar to refresh the list with new enrichers.

  5. Check the appropriate option to run enrichers:

    • On Form Open: When the user opens the form. Note that the enricher is triggered every time the user opens the form, including when resuming the stepper or when returning from another step.

    • On Data Change: When the user changes the value of an attribute that is an input for the enricher.

Note that data change is detected when the user leaves the field, when a selection is made in the field (for example, for menus) or after a certain time when the user has performed a change but remains in the field.

Stepper Events

This section lists the various events that may cause triggers to start for steps and steppers.

The detailed list of events and their corresponding user actions are listed in stepper events

Events for Steppers

A user may exit a stepper using different actions:

  • Finish: The user completes the stepper and submits the records for certification.

  • Close > Discard: The user completes the stepper and discards all its content. The stepper is canceled and cannot be resumed.

  • Close > Saved: The user completes the stepper and saves its content for later. He can resume this stepper later.

The following events occur once when a user enters or exits a stepper.

  • Stepper - Start: Run when the stepper starts

  • Stepper - Finish (Pre Validation): Run once, when the user finishes the stepper, before the stepper validations

  • Stepper - Finish (Post Validation): Run once, when the user finishes the stepper, after the stepper validations

  • Stepper - Close (Discard): Run once, when the user closes the stepper and discards data changes.

  • Stepper - Close (Saved): Run once, when the user closes the stepper and saves draft data

Events for Steps

A user may exit a step using different actions:

  • The user clicks the Continue or Back buttons.

  • The user clicks (for a non-linear stepper) a step in the header to jump to that step.

  • The user clicks the Close button to go one level up in the stepper.

The events behavior differ for collection steps and form steps:

  • Event on Steps apply to both collection steps and form steps.

  • Events specifically indicated for Collection Step do not apply to form steps.

  • Events used in form steps run once for the record managed in the form step.

  • Events used in collection steps have two flavors, indicated with (Each) or (Once):

    • (Each): This type of event runs once for each record in the collection step. It gives you access to the attribute of these records.

    • (Once): This type of event runs once for all record in the collection step. It gives you access to the attributes of the parent record of these records. From this parent, you can use SemQL’s any|all syntax.

For a detail of the sequence of events triggered for each user action, see stepper events.

The following events occur depending on user actions for form and collection steps:

  • Step - Enter (Once): Run once, when a step is entered

  • Step - Enter (Each): Run for each record, when a step is entered

  • Collection Step - Add Child: Run whenever a child record is added to this collection (directly or through the ADD ANOTHER button of a child step)

  • Collection Step - Copy Child (Once): Run once, when a child record is copied in this collection. Note that you can use in such trigger the CopiedFrom built-in attribute which contains the ID of the source record that was copied.

  • Collection Step - Copy Child (Each): Run for each copied record, when a copy child record action is performed in this collection. Note that you can use in such trigger the CopiedFrom built-in attribute which contains the ID of the source record that was copied.

  • Collection Step - Edit Child (Once): Run once, when a child record is edited on this collection (directly or through the EDIT NEXT button of a child step)

  • Collection Step - Edit Child (Each): Run for each record, when a child record is edited on this collection (directly or through the EDIT NEXT button of a child step)

  • Collection Step - Import (Once): Run once when a user completes an import

  • Collection Step - Import (Each): Run for each imported record, when a user completes an import

  • Collection Step - Remove Child (Once): Run once, when child records are removed from this collection

  • Collection Step - Remove Child (Each): Run for each record, when child records are removed from this collection

  • Step - Continue (Once): Run once, when a user clicks the CONTINUE button

  • Step - Continue (Each): Run for each record, when a user clicks the CONTINUE button

  • Step - Back (Once): Run once, when a user clicks the BACK button

  • Step - Back (Each): Run for each record, when a user clicks the BACK button

  • Step - Close (Once): Run once, when a user clicks the CLOSE button on a step (whether to get back to the parent collection or to close the stepper)

  • Step - Close (Each): Run for each record, when a user clicks the CLOSE button on a step (whether to get back to the parent collection or to close the stepper)

  • Step - Exit (Pre validation - Once): Run once, when a user exits a step, before data validation

  • Step - Exit (Pre validation - Each): Run for each record, when a user exits a step, before data validation

  • Step - Exit (Post validation - Once): Run once, when a user exits a step, after data validation

  • Step - Exit (Post validation - Each): Run for each record, when a user exits a step, after data validation

  • Collection Step - Close Child (Once): Run whenever a child step of this collection is closed

  • Collection Step - Close Child (Each): Run whenever a child step of this collection is closed