ID Generator Tool

The ID Generator Tool in Joget DX allows users to increment a stored value in an App Variable, commonly used to maintain a running number (e.g., application reference number) within a form.

Configure Id generator

To configure Id Generator, drag and drop the Tool element onto the canvas in Process Builder,  click on it, and select Mapping.

When adding Id Generator in the field Tools, you will see the following fields available for configuration:

  • Form: Select the target form.
  • Field ID: Specify the form field ID. Only alphanumeric characters and underscores are allowed. Mandatory field.
    If you use id, the form will save with the "id" primary key in the running sequence. Joget will not create the id in UUID format.
  • Record ID: Key label for the field. This field is mandatory.
  • App Variable Name: Name of the App Variable storing the running number.
    • Joget will create the App Variable automatically if it does not exist.
    • Only letters (a-z, A-Z), numbers (0-9), and underscores (_) are allowed.
    • Ensure each App Variable name is unique and performed in your application.
      If you use the ID Generator Field as id, meaning it is a primary key value, be careful not to override the app variable value when importing apps: do not click the Show Advanced Options > Override app variables checkbox in the Import App screen.
  • Format: Define the pattern of the generated value (e.g., REF-????? will yield REF-00001).

Workflow variables

Workflow Variables in Joget DX 8 store data within the workflow context, allowing for dynamic data handling and process automation. In the ID Generator Tool, the generated ID can be optionally saved into a Workflow Variable, enabling further use and manipulation of this ID throughout the workflow. This facilitates tracking, reference, and integration with other workflow components.

Field to configure: 

  • Workflow Variable: Optionally save the generated value into a corresponding workflow variable.
    Using a non-existent Workflow Variable name
    You will get the following warning with the name printed out (e.g., status) in the server Joget log if you attempt to map to a non-existent Workflow Variable:
    context attribute status does not exist in process context - adding new attributes to the process context is not allowed.

Advanced options

Proper configuration of this option ensures the robustness and scalability of applications that require frequent and high-volume ID generation.

Field to configure:

  • Distributed Unique ID: Generates a distributed sequential unique ID.
    It is advisable to use Distributed Unique ID when dealing with high ID generation loads to avoid performance bottlenecks.

Isolation level for MySQL database

Isolation defines how the MySQL server (InnoDB) separates each transaction from other concurrently running transactions and ensures that the transactions are processed reliably. If transactions are not isolated, one transaction could modify the data that another transaction is reading, creating data inconsistency. Isolation levels determine how isolated the transactions are from each other.

Configure MySQL Isolation Level

To set the isolation level to READ-COMMITTED, execute the following queries in MySQL:

SET GLOBAL tx_isolation='READ-COMMITTED';
SET SESSION tx_isolation='READ-COMMITTED';

Additionally, update your MySQL configuration file (my.cnf or my.ini) under [mysqld]:

[mysqld] transaction-isolation = READ-COMMITTED

This ensures that transactions are processed in a way that maintains data integrity and consistency, especially in multi-user environments.

Created by Julieth Last modified by Aadrian on Dec 13, 2024