Axional Terminal
supports two expression engines which are used in diferent situations
according to input context.
- Java EL (Unified Expression Language) for
local
regular expressions. -
SQL
expressions onremote
database servers. -
XSQL
expressions onremote
application servers.
Both expression engines can access form variables (user input data). For the UEL
expression parser,
variables are provided using an internal map
. For SQL
or XSQL
, variables are replaced
literally in the statement.
1 Form Variables
Expressions commonly use data provided by user input and stored in forms as variables. Each variable has
a name and can be either local
to the form or general (common to all user sessions and settings).
There are three ways to reference form variables, depending on the usage context:
-
var
, direct reference used in JUEL expressions -
@{var}
, literal reference used inSQL
expressions -
@var
, literal reference used inSQL
expressions
Use @{var}!
From version 0.0.366
onwards, the preferred way to reference variables is @{var}
. Other ways are maintained for backwards compatibility.
Non-Form Variables
The literals @{user}
and @{user_code}
are always replaced by the user_code
of the user who is currently logged in.
2 Expression Flow
3 Evaluation Contexts
All expressions are evaulated in a specific context, which may be either local
or remote
.
- A
local
context refers to the application running on the terminal (device), so only form and terminal variables may be referenced. - A
remote
context refers to theremote
database server, so any data from the database may be referenced.
Context | Description |
---|---|
UEL
|
UEL expressions are evaluated locally on the terminal device. Expressions may contain algebraic operations,
comparisons and references to variables.
Expressions evaluated with
UEL should not use @ to reference. If an expression
contains @ references, it is always evaluated as an SQLEXPR on the database server.
For performance reasons, UEL expressions should be used whenever possible.
|
SQLEXPR
|
When an expression contains @ references to variables, it will be parsed as an SQL expression on the remote database server.
These expressions may work similarly to UEL expressions, but can also include SQL statements. SQLEXPR are evaluated using the following statement
with IBM Informix database agents.
Copy
SELECT {expression} FROM systables where tabid = 1 SQL statement, it must be placed in parentheses.
|
SQLDATA
|
SQLDATA expressions are used to retrieve data (a single row statement with one or more columns) to be used as field defaults.
Therefore, these expressions are valid SQL statements which return one row and one or more columns mapped to form data.
|
SQLEXISTS
|
SQLEXISTS is used to perform soft reference verifications for data integrity checks.
The following SQL statement is executed on the remote database server:
Copy
SELECT sref_colname AS sref_colalias, (sref_help_aux) FROM sref_tabname WHERE {sref_help_cond} |
SQL/
|
|
4 Evaluated Fields
The following table describes the application's evaluable fields.
Table | Column | Eval | Description |
---|---|---|---|
apps_wms_formatl | col_hide_cond |
UEL
|
Local expression parsed |
apps_wms_formatl | col_check_exp |
UEL/
|
Local expression which is parsed (UEL ) or, if it contains @ variables, is evaluated on database server. |
apps_wms_formatl | col_default |
UEL/
|
Local expression which is parsed (UEL ) or, if it contains @ variables, is evaluated on database server. |
apps_wms_formatl | sref_help_cond |
SQL/EXISTS
|
An SQL statement checking that data exists is executed on the remote database server. |
apps_wms_formatl | col_after_sql |
SQL/
|
Statement variables are parsed and executed on the database server. |
apps_wms_formatg | group_cond |
UEL
|
Local expression which is parsed. |
apps_wms_formatg_buttons | button_cond |
UEL
|
Local expression which is parsed. |
apps_wms_formatg_buttons | button_action |
SQL/
|
Statement variables are parsed and executed on the database server. |
apps_wms_formath | sql_action_exec |
SQL/
|
Statement variables are parsed and executed on the database server. |
apps_wms_formath | sql_action_cancel |
SQL/
|
Statement variables are parsed and executed on the database server. |
5 Java UEL Expressions
For more information, please see the Axional Expr Library.
6 SQL Expressions
SQL
expressions are evaluated on the database server. Depending on context, programmers will write a part of the SQL
expression
which may be:
-
SQLEXPR
, an expression itself -
SQLDATA
, a fullSQL
statement to get a column or set of columns corresponding to a single row -
SQLEXISTS
, a part of the WHERE clause used to check that data exists -
SQL
, a completeSQL
statement used to INSERT, DELETE, UPDATE or SELECT rows
Given the following variable values:
Variable | Value |
---|---|
number | 1 |
code | A |
Thre following table shows a list of common SQL
expressions by type.
Type | Expression | Result |
---|---|---|
UEL
|
number + 1 | 2
Note that expressions with no
@ variable references are evaluated locally by JUEL.
|
SQLEXPR
|
@number + 1 | SELECT 1+1 FROM systables WHERE tabid = 1 |
SQLEXPR
|
(SELECT COUNT(*) FROM table WHERE code = '@code' AND reference IS NULL) | SELECT (SELECT COUNT(*) FROM table WHERE code = 'A' AND reference IS NULL) FROM systables WHERE tabid = 1 |
7 Expression Uses
Columns can be referenced via @{varname}
notation.
7.1 Default Value - col_default
Full SQL
statement syntax or a constant scalar syntax (string, number, etc.).
SELECT linm_codart FROM wms_inhouse_stkmov_line WHERE linm_seqno = '@v_linm_seqno'
RGRE
7.2 Hide Condition - col_hide_cond
UEL
expression syntax.
txt_canpro == v_canmov_ori
v_close_cart > 0
7.3 Validate Condition - sref_help_cond
SQL
Condition
hu_measure_type IN (SELECT hut_code FROM wms_hlunit_type WHERE hut_nature = 3) AND hu_recint = '@recint' AND hu_status = 'C' AND hu_parent IS NULL
route_recint = '@recint' AND (route_codalm = '@almac' OR route_codalm IS NULL)
7.4 Check Condition - col_check_exp
SQL
Condition executed in the column.
SELECT " + stmt + " FROM systables WHERE tabname = 'systables'
@txt_canpro >= @v_canmov
(SELECT COUNT(*) FROM wms_hlunith WHERE hu_code = '@v_pallet' AND hu_recint = '@recint' AND hu_measure_type = '@v_hu_type' AND hu_status IN ('F', 'O') ) count_pallet