Condition syntax - HxGN SDx - Update 63 - Administration & Configuration

Administration and Configuration of HxGN SDx

Language
English
Product
HxGN SDx
Search by Category
Administration & Configuration
SmartPlant Foundation / SDx Version
10

To access the primary objects

The syntax for accessing the object in the object condition is:

Obj.

for the main object

The syntax for accessing relationships and the objects on either end of the relationship is:

Obj->

for the relationship object

Obj1.

for the object 1 (as defined on the relationship definition)

Obj2.

for the object 2 (as defined on the relationship definition)

The syntax for accessing the environment object is:

Env

for the environment object

The syntax for accessing the SystemOptions object is:

SPFOptions

for the system options object

To access an object property

Properties on an object are referenced by name after the key word shown above with a '.' delimiter. For example, to reference an object's name use:

Obj.Name

To access a related object

Related objects can be referenced by relationship definition or edge definition name after the key word shown above with the '->' delimiter.

When using a relationship definition, the '_12' or '_21' direction qualifier must be appended to the name. For example, to reference an objects owner by relationship definition use:

Obj->SPFItemOwner_12

When using an edge definition, the 'EDG_' direction qualifier must be prefixed to the edge definition name. For example, to reference the latest version of a document master by an edge definition use:

Obj->EDG_LatestVersion

  • To access a property on the related object, treat it in the same way as the main object:

    • Obj->SPFRevisionVersions_21.SPFRevState

    • Only one relationship "hop" can be navigated from each of the main objects.

  • To reference the configuration object (for example, plant or project) for a given item, use the special ItemConfig keyword as if it were a relationship. This is a special keyword as the configuration of an object is stored as a property not a relationship for performance reasons.

    • For example: Obj->ItemConfig.Property

    • You can also use this from Obj1 and Obj2 objects.

Simple comparisons

A condition is made up of two expressions and a comparison operator. The following comparison operators are supported:

=

<>

like (use * for wild cards)

< and <=

> and >=

The following Boolean operators are supported:

And

Or

Any

All

( )

For example:

obj.SPFPrgActive=True and obj.SPFPrgDeliverablesFrozen=True

ANY qualifier

The ANY qualifier will result in the selection of the "best" value for the to-many property based on the rest of the constraint.

Example

Results

Any(obj->A.B) < 4

True if any value for multi-valued property B has a value less than 4.

Any(obj->A.B) = 4

True if any value for multi-valued property B has a value of 4.

Any(obj->A.B) = Any(obj->C.D)

True if any value for multi-valued property B matches any value for multi-valued property D.

ALL qualifier

The ALL qualifier is basically the opposite of the ANY qualifier in that it selects the "worst" value for satisfying the constraint.

Example

Results

All(obj->A.B) < 4

True if the largest value for B is less than 4.

All(obj->A.B) = 4

True if every value for B is 4

Combination of ANY and ALL

The approach of using the best value with ANY and the worst value with ALL holds true when they are used in combination.

Example

Results

Any(obj->A.B) < All(obj->C.D)

True if the smallest value for B is less than the smallest value for D.

All(obj->A.B) < Any(obj->C.D)

True if the largest value for B is smaller than the largest value for D.

Any(obj->A.B) = All(obj->C.D)

True if there is a value for B that matches all values for D.

All(obj->A.B) < Any(obj->C.D)

True if for every value for B, there is a corresponding value for D.

Any(obj->A.B) < Any(obj->C.D)

True if the smallest value for B is less than the largest value for D.

Any(obj->A.B) = Any(obj->C.D)

True if there is any value for B that matches any value for D.

All(obj->A.B) < All(obj->C.D)

True if the largest value for B is less than the smallest value for D.

All(obj->A.B) = All(obj->C.D)

True if every value for B is the same as every value for D (that is, there is only value for B and one value for D and they are the same value).

All(obj->A.B) = Any(obj->C.D)

True if every value for B matches a value for D.

  • The ANY and ALL qualifiers are only allowed at the start of mathematical expressions since the inclusion of more than one ANY (or ALL) becomes confusing as to the intent.

  • Because ALL on the right side of an equality can only be satisfied if every value is the same, ALL will normally only be used on the right side for non-equality constraints.

For example,

(Any(obj->A.B) * All(obj->C.D)) / (All(obj->E.F) > 1000

probably means the same as

(Max(obj->A.B) * Min(obj->C.D)) / (Max(obj->E.F) > 1000

but perhaps has a different meaning. Therefore, for math operations the Min and Max methods are preferable (and allowed) to the ANY and ALL qualifiers (only allowed at the start).

IN list syntax

To test if one value is in a list of string:

TestString IN ('String1','String2',…)

For example:

Obj->SPFFileFileType_12.UID IN ('FT_AcadFile','FT_UstnFile','FT_DXFFile','FT_IGRFile','FT_PIDFile','FT_SHAFile','FT_SPEFile','FT_ZyQFile')

Between

Used to evaluate whether an expression is found between two values.

Listing and objects interfaces

The following syntax returns a comma separated string of the interface names instantiated by an object:

Obj.Interfaces

String comparison

Instead of using the comparison for operators shown above, the following syntax can be used to test the existence of one sub string in another:

INST(MainString,SubString)

Logical expressions that evaluate to a string can be used for either string.

INSTR(Obj.Interfaces, 'ISPFTransmittal')

Counting the number of related objects

The following syntax returns an integer:

Count(Obj->RelDef_12)

Example - checking if an object has an owner:

Count(Obj->SPFItemOwner_12)=1