Expression Syntax

<< Click to Display Table of Contents >>

Navigation:  WireCAD PRO Manual > Project Rules >

Expression Syntax

Previous pageReturn to chapter overviewNext page

 

(true part [ boolean other true part ]) then set SomeProperty = 'SomeStringValue' [else set SomeProperty = 'SomeOtherStringValue']

syntax in [] is optional

 

Description

Syntax

Example

Single part boolean that sets a property if true

(1=1) then set PropertyName = 'string value'

Assume the property we want to test is the SignalType field and if true then change the CableType to equal 1505

(SignalType = 'SDI') then set CableType = '1505'

Multipart boolean AND that sets a property if true

(1=1 && 2=2) then set PropertyName = 'string value'

Assume the property we want to test is the SignalType field AND the Length field and if true then change the CableType to equal 1505

(SignalType = 'SDI' && Length > 100) then set CableType = '1505A'

Strings

'some string'


Numbers

1001


Boolean AND

&&

this and that then (1=1 && 2=2) then ...

Boolean OR

||

this or that then (1=1 || 2=2) then ...

Equality

=


Test Null

is null

(SomeProperty is null) then ...

Set a Property (Assignment)

set PropertyName =

(1=1) then set NumericPropertyName = 1000 or (1=1) then set StringPropertyName = 'string value'

Wildcard (any from here)

%

Used in conjunction with the LIKE operator (CableType LIKE '1505%') then ... will evaluate to true for any value that starts with 1505

Wildcard (any one)

?

Used in conjunction with the LIKE operator (CableType LIKE '1505?') then ... will evaluate to true for any value that starts with 1505 and has one and only one additional character.

 

 

Limitations

This syntax has no block structure. If you need to execute multiple set property operations you will need to create multiple rules.

Illustration

The following is NOT supported:

(true) then

something;

something else;

some other thing;

else

another thing

or another thing

 

Consider creating a plugin in the SDK if you need to create very complex rules. There is a Project Rules Events project template to use as a prototype to get you started.