Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Registers Gateway

Nested expressions and advanced patterns

  • Last UpdatedOct 01, 2026
  • 2 minute read

This section covers nested expressions that combine multiple functions to create powerful data transformation logic. Functions can be chained together where the output of one becomes the input of the next.

Pattern 1: Coalesce with Multiple Regex Attempts

Try multiple regex patterns and fall back to a default if none match:

{{ coalesce(
@[Line Number].replaceOrBlank(/^[\d"?]{1,5}-([A-Z?]{1,5})-(\d{6})-.+$/, '$1$2'),
@[Line Number].replaceOrBlank(/^([A-Z]{1,5})-(\d{6})-.+$/, '$1$2'),
concat('Unnamed Line ', @pidProject, '#', @id)) }}

This attempts two different line number formats and creates a generated name if neither matches.

Pattern 2: Complex Join with Conditional Logic

{{ if @[Plant Code].isSet and @[Facility Code].isSet and @[Area Number].isSet
then concat(coalesce(@[Site Code],'Kearl'),'|',@[Plant Code],'|',@[Facility Code],'|',@[Area Number]) }}

Builds a composite key with pipe delimiters, using a default for Site Code if not provided.

Pattern 3: Enum Lookup with Discovery and Context

{{ $[attr.value]
.removeEnumItemIdsFromText('Enumerations.CMMSCodes'.getEnumByAspect)
.expandNaming
.discoverNumbersByClass('TAG'.lookupClass($[#nomenclature]), true, true)
.replace(/(?<=^|,|;)([^,;]+)/, '|'.join(@[asset_code], '$1'))
.splitAny(';,') }}

This pattern: (1) Strips enum IDs, (2) Expands tag naming (P101A/B -> P101A,P101B), (3) Discovers all tag numbers, (4) Prefixes with asset code, (5) Splits into array.

Pattern 4: Multi-Class Resolution with Fallback

{{ @[Tag].slice(' ',1)
.replace(/\s/,'')
.tryResolveNumberByClass(
collect(
'INSTRUMENT LOOP'.lookupClass($[#nomenclature]),
'INSTRUMENT EQUIPMENT'.lookupClass($[#nomenclature]),
'MECHANICAL EQUIPMENT'.lookupClass($[#nomenclature]),
'ENGINEERING TAG'.lookupClass($[#nomenclature])
),
true, true
) }}

Takes first word, strips whitespace, then resolves against multiple equipment classes. Returns original text if no template matches.

Pattern 5: Context-Aware Association with Enum Lookup

{{ if $[data-context-id].isSet then {
if $[data-context-id] starts 'MOD' then {
$[attr.value].splitAny(';,')
}
else if 'Enumerations.EDWContext'.getEnumerationByAspect
.getEnumerationItemName($[data-context-id]) equals $[root-context] then {
$[attr.value].splitAny(';,')
}
else {
'|'.join(
'Enumerations.EDWContext'.getEnumerationByAspect
.getEnumerationItemName($[data-context-id]),
$[attr.value]
).splitAny(';,')
}
}
else { $[attr.value].splitAny(';,') } }}

Looks up context name from enumeration, conditionally prefixes values with it, then splits into array.

Pattern 6: Deep Conditional Logic with Class Checks

{{ if @type equals 'VALV' then {
if @name contains '-VG-' then { 'GATE VALVE' }
else if @name contains '-VB-' then {
if @dtxrtext contains 'BALL VALVE FB' then { 'BALL VALVE FULL BORE' }
else { 'BALL VALVE REDUCE BORE' }
}
else if @name contains '-VGL-' then { 'GLOBE VALVE' }
else if @name contains '-VC-' then { 'CHECK VALVE' }
}
else if @type equals 'BEND' then {
if @dtxrtext contains 'BEND' then { '5D BEND' }
else 'UNKNOWN'
} }}

Multi-level conditional logic using scope braces {} to avoid ambiguity when 'then' is followed by another 'if'.

Pattern 7: Map with Date Function

{{ now.dayOfWeek.left(2).map(
'mo','Monday',
'tu','Tuesday',
'we','Wednesday',
'th','Thursday',
'fr','Friday',
'sa','Saturday',
'su','Sunday',
''
) }}

Gets day of week, takes first 2 characters, maps to full name with default empty string.

Related Links