JDito
What is JDito?
JDito is the programming language used for customizing ADITO. Everything that requires more than the basic functionality offered by components is done in so-called processes, which are basically scripts written in JDito.
At its core, JDito is based on the programming language JavaScript, but it doesn't have the DOM controlling methods like the normal JavaScript used in web development; instead, JDito extends the core of JavaScript with its own system modules that provide a big array of methods to interface with and control the environment within ADITO - e.g., executing SQL queries, interfacing with telephone systems as well as reading and returning values from/to components.
System-reserved names must not be used as names of variables. For example, a variable must not be named "result", "tools", or "test". Besides, we recommend not to use variables names matching names of system components, such as ADITO models or their properties ("Activity", "title", "contentType", "state", etc.). This could have unexpected side-effects. You may uses the usual prefixes, such as "my" or "a", in order to avoid these kind of problems ("myTitle", "aState", etc.).
Here is an example of how a variable irregularly named "test" is marked in the ADITO Designer's code editor:

How to use JDito
The lexical structure of JDito is identical to JavaScript. Basic information on JavaScript can be found online, e.g., here: https://www.w3schools.com/js/
JDito is used in so-called processes. There are basically two kinds of processes in ADITO:
-
Component specific processes These are JDito scripts used for a specific purpose in a component, e.g., processes to calculate display values, font colors, data validation, etc. These processes are specified directly in the corresponding properties and are executed whenever the system needs the value of the properties.
-
Project-wide processes These processes are located in the "process" node of the project tree of the ADITO Designer. You find them sorted into four sub-nodes (the sorting is done according to the processes' property "variants", i.e., the sub-nodes ("folders") are virtual):
-
authentication:
All processes responsible for authentication - see chapter Authentication Methods (AID032) -
executable
Executable processes are used to automate specific tasks and can be used manually or for regular timed tasks, e.g., nightly imports of data or mass data manipulation. -
internal
These are processes called by the ADITO application's core and used to define custom behaviour for specific tasks. For example, the process "autostartNeon" is called every time a user logs on to the web client. Within this process, several client-wide variables are set, like access rights. -
library
Processes of this kind are used to group collections of JDito function that share a common topic, like handling calendar access, writing letters, or SQL helper functions. These libraries can be imported into other processes, so you can access the functions there. There are 2 types of libraries:- Entity-specific libraries, including helper functions restricted to (or mainly used by) single Entitys, e.g.,
Organisation_lib. - multi-purpose libraries, providing functionality that is used by more than one Entity. Examples:
Neon_lib,Date_lib,Money_lib.
- Entity-specific libraries, including helper functions restricted to (or mainly used by) single Entitys, e.g.,
-
webservice
These processes are designed to be used as web services. Other systems can call these to get data from ADITO, write data to ADITO, or to trigger actions within ADITO. Find more information in the ADITO document Webservices (AID059). -
workflow
All processes related to workflows - see the ADITO chapters about Workflow Management (AID110) / Workflow Management Technical (AID110).
-
In principle, these system-wide processes can also be customized according to the project's requirements. However, this can lead to update/merge problems whenever ADITO releases a new xRM version. Therefore, we recommend you to create new processes for any customized functionality, e.g., KeywordRegistry_custom or MyNewContext_lib.
Further information
Further information on JDito functionality is available as JSDoc, accessible via the programming help function while coding. For example, if you have imported the library "Person_lib" (import { PersUtils } from "Person_lib";), you can view a list of all functions provided by class "PersUtils" simply by typing PersUtils. and then CTRL+SPACE. (If you do this for the first time, you need to wait a few minutes, until the ADITO Designer has completed the task "Initializing JS features", see notification in the bottom line of the Designer). Through this function list, you can navigate with the arrow keys: Whenever a function is marked, you can read its JSDoc below, structured in Summary (basic description of the function), Parameters (description of the function's parameters), and Returns (information about the function's return value).

Example of the JSDoc of method getResolvingDisplaySubSql of class PersUtils
A glossary giving information about JDito system modules and JDito system variables is available in chapter JDito System Modules and System Variables.
Information about how to use XML in JDito is available in chapter XML in JDito.