Expressions
An expression is a formula for obtaining a result. There are several places in the workflow system where you can enter expressions, including route properties, data field definitions, and search criteria.
Depending on the context, expressions can be simple or complex.
- A simple expression is a single variable or literal.
- A complex expression is any valid combination of the following:
- variables
- literals
- operators
- functions
Numeric expression examples
In
the following numeric expressions, Num1 and Num2 are variables and
can be declared as either float or integer.
(Num1 + 2) * (Num2 * 15)
abs (Num1 - Num2)
Num1String expression examples
In the following example, the variable CustName was declared as a string. CustName has a value of International Insurance Company.
| String | Result |
|---|---|
| "Dear " + CustName + "," | Dear International Insurance Company, |
The following example shows the use of the Content Cortex-supplied function called upper.
| String | Result |
|---|---|
| upper(CustName) | INTERNATIONAL INSURANCE COMPANY |
Remember that an expression can also be a single variable,
such as:
CustNameBoolean expression examples
In
the following example, the variables EndOfFile and IsEmpty were declared
as Boolean.
not EndOfFile and IsEmptyFollowing
is another example of a Boolean expression. The variable Num was declared
as an integer.
((Num + 2) > 80) or ((Num - 2) < -20)The
Boolean expression shown below is also valid (remember that true is
a Boolean literal).
trueTime expression examples
The
following example converts a string literal to a time.
convert ("8/15/1995 14:30:00", time)The
example below adds three months to the server's current time.
addmonths (systemtime(), 3)A
time expression can also be a single variable, such as:
CustomerBirthDate