Operators

Operators are special symbols that perform operations on one or two operands, and return a result.

This page discusses:

See Also
Basics

Operators on Single Value

You can return results using the following operators:

Operator Input Types Return Type Description
num1 { + | - | * | / } num2 Integers or real number Integer when both numbers are integers, Real otherwise Returns the operation between num1 and num2.
str1 + str2 String, string String Returns the concatenation of str1 and str2.
obj1 { < | > | <= | >= | = | /= } obj2 Two integers or two strings or two real numbers Boolean Returns the comparison of obj1 and obj2.
obj1 { = | /= | != } obj2 Any type, any type
bool1 { = | /= | != } bool2 Boolean Boolean Returns TRUE if bool1 is equal to bool2.
bool1 AND bool2 Boolean Boolean Returns TRUE if bool1 and bool2 are TRUE.
bool1 OR bool2 Boolean Boolean Returns TRUE if bool1 or bool2 is TRUE.
NOT(bool1) Boolean Boolean Returns the negation of bool1.
obj1 ISA class1 Any type, Class Boolean Returns TRUE if obj1 is of class1.
obj1 DEFAULT obj2 Any type Any type Returns obj1 if it is not empty, otherwise obj2.
Recommendation: Compare PLM objects based on the properties that you can see, because comparing the same PLM references may return different results.

Examples

  • To test if var1 is of class Requirement:

    var1 ISA PLM.Requirement

  • To test if an object is empty:

    VOID(String) DEFAULT "other"
    Returns: "other"

Operators on List of Values

You can return results using the following operators:

Operator Input Types Return Type Description
list1 $< list2 List, List Boolean Returns TRUE if the objects contained in list1 also belong to list2.
list1 $= list2 List, List Boolean Returns TRUE if list1 and list2 contain the same objects.
list1 $+ list2 List, List List Returns a list containing the objects of list1 and the objects of list2.
list1 $- list2 List, List List Returns a list containing the objects of list1 without the objects of list2.
list1 $* list2 List, List List Returns a list containing the objects, which are both in list1 and in list2.
list1 { < | > | <= | >= } list2 List, List List of Boolean Compares all the objects of list1 with all the objects of list2, and returns TRUE or FALSE for each test.
list1 { = | /= | != } list2 List, List Boolean Compares if list1 and list2, and returns TRUE or FALSE depending on the test.
expression.SORTBY(sortCriterion)
  • expression is a List
  • sortCriterion is a String, Integer, or Real
List Returns a list expression sorted by a criterion sortCriterion.
Recommendation: Compare PLM objects based on the properties that you can see, because comparing the same PLM references may return different results.

Examples

  • To compare two lists:

    STR((1 $+ 2) > (1 $+ 2))
    Result: falsefalsetruefalse

  • To test if doc1 belongs to the docs list:

    doc1 $< docs