Skip to main content

System Variables

System Variables in the Entity Model

System variables contain values provided by the ADITO core or assigned within JDito code. They always use the $ prefix and are accessed through system.vars via vars.get() and vars.set().

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

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

important

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

It is therefore not possible to set a variable in one context, for example an Organisation opened in one browser tab, and access it from another context in a different tab.

As a consequence, global variables are only of limited use as caching mechanisms, because invalidation is difficult to control. In practice, invalidation usually happens either

  • after a user re-login, for example in autostartNeon, or
  • through a dedicated ServiceImplementation configured for the process.

There are several categories of system variables, not only $sys variables. The following sections describe the most important ones.


$local Variables

$local variables exist for the duration of a user's session. On the server side, their persistence depends on the configuration of the corresponding server process, which must always run under a specific user.

For example, autostartNeon initializes several $local variables that are later required by the client. $local 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 process_audit, which reacts to dataset audit events. Information about affected database columns, their types, and their old and new values is passed in $local variables and can then be accessed through system.vars:

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

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

For server-side execution, this means that you can decide during server process configuration whether the JDito instance should be retained:

  • If yes, the global variable persists across multiple executions on the same server pod, for example adito-web-bg-0.
  • If no, then the global variable is reinitialized for each new execution and must be set again.

Overview of $local Variables

Maintaining complete documentation for all $local variables across every possible context would be difficult and would quickly become outdated. The following overview therefore focuses on the variables that are most commonly relevant in project work.

tip

Use the Designer debugger instead to inspect the $local variables that are available in the current process context. When the debugger is active, the Debugger window shows all relevant variables for the breakpoint location.

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 list below does not include $local variables that are already explained in other chapters, for example:

tip

When using full-text search in this document, keep in mind that line breaks may split variable names. As a result, variables such as $local.initialRowdata may only be found when searching for initialRowdata.

warning

This list is not complete. It contains only common examples. Many $local variables can have different meanings depending on the process.

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.


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. All $sys variables are read-only.

Name ($sys....)Description of Return Value
clientcountryCountry of the client
clientidID of the client
clientlanguageLanguage of the client
clientlocaleLocalisation of the client (e.g., de_DE)
clienttempTemp directory of the client
clientuidUID of the client
clientvariantLanguage variant of the client
currentcontextnameName of the current context
currententitynameName of the current entity
currentimageID of the current image variable
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 (index search)
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
hasSelectionBoolean indicating whether a selection is used
isclientBoolean indicating whether the execution context is the client
isserverBoolean indicating whether the execution context is the server
licenseidID of the license
operatingstateCurrent operating state of the entity/view
orderCurrent record sort order
originOrigin of the URL
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 (index search)
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 execution (server for server / vaadin for client)
selectionCurrent selection (for entity or index)
selectionGroupsCurrent selection groups
selectionGroupRowsCurrent selection group rows
selectionRowsAll rows in the current selection
selectionsRecordsRecipeRecordsRecipe describing the current selection
serverdataDATA directory of the server
serverhomeHOME directory of the server
serveridID of the current system
serverosOperating system of the server
servertempTEMP directory of the server
serverversionServer version
staticdateCurrent date (static) as long
staticmillisCurrent timestamp in milliseconds
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
usertokenToken of the current user
validationerrorsString containing current validation errors
viewmodeView mode of the current component

$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");