Page History
Panel | ||||
---|---|---|---|---|
TSL comment /* */You can use TSL comment tags in order to add comment to your TSL. Syntax
Inputs:
Example
|
Panel | ||||
---|---|---|---|---|
TSL IF statement [[[IF expr]]] [[[/IF]]]The IF statement enables you to selectively perform tasks within your TSL message, based on some criteria which evaluate to TRUE or FALSE. Syntax
Inputs
Example Suppose you want to create a welcoming message after a user has logged in to your application. Then you could create the following TSL message:
When user John Doe logged on, the message shown in your application is: “Welcome Mr. John Doe” When user Jane Doe logged on, the message shown in your application is: “Welcome Mrs. Jane Doe” If the gender is unknown the message will look like this: “Welcome Jane Doe” |
Panel | ||||
---|---|---|---|---|
TSL IF ELSE statement [[[IF expr]]] [[[ELSE]]] [[[/IF]]]The IF ELSE statement enables you to selectively perform tasks within your TSL message, based on some criteria, which evaluate to TRUE or FALSE. When TRUE executes the task specified in the IF part of the statement, in all other cases executes the task specified in the ELSE part of the statement. Syntax
Inputs
Example Suppose you want to create a welcoming message after a user has logged in to your application. Then you could create the following TSL message:
When user John Doe logged on, the message shown in your application is: “Welcome Mr. John Doe” If the gender is unknown the message will look like this: “Welcome Jane Doe” |
Panel | |||||||||
---|---|---|---|---|---|---|---|---|---|
TSL IF ELSEIF statement [[[IF expr1]]] [[[ELSEIF expr2]]] [[[/IF]]]The IF ELSEIF statement enables you to selectively perform tasks within your TSL message, based on some criteria, which evaluate to TRUE or FALSE. When TRUE executes the task specified in the IF part of the statement, the task specified in the ELSEIF part of the statement is only executed when the specified criteria are met. Syntax
Inputs
Example Suppose you want to create a welcoming message after a user has logged in to your application. Then you could create the following TSL message:
When user John Doe logged on at 8 o’clock am, the message shown in your application is: “Good morning John Doe” When user John Doe logged on at 7 o’clock pm, the message shown in your application is: “Good evening John Doe”
|
Panel | ||||
---|---|---|---|---|
TSL FOREACH statement [[[FOREACH entity]]] [[[/FOREACH]]]Use this statement to repeat a text for each instance of an entity. Syntax
Inputs
Example Suppose you want to create an overview of all registered users. Then you could create the following message:
If you have three registered users: John Doe, Jane Doe and Mr X your user list would look like this: Name: Doe, John Name: Doe, Jane Name: X, Mr |
Panel | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TSL FOREACH IN statement [[[FOREACH entity IN relation]]] [[[/FOREACH]]]Use this statement to repeat a text for a subset of instances of an entity. Syntax
Inputs
Example Suppose you created a parent and a child entity. The parent has a multivalue relation with the child via the attribute Parent.Has_Children. If the following instances where created:
To create an overview of the children per parent you could create the following TSL message:
This results in: John has children: Name: Kim Date of birth: 26-09-1998, Name: Rick Date of birth: 13-05-2000, Name: Bob Date of birth: 03-08-2003 Dave has children: Name: Mary Date of birth: 04-06-1982
|
Panel | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TSL FOREACH WHERE statement [[[FOREACH entity WHERE condition]]] [[[/FOREACH]]]Use this statement to repeat a text for a subset of instances of an entity. Syntax
Inputs
Example Suppose you have multiple persons. If the following instances where created:
To create an overview of all persons older than 40 you could create the following TSL message:
This results in: Persons older than 40: Angela, 47; Dave, 82;
|
Panel | |||||||
---|---|---|---|---|---|---|---|
TSL FOREACH ORDER BY statement [[[FOREACH entity ORDER BY attr DESC|ASC]]] [[[/FOREACH]]]When you use the FOREACH or FOREACH IN statement to repeat a text for multiple instances, you can add the ORDER BY statement to create an ordered list of texts. Add either DESC if you want to sort the list descending or ASC if you want to order the list ascending. Syntax
Inputs
|
Panel | ||||||
---|---|---|---|---|---|---|
TSL sequence [[[#]]]Use this operator to add a sequence-number to each instance in a set of instances. Note: The sequence operator returns the sequence-number of the FOREACH loop that it is used in. It is not the sequence in which the instances where created. The sequence number starts at 0. Syntax
Input
Example Suppose you want to create an overview of all registered users. Then you could create the following message:
If you have three registered users: John Doe, Jane Doe and Mr X your user list would look like this: 0 Doe, John 1 Doe, Jane 2 X, Mr Or you want to create a comma separated list that contains all users:
Than the result would look like this: John Doe, Jane Doe, Mr X. |
Panel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TSL formats [[[expression{format}]]]There are two different types of formatting available in TSL, number formats and date formats. Both formats are applied to attributes or expressions in the same way. Syntax
Inputs
Numbers In TSL, you can use number formats to change the appearance of numbers, without changing the number behind the appearance. The number format you apply does not affect the actual value. In this context a number can be any of the following basetypes; number, integer, currency or percentage. The number formats used in TSL are common Java decimal formats. The most commonly used formatting symbols are listed below. For a complete documentation we refer to the online java documentation that is available at https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/text/DecimalFormat.html.
These symbols are used to create a format pattern. How this pattern is created is shown in the examples below. To use the symbols as ordinary characters in your expression use the escape character.
Examples
Dates In TSL, you can use date formats to change the appearance of dates, without changing the date behind the appearance. The date format you apply does not affect the actual value.
These symbols are used to create a format pattern. Examples
|