It is possible to define arbitrary split conditional expressions using EL.
If the conditional expression evaluates as true, the Process will proceed to the specified transition destination. If the evaluation result is false (including an evaluation error or a null result), the Process does not proceed to the specified destination as a conditional mismatch.
1. Available values for EL
The following values can be used for EL.
- App and Process information (Process attributes)
- Data items
※ Guide Panel/Discussion-type are not supported - The following items cannot be used as it will result in a validation error.
- System constants: ${var[applicationRoot]}
- Application variables: ${var[param1]}
2. Operators available in EL
The following operators can be used in EL.
- Comparison operators
- ==, !=, >, >=, <, <=
- These comparison operators are available also for Numeric-type and Datetime-type Data Items
- The left and right sides of the comparison operators must be of the same type
In particular, please note that comparison between different subtypes (Y/M/D, Y/M, Y, M/D) of Date-types or simple comparison between Date and Datetime-type Data Items will result in false evaluation.
- Arithmetic Operators
- +, -, *, /, %
- Arithmetic operators between String-type Data Items do not work. It is required that at least one or both of them be Numeric-type Data Items
3. Conditional expression examples using EL
Conditions Using Workflow Variables
| Evaluation Expression | Content of the Expression |
|---|---|
| processInstanceDebug == true | The debug Process proceeeds to the transition destination specified for debug processes. |
| processInstanceTitle == 'The Title.' | The Title of the Process is equal to "The Title". |
| processInstanceId <= 20000 | Process ID is less than 20000. |
| processInstanceInitQuserName?.startsWith('Jack') == true | The name of the user who started the Process starts with "Jack". |
| processInstanceInitQuser?.getId() == 22 | Process Start User's ID is equal to 22 |
| processInstanceInitQgroupName?.endsWith('Customer') == true | The name of the Process Start Organization ends with "Customer". |
| processInstanceInitQgroup?.getEmail() == 'customer@example.com' | E-mail of the Process Start Organization is equal to "customer@example.com". |
| processInstanceStartDatetime?.toString() == #q_datetime?.toString() | Process Start Date and Time is equal to the value of the Datetime-type Data Item 'q_datatime'. |
| processInstanceStartDatetime == #q_datetime |
[ATTENTION]
|
| processInstanceSequenceNumber >= 10 | The Process sequence number is 10 or more. |
| processModelInfoId == 123 | App ID is equal to 123 |
| processModelInfoName.contains('Satisfaction') == true | Includes "Satisfaction" in the App name |
Conditions Using Data Items
| Evaluation Expression | Content of the Expression |
|---|---|
| #q_string0?.contains('consultation') == true | The value of the String-type Data Item "q_string0" contains "consultation". |
| #q_string0 == null | String-type Data Item "q_string0" is not yet entered. |
| #q_string0 != null | A value is entered in the String-type Data Item "q_string0". |
| #q_numeric1 <= 999 | The value of the Numeric -type Data Item "q_numeric1" is 999 or less. |
| #q_radio2?.get(0)?.value == '3' | The value of the Choice ID of the item selected with the "q_radio2" Select-type (radio button) item is equal to "3". |
| #q_checkbox3?.?[value == 'b']?.size() == 1 | An item whose Choice ID is "b" is selected in the Select-type (checkbox) Data Item "q_checkbox3". |
| #q_select != null && {‘option value1’, ‘option value’}.contains(#q_select.get(0).value) | Either of the options is selected in the Select-type Data Item (checkbox) |
| #q_ymd4 == #q_ymd5 | The value of the Date-type (year, month, day) Data Item "q_ymd4" is equal to the value of "q_ymd5". |
| #q_ym6 < #q_ym7 | The value of the Date-type (year and month) Data Item "q_ym6" is smaller than the value of the Data Item "q_ym7". |
| #q_datetime8 >= #q_datetime9 | The value of the Datetime-type Data Item "q_datetime8" is greater than or equal to the value of the Data Item "q_datetime9". |
| #q_file10 == null | The File-type Data Item "q_file10" has no file attached. |
| #q_file10?.size() > 1 | The number of file attachments for File-type Data Item "q_file10" exceeds 1. |
| #q_user11?.id == 10 | User's ID of the User-type Data Item "q_user11" is equal to 10. |
| #q_user11?.getEmail() == 'SouthPole@example.com' | User's E-mail in the User-type Data Item 'q_user11' is equal to 'SouthPole@example.com'. |
| #q_table12?.get(1, 2) == 'Apple' | The value of row 2, column 3 (sub-data item: String-type) of the Table-type Data Item 'q_table12' is equal to 'Apple'. |
| #q_organization13?.getId() == 15 | The ID of the organization in the Organization-type Data Item "q_organization13" is equal to 15. |
Appendix
-
It is possible to combine multiple conditional items as well as a single condition.
processInstanceInitQuserName?.startsWith('Jack') == true && processInstanceInitQgroup?.getEmail() == 'customer@example.com' && #q_string0?.contains('consultation') == true && #q_radio2?.get(0)?.value == '3' && #q_datetime8 >= #q_datetime9 && #q_organization13?.getId() == 15
- If the result of the operation is null, it will be treated as false and is therefore deprecated.
-
In the following description, if "#q_string" is not entered (null) the evaluation result of the EL will also be null, and the operation result of the conditional expression will be false.
(deprecated) #q_string?.startsWith('test') -
To avoid a null evaluation of the EL, the following description is recommended.
#q_string?.startsWith('test') == true
-
- Similarly, the "!" operator is also deprecated because it may induce an evaluation error.
-
In the following description if "#q_string" is not entered the evaluation result of the EL will be !null, resulting in an evaluation error, and the result of the conditional expression will be false.
(deprecated) !#q_string?.startsWith('test') -
To avoid !null evaluation errors in the EL, the following descriptions are recommended.
#q_string?.startsWith('test') == falseor
#q_string?.startsWith('test') != true
-
- See the following reference page for available Data Item types.
- Data Items
- Guide panel/Discussion-type is not supported.
- For details on how to use EL for each Data Item please refer to the reference below.
Comments
0 comments
Please sign in to leave a comment.