Skip to main content

JDito System Modules and System Variables

System Modules

In JDito, all extended functionalities beyond basic JavaScript capabilities are provided through system modules. Each module groups methods and constants that pertain to a specific topic or domain.

Purpose and Use of Modules

A module typically contains all methods and constants related to its domain. For instance, system.calendar includes all functions used to interact with calendar entries, while system.db provides interfaces for database operations.

Constants act as readable aliases for cryptic values to improve code clarity. For example, instead of using the numeric value 7 to identify Apache Derby as a database type, JDito provides the constant db.DBTYPE_DERBY10 for better readability.

Methods allow developers to control the ADITO system — for example, by querying a database or updating a UI component. These methods are not to be confused with JDito functions, which are defined by users and consist of ordered JavaScript instructions. JDito methods, by contrast, are implemented in the interpreter and provide access to core ADITO functionalities.

To use any module, it must be imported at the beginning of the JDito process.

warning

The import statements must always appear at the very top of a process. If placed elsewhere, an error will occur.

Import Example

import { result } from "@aditosoftware/jdito-types";

// Code begins here
result.string("My result");

Available System Modules

JDito provides a variety of system modules, each grouping methods and constants by topic. These modules must be imported explicitly and offer access to the core ADITO platform functionalities.

System ModuleDescription
system.ACTIONContains only constants representing client actions, e.g., ACTION.FRAME_CREATE, ACTION.FRAME_EDIT.
system.ALIASContains only constants used to reference keys within alias objects, such as ALIAS.CHARSET, ALIAS.PASSWORD.
system.SQLTYPESProvides constants for SQL column types and validation methods, e.g., SQLTYPES.isTextType(SQLTYPES.CHAR).
system.calendarsGroups all methods and constants for working with calendars and calendar entries.
system.ctiContains methods and constants for integrating with telephone systems.
system.datetimeIncludes methods and constants for handling dates, timestamps, and time zones.
system.dbProvides methods and constants for interacting with databases: SELECT, UPDATE, DELETE, etc.
system.eMathOffers safe arithmetic operations (add, subtract, multiply, divide, round) on String-based numbers. Supports both integer and decimal operations, along with rounding constants.
system.fileIOMethods and constants for server-side file input/output operations.
system.ganttCurrently contains no functionality.
system.imMethods and constants for the XMPP backend (instant messaging).
system.imClientMethods and constants for the XMPP client.
system.indexsearchContains methods and constants for indexing and searching with Solr.
system.loggingProvides logging functionality.
system.mailMethods and constants for sending emails and handling email objects.
system.neonMethods and constants for controlling the Neon web client.
system.neonToolsProvides helper methods for managing the Neon client.
system.netAllows REST/SOAP web service calls, URL validation, and retrieval of URL contents.
system.notificationMethods and constants for working with the ADITO notification system.
system.packMethods and constants for ZIP archive operations.
system.pluginEnables calling ADITO plugins on the server side.
system.processProvides methods and constants for executing JDito processes immediately or on schedule.
system.projectMethods and constants for accessing deployed project models, such as getAlias(), getDatamodel(), getInstanceConfigValue().
system.questionDisplays modal dialogs using methods and constants.
system.reportInterfaces with the ADITO reporting engine.
system.resultMethods for returning values to the ADITO core (used in value or display processes).
system.textMethods for working with multi-string encoding/decoding, text formatting, parsing, and hashing.
system.toolsDespite its name, this module handles user and role management.
system.translateProvides access to the ADITO translation subsystem.
system.treetableCurrently contains no functionality.
system.utilUtility functions such as BASE64 encoding/decoding and UUID generation via getNewUUID().
system.varsMethods for reading and setting variable values (component, field, system, local, image).

System Variables

System variables are containers for values provided by the ADITO core or defined within JDito code. They are always prefixed with $ and accessed via the system.vars module using vars.get() or vars.set().

Example Usage
// Reading a variable
vars.get("$sys.operatingstate");
vars.get("$field.UUID");
vars.get("$local.value");

// Setting a variable
vars.set("$context.calculatedVal", calcValue);
vars.set("$field.COUNTRY", myCountry);
note

The method vars.getString() is no longer required, even for reading string values. This method will be marked as deprecated in future ADITO versions.

important

System variables can only be read and written within the context in which they were created.

It is not possible to set a variable from one context (e.g., “Organisation opened in tab 1”) and access it from another (e.g., “Organisation opened in tab 2”).

As a result, using global variables as caching mechanisms is highly limited, because cache invalidation is difficult to control. Typically, invalidation occurs:

  • After a user re-login, handled in the autostartNeon process, or
  • Via a designated ServiceImplementation configured for the process.

There are several types of system variables, not only $sys variables. In the following, you can find a description of important system variables.


$local Variables

