Configuring Triggers - WorkView - Foundation 24.1 - Foundation 24.1 - Ready - OnBase - Premier - external - Premier

WorkView

Platform
OnBase
Product
WorkView
Release
Foundation 24.1
License
Premier

Triggers are configured at the class level. Configure the trigger on the class where the data that will be used to calculate the target attribute resides. Triggers will modify objects regardless of the current users permissions. If a parent object is modified as a result of a trigger, events and notifications for that object are not fired.

To configure a trigger:

  1. In OnBase Studio, select the WorkView ribbon.
  2. Navigate to the class for which you want to configure a trigger in the WorkView tab with in the Repositories pane.
    Note:

    Triggers are not available for use on external classes. Triggers are available for standard, association, and extension classes, as well as classes that are shared between applications.

  3. Click Trigger in the ribbon.
  4. A new trigger is created under the Triggers folder within the class.
  5. Enter a descriptive name for the trigger and press Enter. The following is an example of a new trigger:
  6. The configuration is done in the Properties pane when the trigger is selected in the Repositories pane.
  7. Enter a Description.
  8. Select the Events for which you want the trigger to fire.
    • Selecting Activate fires the trigger when an object is activated after initial creation and saved for the first time. This event also fires when a deleted object is saved.

    • Selecting Modify fires the trigger when an object is modified and saved.

    • Selecting Delete fires the trigger when the object is deleted.

  9. Click Configure. The Trigger Action Wizard is displayed.
  10. Select an Action. The following actions are available:

    Action

    Description

    Average

    Calculates the average for the selected attribute.

    Note:

    If the target attribute is an Integer data type, a decimal value will not be returned. The value will be rounded to the nearest whole number value.

    Note:

    Date, Date/Time, and Boolean data type attributes cannot be used as a target with this action type.

    Count

    Counts all objects related to the same parent object or all objects where a specific value exists.

    If the source attribute's value is NULL on an object, the object will not be counted. To ensure that all objects are counted, use the objectID as the source attribute.

    Note:

    Date, Date/Time, and Boolean data type attributes cannot be used as a target with this action type.

    Evaluate

    Interacts with objects in order to execute their class triggers. Evaluate can be used to force the execution of triggers on classes that have a relationship to the current class. For example, if you have invoice line items and the price comes from related objects, this can be used to force to recalculate all line items totals when the price object changes.

    This type of trigger is configured on the child class and the target attribute is on the parent object. The target attribute type must be compatible with the expected result of the configuration.

    Max

    Returns the largest value for the selected attribute.

    Note:

    Boolean data type attributes cannot be used as the target attribute with this action type.

    Min

    Returns the lowest value for the selected attribute.

    Note:

    Boolean data type attributes cannot be used as the target attribute with this action type.

    Product

    Returns the product of the source attribute's values. Values associated with a parent on children objects are multiplied and are returned on that parent object as a value to the target attribute.

    Note:

    Only Currency, Decimal, Floating Point, and Integer data type attributes can be used for this trigger.

    Set

    Sets the target attribute to a calculated value. Set can run complex calculations using local or related attributes and the result can be stored on the object or a parent object.

    This type of trigger is configured on the child class and the target attribute is on the parent object. The target attribute type must be compatible with the expected result of the configuration.

    Sum

    Adds the values associated with the selected attribute.

    Note:

    Date, Date/Time, and Boolean data type attributes cannot be used as a target with this action type.

    Note:

    Only Set and Count can be used for non-numeric attributes. All other actions must be used in conjunction with attributes configured with a Integer, Floating Point, Currency data type. Min and Max can also use date attributes to determine the age of an object in a list.

  11. Click Next. Steps to configure a trigger differ by the Action selected.
  12. For steps for the Average, Count, Max, Min, and Sum actions, see Steps for the Average, Count, Max, Min, and Sum Actions

    For steps for the Evaluate action, see Steps for the Evaluate Action.

    For steps for the Set action, see Steps for the Set Action.

  13. Click Execute if you have added or edited a trigger in an application and you want to run the trigger on existing objects without the existing objects being required to encounter the event trigger. If Execute is not clicked, the trigger will run day forward.
    Note:

    The Execute button will be disabled if the trigger is disabled.

  14. Depending on the type of trigger you are configuring, the Condition check box behaves differently.

    If you are configuring a Set action trigger and you want the configured trigger to run only when a certain condition is met, select the Condition check box.

    If you are configuring any of the other trigger action types, selecting the Condition check box will allow you to configure rules that will determine which related objects are included in the trigger result.

    If you want to use attribute values to determine a condition, select the radio button next to Attribute. Select the Attribute from the drop-down list for which you would to use to evaluate the condition.

    Select the Operator from the drop-down list for which you wish to use to compare the attribute's value to the Value you enter.

    Enter the Value you want to base the condition on.

    If you want to use the results of a constraint set to determine a condition, select the radio button next to Constraint Set. Select the appropriate Constraint Set from the drop-down list. For more information about Constraint Sets, see Configuring Constraint Sets.

  15. When finished, save the repository.