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 on remote database servers.
  • XSQL expressions on remote 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:

  1. var, direct reference used in JUEL expressions
  2. @{var}, literal reference used in SQL expressions
  3. @var, literal reference used in SQL 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

                                

Loading...

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 the remote 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
If expression includes an optional 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/XSQL

SQL/XSQL statements are executed on the database server or application server.

  • For SQL expressions, @ variables are replaced by literal values; the resulting statement is executed on the database server. SQL statements are normally comprised of INSERT, DELETE or UPDATE conditions, but may include calls to stored procedures or functions.
  • For XSQL expressions, @ variables are replaced by literal values; the resulting XML is executed on the application server.

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/SQLEXPR Local expression which is parsed (UEL) or, if it contains @ variables, is evaluated on database server.
apps_wms_formatl col_default UEL/SQLDATA 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/XSQL 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/XSQL Statement variables are parsed and executed on the database server.
apps_wms_formath sql_action_exec SQL/XSQL Statement variables are parsed and executed on the database server.
apps_wms_formath sql_action_cancel SQL/XSQL 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 full SQL 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 complete SQL 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.).

Example
Copy
SELECT linm_codart FROM wms_inhouse_stkmov_line WHERE linm_seqno = '@v_linm_seqno'
Copy
RGRE

7.2 Hide Condition - col_hide_cond

UEL expression syntax.

Example
Copy
txt_canpro == v_canmov_ori
Copy
v_close_cart > 0

7.3 Validate Condition - sref_help_cond

SQL Condition

Example
Copy
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
Copy
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.

Copy
SELECT " + stmt + " FROM systables WHERE tabname = 'systables'
Example
Copy
@txt_canpro >= @v_canmov
Copy
(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