Common syntax - HxGN SDx - Update 64 - Administration & Configuration

Administration and Configuration of HxGN SDx

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

The following syntax criteria can be used to create a condition.

Primary, property, and related objects

Primary objects

The following syntax can be used to reference a primary object in a condition.

Syntax

Description

Obj.

For the main object

Obj->

For the object defined on 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

Env

For the environment object

SPFOptions

For accessing the system options object

Property objects

You can access properties on an object by referencing the property separated from the primary object using a delimiter, such as Obj.Name.

  • Obj.Name = 'Test'

And to create a condition that checks that the document revision is in the WORKING state:

  • Obj->SPFFileComposition_12->SPFRevisionVersions_21->SPFRevState = ’WORKING’

Related objects

Related objects can be referenced by a relationship definition or edge definition qualifier added to the primary object

  • Relationship definition - to reference an object by a relationship definition, add the _12 or _21 direction qualifier suffix to the object name. For example:

    To reference the item owner by a relationship definition use.

    • Obj->SDxItemOwner_12

    Or to reference a property on a related object.

    • Obj->SPFRevisionVersions_21.SPFRevState

  • Edge definition - to reference an object by an edge definition, add the EDG_ direction qualifier prefixed to the edge definition.

    • Obj->EDG_LatestVersion references the latest version of a document by an edge definition.

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

  • You can reference an object's configuration using the keyword ItemConfig. For example:

    • An object's plant or project is stored as a property and not as a relationship, so you would use, Obj->ItemConfig.Property.

    SHARED Tip You can also use ItemConfig with Obj1 and Obj2 objects. For example, Obj1.ItemConfig.Property.

Comparison operators

Simple comparisons

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

Comparison Operator

Description

=

Equal to

!= or <>

Not equal to

<

Greater than

>

Less than

<=

Greater than or equal to

>=

Less than or equal to

like (use * for wildcards)

Similar to

Boolean comparison operators

The following Boolean operators are supported in comparisons:

Boolean Operator

Description

And

Performs a comparison containing values so that both conditions results in True

Or

Performs a comparison where the results are True if any one of the conditions is true

Any

Performs a comparison that is True for any of the values in the condition

All

Performs a comparison that is True only if it is true for all the values in the condition

( )

Parenthesis to group conditions or control the order in which they are used

For example, All(Obj.SDxPrgActive) = True or Any(Obj.SDxPrgActive) = False.

ANY qualifier

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

Example

Result

Any(Obj->A.B)<4

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

Any(Obj->A.B) = 4

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

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

True if any value for multi-valued property A.B matches any value for multi-valued property C.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

Result

All(obj->A.B )< 4

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

All(obj->A.B) = 4

True if any value for A.B has a value of 4.

Combining ANY and ALL

You can combine the ANY and ALL qaulifiers to provide the best and worst value used in combination.

Example

Result

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

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

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

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

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

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

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

True if every value for A.B is the same as every value for C.D

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

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

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

True if every value for A.B is the same as every value for C.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.

  • All is normally only used on the right side for non-equality constraints because All can only be satisfied if every value is the same. Using Max and Min methods for math operations are preferable to Any and All qualifiers as they are only allowed at the start. For example, (Max(obj->A.B) * Min(obj->C.D)) / (Max(obj->E.F) > 1000.

String comparison

String comparison

Instead of using the comparison operators, 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')

Between

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

List objects

Listing object interfaces

This syntax returns a list in a comma separated string of the interface names instantiated by an object. For example:

  • Obj.Interfaces

Listing objects in a list

You use IN in a condition to perform the validation of all elements in a list and return those that meet the condition as True. You can test that the string values are in a list by using the syntax, Obj->StringTest IN ('String1','String2','String3'). For example, the following syntax checks for selected file types in a list.

  • Obj->SPFFileFileType_12.UID IN ('FT_DocFile','FT_ImageFile','FT_SDxFile')

Count the number of objects

Use the following syntax to return the number of specified objects.

  • Count(Obj->RelDef_12)

You can use the same count syntax to check if an object has only one owner.

  • Count(Obj->SPFItemOwner_12) = 1

And use the count syntax to check the number of referenced files.

  • IsReferenceFile = Count(obj->SPFReferenceFile_21) <> 0

Or check that a document has files

  • HasFiles = Count(Obj->SPFFileComposition_21) > 0