Managing projection databases (Registry)
Eximee Registry API in ScriptCode
API api.registry.v1 is used to save, update, and read data in the projection cache database.
Thanks to full integration with the platform engine, you can use the Registry API directly in JavaScript code:
In the context of the user interface (form): In validation scripts, page services (PageService), and entry/exit scripts (EntryService, ExitService).
In the context of process automation: In script tasks ScriptCode Tasks and event consumers from Kafka/MQ.
The values to be saved can be computed in form services (EntryService, PageService...) or retrieved directly from the application's data model (api.model.v1.get()). Search results can be dynamically presented to the user on the screen or used in algorithms, e.g. to verify visibility conditions.
API
The table below contains a description of the interface methods and parameters api.registry.v1
save
namespace: String, id: String, data: String
void
Saves or updates (upserts) text data under the specified identifier in the selected namespace.
saveVersion
namespace: String, id: String, data: String, version: String
void
Saves data with explicit specification of its schema version.
get
namespace: String, id: String
String
Retrieves and returns the stored string for the given namespace and identifier.
getVersion
namespace: String, id: String
TempStoreVersionItem
Retrieves an object containing both the data model and the schema version.
delete
namespace: String, id: String
void
Permanently deletes the entry with the specified identifier from the selected namespace.
Handling JSON format (data)
Since the save methods accept and return data as a string (String), JavaScript scripts should use object serialization and deserialization:
When saving (save / saveVersion): The passed JavaScript object should be converted to text using JSON.stringify(object).
When reading (get): The retrieved text should be parsed into an object using JSON.parse(string).
TempStoreVersionItem
The object returned by the getVersion method has properties (getters) available directly in JavaScript:
data (String) – Raw string with the stored data model.
version (String) – Assigned schema version.
The meaning of the namespace (namespace)
The namespace parameter is not a rigid dictionary imposed by the Eximee platform. It gives the low-coder full freedom to define logical domains for storage and search (so-called context-bounded domains).
You can treat it as an autonomous address space – any string defined by you that logically groups related entries. This gives us:
Data separation: The same low-code application can save different aspects of the same case to separate domains (e.g. "MortgageLoan_Application", "MortgageLoan_Collateral", "MortgageLoan_Scoring"), which makes permission management and data readability easier.
No collisions: Different applications can use exactly the same identifiers (e.g. the same PESEL number), because their data is isolated within their own namespaces.
Flexible search: When searching for information using the get method, you query only the selected, precisely defined domain, which guarantees lightning-fast response times from the projection database.
Business key selection strategy
Before saving data, you must determine the primary key (id), which will uniquely identify the record in the projection database. The registry does not impose a rigid format – the key can be any unique string.
Common scenarios are:
PESEL or CIF of the client: When you want to aggregate and verify requests associated with a given person (e.g. blocking multiple applications).
Company NIP or REGON: When you want to link cases concerning a given company.
Bank account number: When there is a need to link different processes modifying account parameters
Shopping cart / transaction identifier (basketId): When the case concerns a group of products processed together.
Composite key: A dynamic combination of several parameters (e.g. PESEL_PRODUCTCODE) created in a script.
Example: Limiting the number of simultaneous credit processes to 1
We want to control the number of a client's credit applications and limit it to one. If the client tries to start a second application, they will receive a message requiring them to finish the previous application or be automatically redirected to the application started earlier.
Recording the fact of applying for a loan (Initialization)
Script most often attached to the action of moving to the next page or clicking the "Send" button:
Verification and blocking of multiple applications.
Script run on form entry (EntryService), checking whether the client already has an active application in progress:
Removing information about the active process
Script run at the completion of application processing, e.g. as a ServiceTask
Last updated
Was this helpful?
