For general rule help see Rule Engine Introduction
The Rule Engine supports the following types of literal values:
- null – A simple null value. Prior to 3.3.11 must be lowercase. After 3.3.11 null is case-insensitive. Examples:
-
null
-
Null
-
NULL
-
Null()
-
- Boolean – Literal boolean values must be lowercase prior to version 3.3.11. Later versions are case-insensitive. Examples:
-
true
-
false
-
TRUE
-
False
-
- Number – Numbers may be entered with or without decimals, and may be negative. Numbers will default to 'long' unless they have a decimal, in which case the underlying type will be double. Use 0x for hexadecimal. Examples:
-
0
-
1.1
-
0x200
-
-50
-
- String – Literal strings must be enclosed in double quotes. The " character is escaped with a backslash. Other escaped characters are \r \n \t and \\ for carriage return, newline, tab, and backslash. Examples:
-
"hello world"
-
"line 1\r\nline2"
-
"C:\\Program Files\\SoftwareIDM\\IdentityPanelWeb"
-
"Single quotes like 'this', double quotes like \"this\""
-
"Col1\tCol2\tCol3"
-
- Interpolated String – Literal string with embedded rules. This is typically much easer to read than using the '+' operator for concatenation. Like C# 5, interpolated strings are prefixed with a '$', and use curly braces '{expression}' to insert values.
These strings use the same escaping logic as regular string literals, except that open curly brace '{' must also be escaped if it is being used as literal.
Interpolated values may be string literals, but you cannot have nested interpolated strings.
Examples:-
$"{Attributes.sn}, {FirstNotNull(Attributes.preferredName, Attributes.givenName)}"
-
$"This is OK {UpperCase("hello world")}"
-
$"This will error {UpperCase($"hello {Attributes.Name}")}"
-
- TimeSpan and Date – The rule helper provides a datepicker and text box for entering dates and timespans, but there is no direct typed support for date and time literals. Instead these are represented simply as string literals and may be coerced to TimeSpan or DateTime as needed in the rule engine, as long as they are compatible with the .NET Parse methods.
Examples:-
CoerceTimeSpan("1.00:00:00")
-
CoerceDateTime("2017-01-01")
-
Comments
0 comments
Please sign in to leave a comment.