Expression Editor


BMC Helix Innovation Studioprovides an Expression Editor in the View designer, Process designer, and Rule designer that you can use to configure the data required for views, processes, and rules of an application. For example, you can provide an expression to configure the data of input map properties of a Call Activity in a Process designer.

For information about Expression editor in the View designer, see Creating-or-modifying-view-definitions.

Expression Editor in Process designer and Rule designer consists of the following sections:

  • Expression builder, where you build the expression
  • Virtual keyboard
  • Context-based dictionary UI from where you can pick an expression of a process variable, a keyword, and an activity result.

Data dictionary UI

The following table describes the nodes in the Data dictionary UI:

Dictionary node

Description

Expression

Process Variables

The process variables that you define in the process definition are available in the Expression Editor. This includes the process input parameters, output parameters, and local variables.

If a process variable is a record and has associations, the associations are available in the Expression Editor, which helps to  navigate to the associated records without using a query.

To use a dynamic variable in a string, you can simply type the $variable name in the string, and the variable's value is inserted in the string at runtime.

For example:

“Hi $user, your ticket is created. The id is $ticketId. You can view the ticket details at $ticketLink.”

When you use any field, variable, or keyword within a string expression, it will be evaluated to the value at runtime. If you want to use the variable name and not its value in the expression, then add an escape character (\) to the expression.

For example, "$\{processContext.processVariableName}"

${processContext.<variable id or name>}

${processContext.task._associations.<association definition GUID>.nodeA/nodeB...}

Activities

The results of all the activities that have outputs are available in the Expression Editor. The results of all the activities are captured in the process context, and you do not have to store an activity result by using the activity output mapping. You can use an expression to pass the activity result to other activities.

${activityResults.<activity GUID>.field}

General

The keywords such as Server URL, Current date, Current date and time, Current Groups, and so on are available in the Expression Editor.

$<keyword name>$

Errors

This node is available only if you have already defined an Error Boundary event earlier in the process. For more information, see Error Boundary event.

You can use an expression to access the exception class and error number (for Java exception error), or error message (for business error) caught by the Error Boundary event.

${errors.<errorBoundaryEventGUID>.errorMessageOrClass}

Email Receive Event Fields

This node is available only when you are using the Email Receive Event in a rule. For more information, see Email Receive Event.

The incoming mailbox attributes, such as mailbox name, email sent to, plain text body, and so on, are available in the Expression Editor.

"${ruleContext.mailSentTo} = \"helpdesk@calbro.com\" AND ( ${ruleContext.priority} = \"1\" OR ${ruleContext.priority} = \"2\" OR ${ruleContext.priority} =\"3\") AND ${ruleContext.plainTextBody} LIKE \"%sometextfrommailbody%"

Functions in Expression Editor

The Expression Editor in the View and Shell designers provides functions for various operations, including string manipulation, date and time retrieval, and array processing.

SyntaxDescriptionParametersReturn value/Example

DATE(date)

Returns the day of the month for the specified date based on the local time.date - The date value.Return null if date is invalid.
DAY(date)Returns the day of the week based on the local time for the specified date, with 0 representing Sunday.

date - The date value.

