Expressions

Last update: Download PDF Edit

1 Introduction

Expressions can for example be used to change a member of an object based on logic. Variables in the microflow can be called in an expression by inserting the name of the variable and adding a dollar sign (for example, $customer refers to the variable customer). Expressions can be used recursively (for example, 1 + 2 + 3). Attributes and associations of object variables are accessed using a slash (for example, $customer/Name, $customer/CRM.Customer_Order).

To illustrate this imagine an object with variable name package with two attributes: weight (Decimal) and shippingCosts (Decimal). Rule: if the weight of a package is less than one kilogram there are no shipping costs. Otherwise the shipping costs are €5.00. The expression for changing attribute shippingCosts is: if $package/weight < 1.00 then 0.00 else 5.00.

An overview of the possibilities with expressions can be found below.

2 Unary Expressions

3 Arithmetic Expressions

4 Relational Expressions

5 Special Checks

6 Boolean Expressions

7 If Expressions

  • if - perform a conditional action

8 Mathematical Function Calls

  • max - Maximum of a list of numbers
  • min - Minimum of a list of numbers
  • round - Rounding a floating-point number, optionally to a specified precision
  • random - Random number generation
  • floor - Rounding a floating-point number down
  • ceil - Rounding a floating-point number up
  • pow - Exponentiation
  • abs - Absolute value

9 String Function Calls

10 [Date Creation

  • dateTime - Creating a date value using the server’s calendar
  • dateTimeUTC - Creating a date value using the UTC calendar

11 Between Date Function Calls

12 Add Date Function Calls

13 Trim to Date

14 To String

15 Parse Integer

16 Parse/Format Decimal Function Calls

17 Parse/Format Date Function Calls

18 Enumerations in Expressions

  • getCaption - Get caption of enumeration value in current language
  • getKey - Get technical name of enumeration value