CARL Source
Dynamic message
Customization > Customization functions > Message template > Dynamic message

The purpose of the expressions used in the message templates is to be able to adapt the subject or body of the message to the context. Thus, on the subject line of the received email, the addressee will immediately have information on the event.

The addressee can even open the subject referenced in CARL Source directly thanks to Hypertext links.

Attributes of entity as a message template setting

These attributes refer to the entity referenced in the message template.
The entity is not necessarily filled in for an indicator message; it is never filled in for an automatic job message.

 

Simple attributes of the entity

To display the attribute values of an entity, fill in the "Entity" field of the message template.

Next, add the attributes to the subject or body between braces.
The entities and their attributes can be viewed in the dictionary.

Example:

 

Complex attributes of the entity

You can also indirectly display the attribute values of subjects associated with the entity by writing the names of the hierarchical subjects followed by the attribute of the last subject, separated by periods.
You can thus cascade linked subjects.

Example 1:

 

Example 2:

These expressions are comparable to those used in defining indicators.

 

Status change details

All status change information available in the status history can be displayed. For this, the status code must be known (see Status workflow).

Example:

 

Element of a linked collection

You can also display details about a collection if you know the position of the element to be displayed, by putting it between square braces [].

Example:

 

Element of a values list

To retrieve the name of a valueList in a message template, add the following expression: {valueListDesc(<attribut> )}. The attribute can also be taken from another entity.

Examples:

 

Multi-time zone management

In an international context, it is possible to specify the time zone in which you wish to display a "Date" or "Date-time" in a message template.

It is now possible to use a time context conversion in dynamic expressions, via the @<temporal context> operator. This serves to convert a time value on the basis of a given time context. In other words, it serves, for example, to express a date-time in a different time zone.

The format is:

The following are examples of use in messages relating to Occupancy

 

The following are examples of use in messages relating to work orders

All time values in CARL Source have their own time context. Consequently, unless otherwise specified in the message template, the time values are displayed in their own context.

To display the identifier of a time zone (e.g. Europe/Paris) with a time value, a pattern must be used along with the symbolVV. Example: dd/MM/yyyy HH:mm:ss VV

This conversion can also be used when operations are performed on temporal data: e.g. addition, subtraction.

Examples:

When specifying a pattern in the date-time formats, the following symbols can be used (extract from ICU documentationhttp://userguide.icu-project.org/formatparse/datetime)

Table of symbols for formatting dates and times

Symbol

Meaning

Example(s)

G

era designator

G, GG, or GGG
GGGG
GGGGG

AD
Anno Domini
A

y

year

yy
y or yyyy

96
1996

Y

year of "Week of Year"

Y

1997

u

extended year

u

4601

U

cyclic year name, as in Chinese lunar calendar

U

甲å­

r

related Gregorian year

r

1996

Q

quarter

Q
QQ
QQQ
QQQQ
QQQQQ

2
02
Q2
2nd quarter
2

q

Stand Alone quarter

q
qq
qqq
qqqq
qqqqq

2
02
Q2
2nd quarter
2

M

month in year

M
MM
MMM
MMMM
MMMMM

9
09
Sep
September
S

L

Stand Alone month in year

L
LL
LLL
LLLL
LLLLL

9
09
Sep
September
S

w

week of year

w
ww

27
27

W\

week of month

W

2

d

day in month

d
dd

2
02

D

day of year

D

189

F

day of week in month

F

2 (2nd Wed in July)

g

modified julian day

g

2451334

E

day of week

E, EE, or EEE
EEEE
EEEEE
EEEEEE

Tue
Tuesday
T
Tu

e

local day of week
example: if Monday is 1st day, Tuesday is 2nd )

e or ee
eee
eeee
eeeee
eeeeee

2
Tue
Tuesday
T
Tu

c

Stand Alone local day of week

c or cc
ccc
cccc
ccccc
cccccc

2
Tue
Tuesday
T
Tu

a

am/pm marker

a

pm

h

hour in am/pm (1~12)

h
hh

7
07

H

hour in day (0~23)

H
HH

0
00

k

hour in day (1~24)

k
kk

24
24

K

hour in am/pm (0~11)

K
KK

0
00

m

minute in hour

m
mm

4
04

s

second in minute

s
ss

5
05

S

fractional second - truncates (like other time fields)
to the count of letters when formatting. Appends
zeros if more than 3 letters specified. Truncates at
three significant digits when parsing.

S
SS
SSS
SSSS

2
23
235
2350

A

milliseconds in day

A

61201235

z

Time Zone: specific non-location

z, zz, or zzz
zzzz

PDT
Pacific Daylight Time

Z

Time Zone: ISO8601 basic hms? / RFC 822
Time Zone: long localized GMT (=OOOO)
TIme Zone: ISO8601 extended hms? (=XXXXX)

Z, ZZ, or ZZZ
ZZZZ

-0800
GMT-08:00
-08:00, -07:52:58, Z

O

Time Zone: short localized GMT
Time Zone: long localized GMT (=ZZZZ)

O
OOOO

GMT-8
GMT-08:00

v

Time Zone: generic non-location
(falls back first to VVVV)

v
vvvv

PT
Pacific Time or Los Angeles Time

V

Time Zone: short time zone ID
Time Zone: long time zone ID
Time Zone: time zone exemplar city
Time Zone: generic location (falls back to OOOO)

V
VV
VVV
VVVV

uslax
America/Los_Angeles
Los Angeles
Los Angeles Time

X

Time Zone: ISO8601 basic hm?, with Z for 0
Time Zone: ISO8601 basic hm, with Z
Time Zone: ISO8601 extended hm, with Z
Time Zone: ISO8601 basic hms?, with Z
Time Zone: ISO8601 extended hms?, with Z

X
XX
XXX
XXXX
XXXXX

-08, +0530, Z
-0800, Z
-08:00, Z
-0800, -075258, Z
-08:00, -07:52:58, Z

x

Time Zone: ISO8601 basic hm?, without Z for 0
Time Zone: ISO8601 basic hm, without Z
Time Zone: ISO8601 extended hm, without Z
Time Zone: ISO8601 basic hms?, without Z
Time Zone: ISO8601 extended hms?, without Z

x
xx
xxx
xxxx
xxxxx

-08, +0530
-0800
-08:00
-0800, -075258
-08:00, -07:52:58

'

escape for text

'

(nothing)

' '

two single quotes produce one

' '

'

 

Hypertext links

You can include a hypertext link to the detail sheet of the element in the body of the message.

To do this, simply put the text in the parentheses of the following expression: {detailLink()}.

You can also specify the identifier of the desired form if there are several forms (work order details and report, WR and WR to be taken into account).

This expression is also to be used if there is a custom form to apply.

In this case, enter: {detailLink(<attribute>,<Form identifier>, <Link name> )}.

Example 1:

 

Example 2:

Hypertext links are only possible if the message is in the "HTML" format.
If the format is "Text," use the key word {detailUrl} which will be replaced with the address of the subject detail or {baseUrl} which will be replaced with the address of CARL Source.

 

Link to a related element

You can also include in the message body a hypertext link to the details of an attribute of the element.
For example, the WR Asset, the supplier of the order, etc.

To do this, simply indicate the attribute in parentheses followed by the name of the hypertext link: {detailLink(<attribute>,{name value})}.

Example:

 

Expressions specific to the message template for an indicator

If the message template is used for an indicator, you have special key words.

 

Message template for an automatic job

If the message template is used for an automatic job, you can have the automatic job attributes appear as if it were the referenced entity.

Example: