These are configuration formats for the output of strings via EL syntax. The formats are available for assigning values to String-type Data Items in Update Data, for setting up an email message in Throwing Message Intermediate Event (Email), and for settings values for each Task. You can use fixed values, data references, and App/Process reference information to assign values to String-type Data Items. You can also use formatting functions to specify the output format, and functions to calculate JSON/XML escapes and hash values.
BPMN Icon: [Update Data]
Workflow Variables
Workflow Platform
Application Root URL (System variable)
Format | Assigned value |
---|---|
${var[applicationRoot]} | https://example.questetra.net/ |
App
App ID
Format | Assigned value |
---|---|
#{processModelInfoId} | 12 |
App Name
#{processModelInfoName} | Inquiry-handling flow |
Process
Process ID
Format | Assigned value |
---|---|
#{processInstanceId} | 12345 |
p#{processInstanceId} | p12345 |
#{#sformat('%d', processInstanceId)} | 12345 |
#{#sformat('%04d', processInstanceId)} | 12345 |
#{#sformat('%06d', processInstanceId)} | 012345 |
Process Sequence Number (Application variable)
#{processInstanceSequenceNumber} | 67890 |
#{#sformat('%06d', processInstanceSequenceNumber)} | 067890 |
xyz#{#sformat('%06d', processInstanceSequenceNumber)} | xyz067890 |
Process Start Time
#{processInstanceStartDatetime} | 2020-03-14 09:45:00 |
#{#dateFormatter.format('dd.MM.yyyy HH:mm (E) Z', processInstanceStartDatetime)} | 14.03.2020 09:45 (Wed) -0500 |
#{#dateFormatter.format('M.yy', processInstanceStartDatetime)} | 3.14 |
Process Start User
#{processInstanceInitQuserName} | SUZUKI Ichiro |
#{processInstanceInitQuser?.getEmail()} | suzuki@example.com |
Process Start Organization
#{processInstanceInitQgroupName} | Sales |
#{processInstanceInitQgroup?.getEmail()} | sales@example.com |
Parent Process ID
#{parentProcessInstanceId} | 1234 |
- Can be used in a Process started from [Message Start Event (HTTP)] by an HTTP request sent from the same workflow platform.
Data Items
String-type
Format | Assigned Value |
---|---|
#{#q_string} | ABC, def |
Numeric-type
Format | Assigned Value |
---|---|
#{#q_numeric} | 12,345.67 |
#{#sformat("%1.1f", #q_numeric)} | 12345.7 |
#{#sformat("%1.1f", #q_numeric - 45)} | 12300.7 |
- Decimal point notation is output according to the Data Item setting.
- Prefix / suffix characters are not output.
- It is also possible to set to output the calculation result.
Select-type
#{#q_select_radio} | Brazil |
#{#q_select_radio?.![value]} | br (choice ID of the selection) |
#{#q_select_check} | Japan, Brazil (display labels of the selections) |
#{#q_select_check?.![value]} | ja, br (IDs of selection) |
#{#q_select_check?.get(1)} | Brazil (the second choice label) |
#{#q_select_check?.get(0)?.value} | ja (the first choice ID) |
- When multiple choices are checked, the delimiter is ", (comma)".
Date/Datetime-type
#{#q_date} |
2020-03-14 (Date-type Y/M/D) |
#{#q_datetime} | 2020-03-14 23:45 (Datetime-type) |
#{#q_datetime.addDays(#q_num.intValue())} | 2020-03-24 23:45 (Add days of the value of Numeric-type Data Item) |
#{#dateFormatter.format('dd mm, yyyy', #q_datetime)} | 14 03, 2020 |
- Follows the sub-type settings in the Data Item
File-type
#{#q_file} | ((file name)) |
#{#q_file?.![contentType]} | ((List of Content-Type)) |
#{#q_file?.get(0)?.getCharset()} | ((Value of charset part of Content-Type of the first file)) |
#{#q_file?.get(1)?.length} | ((Size of the second file)) |
- Comma-delimited if multiple
User-type
#{#q_user} | SUZUKI Ichiro <suzuki@example.com> |
#{#q_user?.name} or #{#q_user?.getName()} |
SUZUKI Ichiro |
#{#q_user?.id} or #{#q_user?.getId()} |
13 |
#{#q_user?.email} or #{#q_user?.getEmail()} |
suzuki@example.com |
#{#q_quser?.isDeletedInFuture()} | true/false (With or without [Will be deleted in the future] flag) |
Organization-type
#{#q_org} | Sales <sales@example.com> |
#{#q_org?.name} or #{#q_org?.getName()} |
Sales |
#{#q_org?.id} or #{#q_org?.getId()} |
5 |
#{#q_org?.email} or #{#q_org?.getEmail()} |
sales@example.com |
#{#q_org?.isDeletedInFuture()} | true/false (With or without [Will be deleted in the future] flag) |
Table-type
#{#q_table} | 2 row(s) |
#q_table.summary['price'] | 2.25 |
#{#q_table?.get(0, 2)} | Cash |
#{#q_table?.getObject(0, 2)?.getDisplay()} | Cash |
#{#q_table?.getObject(0, 'kind')?.display} | Travel Fee |
#{#q_table?.rows?.![#this['name'] + '|' + #this['price']]} | Orange|1.00, Apple|1.25 |
Discussion-type
#{#q_discussion} | ------- [2020-02-07 13:29] <NAKAMURA Haruko> Hello, Goodbye (Assigning to single-line will result in an error) |
Guide Panel-type
n/a | (Display only) |
Advanced Output via Functions
Format | Assigned value |
---|---|
#{#escaper.escapeEcmaScript(#q_script_data)} | ((JavaScript escaped string)) |
#{#escaper.escapeJson(#q_json_data)} | ((Json escaped string)) |
#{#escaper.escapeXml(#q_xml_data)} | ((XML escaped string)) |
#{#escaper.escapeHtml(#q_html_data)} | ((HTML escaped string)) |
#{#sha256(processInstanceTitle)} | ((Hash string)) |
#{#randomString(12)} | pJBAzTDft8wT ((12 alphanumeric characters: [0-9a-zA-Z]{12})) |
#{#joiner.join(#q_select_check, '<br>')} | Second<br>Third ((Output the checkbox labels with Interfix)) |
#{#joiner.join(#q_select_check?.![value + ':' + display], '<li>', '</li>')} | <li>2:Second</li><li>3:Third</li> ((Output the checkbox ID:labels with Orefix/Suffix)) |
#{#joiner.join(#q_select_check, '<li>', '</li>', '<br>')} |
<li>Second</li><br><li>Third</li> |
#{ #joiner.join( #q_table?.rows?.![ #this['name'] + '|' + #this['price'] ], #NL) } |
Orange|1.00 Apple|1.25 ((Concatenate and output cell values of Table-type data)) |
#{ #joiner.join( #q_table?.rows?.![ #joiner.join(cols, ' | ') ], #NL) } |
Transportation: taxi|12.50|Cash Transportation: Airplane ticket|150.00|Credit Card ((Concatenate and output cell values of Table-type data)) |
#{#joiner.splitJoin(#q_string_multiple, '<br>')} |
Retrieves multi-line text<br>line by line<br>concatenates them with the specified Interfix<br>and outputs them. |
#{#joiner.splitJoin(#q_string_multiple, '<li>', '</li>')} |
<li>Retrieves multi-line text</li><li>line by line</li><li>concatenates them with the specified Interfix</li><li>and outputs them.</li> |
#{#joiner.splitJoin(#q_string_multiple, '<li>', '</li>', #NL)} |
<li>Retrieves multi-line text</li> |
- "#escapeEcmaScript()" works the same as "#escaper.escapeEcmaScript()"
- "#escapeXml()" works the same as "#escaper.escapeXml()"
Advanced Output via Formatter
"java.lang.String" and "com.questetra.bpms.core.event.scripttask.DateFormatWrapper" are available for "#sformat()" and "#dateFormatter" respectively. For output, format specifiers in EL syntax are convertible to various formats (e.g. Numeric-type to strings). The format "{padding}{display width of all strings}{display width of decimal places}f" is the basic specification method. The padding character will be inserted if the number of output digits is less than the display width of the whole string.
Format | Referred Value | Assigned Value |
---|---|---|
USD #{#sformat("%.2f", #q_numExample)} †Round-off |
123456 | USD 123456.00 |
123456.78 | USD 123456.78 | |
123456.789012 | USD 123456.79 | |
1 | USD 1.00 | |
-1 | USD -1.00 | |
-1.234 | USD -1.23 | |
USD #{#sformat("%.2f", ( #q_numExample - 0.005 ) )} †Round number greater than 0 |
123456.789012 | USD 123456.78 |
1 | USD 1.00 | |
-1 | USD -1.01 †Attention for behavior |
|
-1.234 | USD -1.24 †Attention for behavior |
|
JPY #{#sformat("% 4.0f", #q_numExample)} | 123456.78 | JPY 123457 †2 spaces |
1 | JPY 1 †4 spaces |
|
-1.234 | JPY -1 †3 spaces |
|
JPY #{#sformat("%,4.0f", #q_numExample)} †Insert a commma |
123456.78 | JPY 123,456 |
1 | JPY 1 †4 spaces |
|
INVOICE-#{#sformat("%04.0f", #q_numExample)} †Zero padding |
123456 | INVOICE-123456 |
123456.78 | INVOICE-123457 | |
1 | INVOICE-0001 | |
-1 | INVOICE--001 | |
-1.234 | INVOICE--001 | |
Chg: #{#sformat("%+.2f", #q_numExample)} †Put "+" (plus) |
123456.789012 | Chg: +123456.79 |
-1.234 | Chg: -1.23 | |
#{#dateFormatter.format('yyyy-MM-dd HH:mmZ', #q_datetime)} | 2021-04-12 09:45 | 2021-04-12 09:45+0900 |
#{#dateFormatter.format('yyyy-MM-dd HH:mmZ', #q_datetime.addDays(#q_num.intValue()))} | 7 | 2021-04-19 09:45+0900 |
#{#dateFormatter.format('GMT-0900', 'EEE. dd. MMMM, yyyy HH:mmZ', #q_datetime)} | 2021-04-12 09:45 | Mon. 11. April, 2021 15:45-0900 |
- Numeric data (parameter) fixed by a regular number type such as "processInstanceId" and "processInstanceSequenceNumber" changes conversion character, "f" into "d". Therefore, the basic specification method becomes "{display width of all strings}d".
- Formats of decimal places are dependent on the locale settings of the platform.
- https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Formatter.html
- https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/text/SimpleDateFormat.html
Notes
- The Expression Language used for the variable is based on the implementation of SpEL (Spring Expression Language)
- Formats with multiple variables can be set to String type Data
- E.g. If you set 'Process ID is #{processInstanceId}. Process Sequence number is #{processInstanceSequenceNumber}', the values of 'Process ID is 12345. Process Sequence number is 67890' will be assigned
- If there is a conflict, such multiple lines of data being assigned to a single-line String-type Data Item, it will result in an error
- If you do not set anything in the format settings, a blank will be assigned (data will be deleted)
- '%04d' (decimal notation plus 4 Digit zero (0)Padding) is processing to add a leading zero to make it 4 characters long
Comments
0 comments
Article is closed for comments.