Skip to main content
Version: 7.0

Data properties (DATA)

Data property is a property which value is stored in the database and may change through the execution of the corresponding action. Each parameter and the value of a data property must belong to a certain specified class. If a parameter does not belong to the specified class or is NULL, then the property value will return NULL. When an object is deleted or changes its class, the value of a data property is reset to NULL if the object is an argument or the value of that property and no longer belongs to the corresponding declared class.

Local data properties​

Data properties can be local. Such properties retain their values only within the session, i.e. they are not saved to the database, which means when applying changes these values are reset to NULL by default. A local data property is NULL in a session unless values have been assigned to it there or carried into it by session-management operations. A property computed from it uses that NULL for it. An assigned value stays in the session for the rest of its life — for instance, between the actions executed from one form, whose session lives as long as the form is open — until it is reset by applying or canceling changes (by default) or overwritten. The end of the action that assigned it does not clear a local property declared at the module level.

A regular local property is convenient as temporary storage inside one session or one interaction flow. If the value must survive session-management operations, the local property can be made nested.

Nested local data properties​

A nested local data property is a local data property whose value is preserved by the platform during the required session-management operations.

The basic nested mode preserves the property value for all major session-management operations:

In the basic mode the values therefore travel in both directions through every new session the property takes part in: a value assigned inside the new session — by a form opened there, for instance — is copied back into the session the new one was created from as soon as the creating action ends, and a later new session created from that session receives the values it holds by then, whenever that operation migrates the property.

If preservation is required only for part of these operations, a restricted nested mode is used: either only for applying changes and canceling changes, or only when entering and leaving a new session. The restricted mode for applying and canceling changes does not by itself copy the property through a new session: the values of such a property — the working storage of one form, for instance — stay in the session they were assigned in unless an operation copies the whole session or selects the property explicitly.

Language​

To declare a data property, use the DATA operator.

Examples​

CLASS Item;
quantity = DATA LOCAL INTEGER (Item);

sessionOwners = DATA LOCAL NESTED MANAGESESSION INTEGER ();

CLASS Order;
selected = DATA LOCAL NESTED NOMANAGESESSION BOOLEAN (Order);

CLASS Country;
isDayOff = DATA BOOLEAN (Country, DATE);