Trigger of an object

 

* 

 

Triggers are used to call a freely definable function in an object.

For this TCE is comparing the passed values of the parameters of the trigger function with the passed values of the last successful call. If any change of the parameters is found, the trigger function is called again.

Useable function for triggers must have the „Trigger“ keyword as shown below.

Example:

Imagine that you have created a class that represents a product. A price must be found for the product. You have decided to design pricing using a separate object. The class for pricing is called calculation. Whenever the width or height of the product changes, pricing should be restarted.

Triggers are ideal for enabling this functionality. In the Calculation class, you create a trigger function that carries out pricing depending on the transferred width and height.

 

Trigger function, defined in the class Calculation, and finding the price by a multi decision table

 

Trigger call, defined at the object Calculation of the class Product

 

The functionality is as follows:

A trigger method is defined with a freely definable list of parameters. Important is the function attribute Trigger, which declares the function as a trigger.

A trigger can now be created for the trigger function on the object definition, which is implementing the class with the trigger function. The parameters of the trigger function are displayed in a list and can now be used to reference to variables or expressions.

The trigger now checks the parameter expressions for value changes within any rule check as long as the expression "Enabled" returns True. If there are such, the trigger function with the values of the expressions is called in the object of the trigger.

All non-optional parameters of the trigger function must be expressed. If the trigger function defines a reference parameter (ByRef), the variable that fills the expression of the reference parameter is updated.

 

Properties of a Trigger

 

Property

Description

Enabled

An expression that determines under what circumstances the trigger should run.

Class

Class from which the object must be derived at run time for the trigger to run. The class can be changed using the corresponding icon in the toolbar.

Function

The trigger function of the trigger.

Parameter

Call parameter of the trigger function.

The Expression column specifies the features or expressions to check for change, and then call the trigger function with the parameter values.

 

When is the trigger running?

Triggers are called during rule validation but can also be checked or reset specifically for an object.

 

See TCE Objects Attribute Functions

ObjectCheckTriggers

ObjectResetTriggers

Server Object

CheckTriggers