Operations

An operation is a high level component of an Action, which determines the primary function of the Action.

Types of Operations

Operation

Description

Parameters

Child Nodes

Static

Cast

The cast node allows you to assert that you know that an object will be a specific class, or that you want to pretend it is of that class. This allows you to use attributes from that class in the Rule or Action builder that would not show them otherwise.

See Cast Node for more information.

  • From Class

  • From Name (optional)

  • To Class

  • To Name (optional)

N/A

Assignment

Assignment

Assigns a new value to an existing value.

Only temporary values and dynamic values can be assigned a new value.

Typically, the value to be assigned is the result of a built-in function or a temporary value holding the result of a more complex calculation.

For example, assign a new geometry or attribute to a feature. This is used widely to fix or integrate or transform data by updating it.

N/A

  • Value (variable)

  • Value

Branch

If…Then…Else

Conditionally apply the first or second child operation based on the result of the predicate condition, as part of an action. This value should have a predicate to test and two child values to choose between, i.e.

  • If the condition is true, the result is the value of the first child value.

  • If the condition is false, the result is the value of the second child value.

N/A

  • Predicate (If)

  • Operation (Then)

  • Operation (Else) (optional)

Try…Catch

Execute the try operation unless it throws an exception, otherwise execute the catch operation.

N/A

  • Operation (Try)

  • Operation (Catch)

Built-In

Built-in Operation

Performs a specific task on the data, determined by the built-in function that is selected.

If the function requires parameters, these must be added as child values.

See Built-in Operations.

  • Operation Name

Varies by Operation

Loop

Break

When used inside of a loop this will cause the loop to terminate. Otherwise the Parent operation will be terminated.

N/A

N/A

For Loop

Execute the given operation a given number of times

  • Name

  • Start

  • Target

  • Inclusive

  • Step

  • Operation

Loop Over a Collection or Geometry

Step over a specified geometry or collection and perform an operation on each part.

Collections are often created as attribute values by specific bespoke datastores to represent things like multi-cardinality lists.

      Note: Geometries can be treated like collections and stepping over each part allows each part of a single or multi-part geometry to be processed individually. The loop will run for each part of a geometry - once for a single part geometry and multiple times for a multi-part geometry.

There should be two child elements: a value (a collection or geometry) and an operation. The operation is performed for each object or element in the collection, or each part in the geometry.

  • For a collection of objects, the class of the objects should be entered, or a label for a child condition. The Object or Element value can be used to access the current part within the loop.
  • For a geometry the Object or Element value can be used to give access to the current geometry part. This is often used to access the vertices or segments of a geometry by looping over the result of the vertices or segments built-in functions.
  • Class

  • Name

  • Value (Collection or Geometry)

  • Operation

Loop Over Nearest Objects

Loop over nearest n objects, executing an operation on each. Specify the following parameters:

  • Limit: The number of objects. Must be greater than 0.
  • Class name

  • Alias name of the objects to loop over (optional)

There should be three child elements:

  • A source geometry from which to measure distance.

  • An optional test condition to filter the elements.

  • An operation to perform on the elements closest to the geometry.

The operation will be performed for the nearest n objects that satisfy the test condition, in order of increasing distance from the source geometry.

Only the first n objects that pass the first test condition have the operation applied to them

  • Limit

  • Class

  • Name

  • Value (Count)

  • Predicate (Filter) (optional)

  • Operation

Loop Over Objects

Step over a specified set of objects in the cache and perform an operation on each one.

  • Limit

  • Class

  • Name

  • Predicate (Filter)

  • Operation

Sequence

Used to perform a number of operations one after the other in the specified order.

There must be at least two child operations .

For example, this can be used to execute several operations in an IF…THEN…ELSE operation like BEGIN…END or {} in programming languages.

N/A

  • Operation 1

  • Operation 2

  • … add with Add

  • Operation N

While Loop

Performs an operation (often a sequence) zero or more times.

A While Loop must consist of two child elements: a Predicate condition and an operation. The operation will be executed repeatedly while the condition holds.

      Note: You must be careful to avoid infinite loops by ensuring that the Predicate condition will eventually be met.

N/A

  • Predicate (Condition)

  • Operation

Object

Create Object

Creates a new object in the class specified.

This is used widely to create reporting features representing the exact locations of problems or when inferring new data or creating an enhanced copy of the data.

      Note: If these new objects will be exported to the Oracle database, the appropriate columns must be created prior to running the action.

  • Class

  • Name

  • Operation

Delete Object

Deletes an existing object.

You can specify the class of object to be deleted and its name, if it has been given one.

      Note: Usually you should aim to delete the primary object that the rule is iterating over to avoid later iterating over a feature that has been deleted.

  • Class

  • Name

N/A

Report

Report on Values

Report on the values of one or more values. This will produce ReportedValue objects and set them on the Context (a class that holds context information relating to a Value, Predicate or Operation in a rule or action). The context information includes the Gothic dataset Version, the class(es) of object being tested (identified by a class label) and the current object being considered (identified by an object label).

  • Label

  • Scope

  • Value 1

  • … add with Add

  • Value N

Template

Action Template

Import an action template.

The Template parameter allows you to choose existing Action Templates from the dialog that appears. This only shows Action Templates and folders that contain them.

  • Template

  • Dependent on the template