...
The list of the actions types. The following list describes the basic set of actions, which are available in both script applications (object of Event type, Active picture).
Actions may be divided into the following basic categories (types):
- assignment actions
- action for accessing a database
- actions for handling error states
- control actions
- actions for communication with the operator
- archive manipulation actions
- actions for synchronisation synchronization of script actions execution
- controlling alarms
- structure manipulation actions
- data container manipulation actions
- access right manipulation actions
- actions for manipulation with a list of objects
- other actions
Note: the D2000 System allows the use of JAVA language to write the applications. The equivalents of ESL actions are stated in the extra html documentation files available in the D2000 System System installation directory - subdirectory Help.
...
Example: work with a database table (actions PG_ ...)
The third method is a modification of the first one. The modification is based on the fact, that work with a database table does not require the CONNECT and DISCONNECT actions.
...
use the action:
Transfer of handle to database connection between the running ESL scripts
Conversion and representation of values in the database
...
When writing the value of a variable (in most cases) of a local structured variable array into the database, it may be converted in two ways: if it is valid, it is written in a standard way. If it is invalid, a NULL value is written into the database. For TEXT type, this rule works in the same way, except for ORACLE, in which an empty text is represented by a NULL value (as the invalid value).
...
After reading the value (which is different from NULL) from the database, it will be converted to the required type, which is defined by a value type to which the result of the reading is stored. If the conversion is done successfully, the resultant value is valid. When reading the NULL value, the resultant value is invalid. For TEXT type, NULL value in database is converted to a valid empty text string. The only exception is the reading by DB_READ/DBS_READ script action on the ORACLE OCI platform , when a NULL value is converted to an invalid one.
The table below illustrates the result of writing and reading of text value depending on the database platform.
DBS_INSERT - writing a text value into database (D2Value -> DBValue).
PG_READ, BrowserRead - reading the text value from the database by PG_READ or into the Browser displayer (data displayed through OnFetchDone) (DBValue -> D2Value).
DB_READ - reading the text value by DB_READ (DBValue -> D2Value).
Database | DBS_INSERT | PG_READ, BrowserRead | DB_READ |
---|---|---|---|
Sybase 12/PostgreSQL | "Text" -> "Text" | "Text" -> "Text" | "Text" -> "Text" |
dbmanager.exe | "" -> "" | "" -> "" | "" -> "" |
Invalid->NULL | NULL->"" | NULL->"" | |
ORACLE OCI | "Text" -> "Text" | "Text" -> "Text" | "Text" -> "Text" |
dbmanager_ora.exe | "" -> NULL | ||
Invalid->NULL | NULL->"" | NULL->Invalid | |
ORACLE ODBC | "Text" -> "Text" | "Text" -> "Text" | "Text" -> "Text" |
dbmanager.exe | "" -> NULL | ||
Invalid->NULL | NULL->"" | NULL->"" |
...
The following actions allow to implement implementing a dialog with the operator or insert pictures from the operator console. It is advisable to use the predefined local variable _FROM_HIP
. If the script is started from a picture (graphic object connected to control), the local variable is automatically linked to the process, where the script was started from. This allows to address work with this process:
...
Kotva | ||||
---|---|---|---|---|
|
...
synchronization of script actions execution
...
The GETACCESS ad RELEASEACCESS actions allow to mutually synchronize the execution of actions in
...
Kotva | ||||
---|---|---|---|---|
|
...
Reading/writing data from/to archive, deleting data.
- CALCARCHEXPR
- CALCARCHEXPRCALCONDEMANDSTAT
- CALCSTATFUNC
- CALCSTATFUNCARR
- DELETEARCHDATA
- GETARCHARR
- GETARCHARR_TO_CNT
- GETARCHCOL
- GETARCHROW
- GETARCHSTRUCT
- GETARCHVAL
- INSERTARCHARR
- UPDATEARCHVAL
...
Kotva | ||||
---|---|---|---|---|
|
...
Working a with large-scale local structures sometimes requires to classify a structure, insert or delete a row, or find a row. ESL permits such operations, but they require the iteration of a particular structure in a loop. It is a time-consuming task. ESL, therefore, defines the following actions, which execute the described operations more effectively:
- COPYCOL
- COPYCOLIDX
- DELETE
- EXPORT_CSV
- EXPORT_CSV_TEXT
- FIND_TRUE
- GETCOLTIME
- GETROWDESC
- IMPORT_CSV
- INSERT
- SETCOLTIME
- SORT
- TRANSCOLTOROW
- TRANSROWTOCOL
...
These actions allow working with data storage, so-called data container (internal data structure). The owner of a container is always one running instance of the script. The data container can be shared between various scripts and processes.
The container has a unique identifier. The container is automatically terminated by terminating the script, to which it belongs, or by executing the action CNT_DESTROY.
The size of a container is not specified and is only limited by the operating memory size.
Each value included in the container is uniquely determined by the so-called key.
Users can insert, find, read and delete values into/from the container. The type of values to be inserted into the container is optional (Int, Bool, Text, Real, Time) or structures (entire structured variable, row, ...). The value type of the key must be one of Int, Bool, Text, Real, or Time, but all keys in the container must be the same type.
The actions CNT_GETNR, CNT_CNVTOARRAY, and CNT_GETITEM allow reading container values by index. The action CNT_CNVTOARRAY internally creates an array, that contains all container values sorted by key in ascending order. Index The index is the sequence number of the value within the array.
The array is terminated after inserting or deleting a value into/from it.
Data container may be created by the actions CNT_CREATE (a spare container), or GETARCHARR_TO_CNT. The second type is filled with pages containing data read from the archive.
The first access to the archive is more effective (memory consumption and partly speed) than using GETARCHARR action. Data container created by GETARCHARR_TO_CNT action can use only the actions CNT_GETNR, CNT_FIND, and CNT_DESTROY (example).
...
Kotva | ||||
---|---|---|---|---|
|
...
Actions for manipulation with a list of objects allow to:
- create the list of objects according to set criteria
- go on the first, previous, next, or last page of the list
- go on the page on the basis of its page number
- recognize the number of objects in the list (caution - it is not the quantity number of objects on the page!)
- close the list
After the list has been created data are accessible on the first page immediately.
Each record in the list of objects represents the unique identifier, name, description, type of object, and number of rows and columns.
...
Example of manipulation with a list of objects (actions LST_...).
...