$local variables exist for the duration of a user’s session (per login). The persistence of these variables on the server depends on the configuration of the corresponding server process, which must always be executed under a specific user.

For instance, in the autostartNeon process, various $local variables are initialized that are later required by the client. $local system variables are only visible within specific JDito processes. They are primarily set by the ADITO core to pass contextual values into those processes.

A common example is the process_audit process, which reacts to dataset audit events. Information about affected database columns, their types, and their old and new values are passed as $local variables and can be accessed through the system.vars module:

// Reading a local variable
var action = vars.get("$local.action");

// Setting a local variable
vars.set("$local.taskId", "1234-1234-1234");

As for the server, this means:

When configuring the interval of a server process, it is possible to define whether the JDito instance should be retained:

  • If yes, then the global variable persists across multiple executions — on the same server pod (e.g., adito-web-bg-0), i.e., the software-side instance of an ADITO server.
  • If no, then the global variable is reinitialized for each new execution and must be set again.

Overview of $local Variables

Maintaining a complete and up-to-date documentation of all $local variables — including their availability and usage across every possible context — would be highly complex and difficult to maintain.

tip

Instead, use the Designer’s debugger to inspect currently available $local variables. When the debugger is active, a window labeled "Debugger" shows all variables relevant to the process context where the current breakpoint is located.

debugger-local-variables Figure: Inspection of $local variables via the Designer Debugger.

For more information on the debugger, consult the Designer Manual (PDF).

note

The below list does not include $local variables that are explained in other chapters of this documentation. For example:

tip

When searching this document for $local variables using full-text search, be aware that for formatting reasons, some variable names may include line breaks.
As a result, variables like $local.initialRowdata may only be found by searching for initialRowdata.

warning

This list is neither complete nor exhaustive.
It includes only typical examples. Many $local variables may have different meanings in different processes.

Selected $local Variables

Name: $local...Examples of Return ValueData TypeExamples of Usage
conditionFilter condition, e.g., "CONTACT.STATUS is null"StringfilterConditionProcess of a FilterExtension; groupQueryProcess of a FilterExtensionSet
filterFilter configuration (see below)objectcontentProcess of a jDitoRecordContainer
idvalueIDs affected by a change in an indexRecordContainerobjectaffectedIds process of an indexRecordContainer (see chapter “Index for Global Search”)
idvaluesID affected by a change in a jDitoRecordContainerStringcontentProcess of a jDitoRecordContainer
initialRowdataInitial values of an Entity dataset (before user changes)object (EntityField name → initial value)onDBUpdate process of a dbRecordContainer
lookupFieldNameSee belowStringUsed in FilterExtensionSet for Attributes
rawvalueUser input (e.g., selected item in combo box)StringfilterConditionProcess of a FilterExtension
rowdataEntity dataset values after user changesobject (EntityField name → value)onDBDelete
uidRecord identifier in a dbRecordContainerStringonDBInsert, onDBUpdate, onDBDelete

$local.filter

This variable provides the filter configuration used within a context such as a jDitoRecordContainer. Its structure is shown below.

// if a filter is set, it looks like this:
{
"filter": {
"type": "group",
"operator": "AND",
"childs": [
{
"type": "row",
"name": "ACTIVE",
"operator": "EQUAL",
"value": "Ja",
"key": "true",
"contenttype": "TEXT"
}
]
},
"permissions": null,
"subset": null,
"ids": null
}

// if a filter is NOT set, it looks like this:
{
"filter": null,
"permissions": null,
"subset": null,
"ids": null
}

$local.lookupFieldName

Availability:
This variable is available in the valueProcess of a Parameter within a Consumer.

Content:

  • If the Consumer is connected to an EntityField (i.e., lookup field), the variable contains the name of that EntityField.
  • If used in FilterExtensions or FilterExtensionSets where a Consumer provides the values, the variable contains the name of the FilterExtensionField.

Example Use Case in xRM:
In a FilterExtensionSet for Attributes, some FilterExtensionFields use a Consumer to provide selectable values. To identify which FilterExtensionField triggered the process, the system uses:

vars.get("$local.lookupFieldName");

This allows the Consumer to react dynamically based on the selected FilterExtensionField.


$sys Variables

$sys variables are visible within a single client session and are independent of any specific context. They are typically used to store values required throughout the client, such as configuration parameters or access control via sales areas.

// Getting a sys variable
var action = vars.get("$sys.useRights");

// Setting a sys variable
// Only possible if SALESAREA is a dynamic user property
vars.set("$sys.salesArea", tools.getCurrentUser()[tools.PARAMS]["SALESAREA"]);

Overview of $sys Variables

The following table provides a detailed overview of most of the available $sys variables in ADITO. These variables are accessible within the client context and can be used to retrieve system, session, UI, and user-related information.