Return null if date is invalid.
ENCODEURI(uri)Returns a new string that encodes the specified string as a URI.uri - Encodes the given string as a URI.ENCODEURI(“http://www.example.com?x=foo bar”) Output = "http://www.example.com?x=foo%20bar"
ENCODEURICOMPONENT(uriComponent)Returns a new string with the provided uriComponent encoded as a URI component.uriComponent - The string to encode as a URI component.ENCODEURICOMPONENT("test?") Output = "test%3F"
GET(object, path, [defaultValue])Gets the value at the specified path of an object. If the resolved value is undefined, the default value is returned.object - The object to query.
path - The path of the property to retrieve.
defaultValue - The value to return if the resolved value is undefined.
GET({ a: [{ b: { c: 3 } }] }, "a[0].b.c") Output = 3
GET({ a: [{ b: { c: 3 } }] }, ["a", "0", "b", "c"]) Output = 3
GET({ a: [{ b: { c: 3 } }] }, "a.b.c", "default") Output = "default"
HOURS(date)Returns the hours from the specified date according to the local time.date - The date value.Return null if date is invalid.
IIF(condition, trueResult, falseResult)Returns a value depending on the specified condition.condition - Determines which value to return.
trueResult - The value returned if the condition is true.
falseResult - The value returned if the condition is false.
IIF(true, "foo", "bar") Output = "foo"
IIF(false, "foo", "bar") Output = "bar"
INCLUDES(array, value)Returns true if the value is found in the array; otherwise, it returns false.array - The array to search.
value - The value to look for in the array.
INCLUDES([1, 2, 3], 1) Output = true
INCLUDES([1, 2, 3], 4) Output = false
INCLUDES("abc", "a") Output = true
INCLUDES("abc", "d") Output = false
JOIN(array, [separator=","])Converts all elements in an array into a string, separated by the specified separator.array - The array to convert.
separator - The string used to separate the elements.
JOIN([1, 2, 3], "|") Output = "1|2|3"
JOIN("abc", ", ") Output = "a, b, c"
MAX(array)Computes the maximum value in the array. Accepts multiple parameters, supports nested arrays, and processes numeric and date values.array -  The array to iterate through.

Returns null if array is empty. 

MAX(1, 2, 3) Output = 3
MAX([1, 2, 3]) Output = 3
MAX(1, [2, 3], [4, [5, 6]]) Output = 6
MIN(array)Computes the minimum value in the array. Accepts multiple parameters, supports nested arrays, and processes numeric and date values.array - The array to iterate through.

Returns null if the array is empty.

MIN(1, 2, 3) Output = 1
MIN([1, 2, 3]) Output = 1
MIN(6, [5, 4], [3, [2, 1]]) Output = 1
MINUTES(date)Returns the minutes from the specified date according to the local time.date - The date value.Return null if date is invalid.
MONTH(date)Returns the specified date's month as a zero-based value according to the local time, where 0 represents January.date - The date value.Return null if date is invalid.
PAD(string, [length=0], [chars=" "])Pads the given string on both sides if it is shorter than the specified length.string - The string to pad.
length - The total length after padding.
chars - The characters used for padding.
PAD("ABC", 10, "-") Output = "---ABC----"                                    
PADEND(string, [length=0], [chars=" "])Pads the given string on the right side if it is shorter than the specified length.string - The string to pad.
length - The total length of the padded string.
chars - The characters used for padding.
PADEND("ABC", 5, "-") Output = "ABC--" 
PADSTART(string, [length=0], [chars=" "])

Pads the given string on the left side if it is shorter than the specified length.

string - The string to pad.
length - The total length of the padded string.
chars - The characters used for padding.
PADSTART("ABC", 5, "-") Output = "--ABC"
REGEXP(pattern, flags)Returns a regular expression object.

pattern - The regular expression pattern as a string.
flags - A string specifying the flags to be applied.

Returns null if the pattern or flags are invalid.

REGEXP("abc", "gi") Output = /abc/gi
REPLACE(string, pattern, replacement)

Replaces occurrences of the specified pattern in the given string with the replacement value. Use a regular expression pattern to replace all matches.

string - The input string to be modified.
pattern - The pattern to search for within the string.
replacement - The value used to replace each matched pattern.
REPLACE("AA", "A", "Z") Output = "ZA"
REPLACE("AA", REGEXP("a", "gi"), "Z") Output = "ZZ" 
ROUND(number, [precision=0])Computes the given number rounded to the specified precision.number - The number to round.
precision - The number of decimal places to round to.
ROUND(4.006) Output = 4
ROUND(4.006, 2) Output = 4.01
ROUND(4060, -2) Output = 4100
SAME(array)Returns true if all values in the array are identical; otherwise, it returns false.array - The array to inspect.SAME([1, 1, 1]) Output = true
SAME([1, 2, 3]) Output = false
SAME("aaa") Output = true
SAME("abc") Output = false
SAME([]) Output = true
SAME("") Output = true
SECONDS(date)Returns the seconds for this date according to the local time.date - The date value.Return null if date is invalid.
SIZE(array)Returns the size of the array.array - The array to inspect.SIZE([1, 2, 3]) Output = 3
SIZE("abc"]) Output = 3
SIZE([]) Output = 0
SIZE("") Output = 0
SIZE(null) Output = 0
SPLIT(string, separator, [limit])Splits the given string by using the specified separator.

string - The string to split.
separator - The pattern used to split the string.
limit - The length to which results are truncated.

SPLIT("A-B,C,D", REGEXP("[-,]"), 3) Output = ['A', 'B', 'C'] 
STRIPHTML(string)Removes HTML tags from the specified string.string - The string to remove HTML from.STRIPHTML("<div>ABC</div>") Output = "ABC"
STRIPHTML(null) Output = "" 
SUBSTRING(string, startIndex, [endIndex])Returns a substring from the given string, starting at the specified index and excluding the end index. If no end index is provided, it extracts characters until the end of the string.string - The string from which to extract characters.
startIndex - The index of the first character to include.
endIndex - The index of the first character to exclude.
SUBSTRING("ABCDEFG", 3, 6) Output = "DEF"
SUBSTRING(null, 1, 1) Output = "" 
TEST(string, pattern)Returns true if the given string matches the regular expression pattern; otherwise, it returns false.string - The string to test against the pattern.
pattern - The regular expression pattern to match.

Returns false if the pattern is invalid.

