You are here: Key Features > Reflex Methods and Global Parameters

Reflex Methods and Global Parameters

Reflex methods are triggered functions that are called automatically if a property on an object is modified.

They can be used to set the value of another property on the modified object, either to a fixed value or using a global parameter defined in 1Edit.

Reflex methods are defined in a CSV file, which can be loaded when creating a project.

Note: If loaded to a template project, reflex methods are inherited and used by any child projects based on that template.

Reflex definition file

An example reflex definition file is given below, along with an explanation for each example reflex method it contains.

Row Explanation
1 For a Building object, when the functionValue property changes, set the engNameValue property to "Set function value"
2 For an Artificial object, when the geometry changes, set the engNameValue property to "Changed Artificial"
3 For an Artificial object, when the geometry changes, set the polyGeomChangeDate property to the current date
4 For an Artificial object, when the geometry changes, set the polyGeomChangeCode to the value 11
5 For a Building object, when the engNameValue property changes, set the engNameValidationDate property to the current date
6 For a Building object, when the engNameValue property changes, set the engNameChangeDate property to the current date
7 For a Way object, when the secondary geometry is created or modified, set the lineGeomChangeDate to the current date

Note: Notice that you can have multiple reflex methods working on the same source property, such as in rows 2, 3 and 4.

Optional Values

By default, reflex methods are triggered when a property is updated or created. However, this behaviour can be altered by the addition of two optional values:

  • On_Set: The reflex is only triggered when the property is first changed from NULL to a value.

  • Null_On: When the source value is set to NULL, the target value is also set to NULL.

One, both or neither of these values can be added to the end of a row in the CSV file. These values are not case sensitive, and can be provided in any order.

Chaining

It is important to note that reflex methods cannot be chained.

For example, if we have the following pair of reflex method definitions:

Only the engNameValidationDate property will be modified, engNameChangeDate will not be changed despite the second reflex method. This is to avoid potentially destructive circular references.

Global parameters

Global parameters are named values (of integer, real and string types) that are held within the dataset.

When used with reflex methods, they allow property values to be overridden with the value of a global parameter.

To view global parameters, open the Data menu from the lower app bar, then select Project Properties.

An example reflex method is given below:

Combining this reflex method and the parameter values pictured above, we can see that when the geometry of an Artificial object is modified, the engNameValue property is set to Cambridge.

Defining Global parameters

To add a global parameter click the Add Parameter button.

Enter a Name (cannot contain spaces), select a Type from the drop-down menu, then enter a Value. Click Add to create the global parameter.