Name ($sys....)Description of Return Value
activeimageInternal ID of the active top image (entity, report, mail)
activewindowInternal ID of the active frame
ancestorimageuidID of all currently opened frames
calenderusersCalendar users
clientcountryCountry of the client
clientdataDATA directory of the client (visible via $ADITO_DATA)
clienthomeHOME directory of the client
clientidID of the client
clientlanguageLanguage of the client
clientlocaleLocalisation of the client (e.g., de_DE)
clientosOperating system of the client
clienttempTemp directory of the client
clientuidUID of the client
clientvariantLanguage variant of the client
clientversionVersion of the client (e.g., 2021.0.1)
contentID of the currently selected record
currentcontextnameName of the current context
currententitynameName of the current entity
currentimageID of the current image variable
currentimagenameName of the current image variable
currentimagetypeType of the current image variable
datarowCondition of the current record (excluding WHERE)
datarowcountNumber of datasets loaded in the RecordContainer (considering filters and limit via maximumDbRows)
datarowcountfullTotal number of datasets available via the RecordContainer, ignoring maximumDbRows limit
dateSystem date as long
dbaliasActive database alias
dynamicdateSystem date as long
extendedpatternPattern as executed
filterCurrent selection filter object with properties: .filter, .permission, .filterCondition, .condition
filterableBoolean indicating whether the current view is filterable
groupableBoolean indicating whether the current view is groupable
groupsCurrently active groups
hasSelectionBoolean indicating whether a selection is used
licenseidID of the license
operatingstateCurrent operating state of the entity/view
orderCurrent record sort order
originOrigin of the URL
outsidelineaccessArea code of the provider (CTI)
pageableBoolean indicating whether the RecordContainer is pageable
parententityName of the parent entity (for dependencies)
parentuidUID of the parent entity (for dependencies)
patternCurrent pattern as entered
pendingpatternNext pattern that will be executed
preferencesidID of the selected preferences (if multiple choices exist)
presentationmodeCurrent state of the view/entity
recordstateState of the current record in the view/entity
scopeScope of the client
selectionCurrent selection (for entity or index)
selectionRowsAll rows in the current selection
selectionsMultistring array with the following structure:
[0] Static: Used to open context
[1] Designer: Defined in Designer
[2] Search mask: User input
[3] Dependency: Linked record
[4] Extra: Global search
serveraddressServer URL address
serverdataDATA directory of the server
serverhomeHOME directory of the server
serveridID of the current system
serverosOperating system of the server
serverportPort(s) used by the current server
servertempTEMP directory of the server
serverversionServer version
staticdateCurrent date (static) as long
staticmillisCurrent timestamp in milliseconds
superframeName of the upper frame
superframeidID of the upper frame
superimageName of the upper image
superimageidID of the upper image
superimagetypeType of the upper image
superwindowidID of the upper window
tablescanbecreatedBoolean indicating whether new records can be created in this context
tablescanbedeletedBoolean indicating whether records can be deleted in this context
tablescanbeeditedBoolean indicating whether records can be edited in this context
tableselectionCondition applied to the selected table
tableviewselectionStructured condition of the current table view
timezoneTime zone of the current user
todayCurrent day (without time) as long
uidUID of the current record
uidcolumnName of the UID column in the record
userUsername of the current user
useridletimeIdle time of the current user
usertokenToken of the current user
validationerrorsString containing current validation errors
viewmodeView mode of the current component
workingmodeCurrent working mode
workingmodebeforesaveWorking mode before the last save action

$field Variables

$field variables correspond to $comp variables in the ADITO Legacy platform but are used exclusively within the Neon Entity environment. They represent the values of specific EntityField objects.

important

Via the system.vars module, an EntityField value can only be read vars.get(). vars.set() does not work in this case. To modify an EntityField, use the appropriate method provided by the system.neon module.

Examples:

// Reading an EntityField value
var id = vars.get("$field.UUID");

// Setting an EntityField value
neon.setFieldValue("$field.MYENTITYFIELD", myValue);

$context Variables

$context variables are available only during the lifetime of a context, such as a Neon data model opened in a MainView.
They are temporary and scoped to that specific context, allowing you to store and access values relevant to the currently opened entity or view.

Examples:


// Reading a context variable
var oldObjectType = vars.get("$context.originalObjectType");

// Setting a context variable
vars.set("$context.PushDataPrivacyNotification", "true");

$cluster Variables

$cluster variables are visible to all clients and are maintained by the server.
They are commonly used as shared caches or for storing global values that must remain consistent across the entire system, regardless of which client accesses them.

They are accessed using the same methods as $sys variables.

Example

// Getting a cluster variable
var supportEmail = vars.get("$cluster.supportMail");

// Setting a cluster variable
vars.set("$cluster.supportMail", "support@adito.de");