TEST("A", "a") Output = false
TEST("A", REGEXP("a", "i")) Output = true
TOLOWER(string)Converts the specified string to lowercase.string - The string to convert to lowercase.TOLOWER("aBc") Output = "abc"
TOLOWER(null) Output = "" 
TOUPPER(string)Converts the specified string to uppercase.string - The string to convert to uppercase.TOUPPER("aBc") Output = "ABC"
TOUPPER(null) Output = "" 
TRIM(string, [chars])Removes leading and trailing white space or specified characters from the given string.string - The string to trim.
chars - The characters to remove from the start and end of the string. 
TRIM("-  ABC  -", " -") Output = "ABC"
TRIM(null, "-") Output = "" 
TRIMEND(string, [chars])Removes trailing white space or specified characters from the given string.string - The string to trim.
chars - The characters to remove from the end of the string.
TRIMEND("-  ABC  -", " -") Output = "-  ABC"
TRIMEND(null, '-') Output = "" 
TRIMSTART(string, [chars])Removes leading white space or specified characters from the given string.string - The string to trim.
chars - The characters to remove from the start of the string.
TRIMSTART("-  ABC  -", " -") Output = "ABC  -"
TRIMSTART(null, '-') Output = "" 

YEAR(date)

Returns the year from the given date according to local time. date - The date value.Return null if date is invalid.

Expression Editor examples

The following table illustrates Expression Editor examples:

Configuration using Expression Editor

Example

In Process designers and Rule designers, you can use regular expressions in a Qualification (condition).

In Rule Designers, you can configure expressions in Rule Qualification.
For example, the expression 'Created By' LIKE "%Mi%Jo%" matches with Michael Jordan, Mike Johnson, Micth Joe and so on.

In Process designers, you can use expressions in the following components:

  • Get Records By Query action
  • In the condition for Exclusive gateway
  • User Task Completion condition

In the Process designers, expressions can be used only with the LIKE operator.

The following characters are allowed in the expression:

  • %:Matches any string.
  • _(Underscore): Matches any single character. For example, the expression 'Created By' LIKE "M_n" matches Man, Men.
  • []: Matches any given char. For example, 'Flag' LIKE [a-p] matches any char in a given range a to p.

22_1_expression_editor.jpg

Configure an expression by using individual attributes from a JSON schema.

22_1_Example of REST API attributes.png

Configure an expression by selecting the fields from the associated records.

Important: Only fields from one to one and one to many associations are supported.

22_1_Edit expression for recipients.png

Configure an expression by using fields in the configured incoming mailbox.338px

22_1_Email attributes in an expression editor.png

Configure condition using an activity result.

22_1_Configure condition using activity result.png

Configure the expression by using error details caught by the Error Boundary event.

22_1_Configure expression_error boundary event.png

Configure a condition to check if the security label for a record instance is updated.

When using SECURITYLABELCHNG() function in a process, add a record instance as a parameter. When using the SECURITYLABELCHNG()function in a rule, you do not need any parameter.

Important: In Rule designer, the SECURITYLABELCHNG() function is supported only with the Record Event trigger type. If you use the SECURITYLABELCHNG()function with the Timer Event or System Event trigger type, an error is generated while saving the rule.

For more information about configuring a condition to identify the changes in the security label, see Identifying updates to the security label.

Using Process:

22_1_Securitylblchng for process.png

Using Rule:

22_1_Securitylblchng for rule.png

Configure a selection field.

22_1_Configure selection field.png

Server URL in user message.

22_1_Expression for server URL.png

Configure Start Process expression in a rule.

22_1_Process start expression.png

Symbols used in Expression Editor.

22_1_Expression editor symbols.png

Set conditions to hide menu, menu items, and action components by using CCS parameters

Configure the condition to hide the menu, menu items, and action components with the Hidden field based on the following CCS parameters:

  • com.bmc.arsys.smartit:*:enableESChatIntegration
  • com.bmc.arsys.smartit:*:es_chat.url
  • com.bmc.arsys.smartit:*:helixdashboard.url
  • com.bmc.arsys.smartit:*:disabledSmartITApplications
  • com.bmc.arsys.smartit:*:reportingServerURL
  • com.bmc.arsys.smartit:*:enableAssetCreator

Use the GET() function under Object node to use the CCS parameters. 

For more information about the CCS parameters, see Centralized configuration

image-2024-11-4_15-32-34.png

 Configure navigation menu bar items to open external web page URLs that include the following user properties as query parameters.

  • Email address
  • Login name
  • Person ID
  • User ID
  • Company 
  • Department 
  • First name 
  • Full name
  • Is support staff
  • Last name 
  • Organization 
  • Phone 
  • Site 
  • Support group names 
  • Support group IDs

 

User attributes in Expression editor.png

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*