XML Database¶
Emakin uses an XML NoSQL database for storing large XML datasets. This is particularly suitable given Emakin's heavy reliance on XML data. Data is stored as a single large XML document with nested elements. Access is provided via server-side scripts using Xml.Load and $XmlRepository.Query
methods, and on forms using the XML Database Query data source.
Emakin utilizes two types of XML databases: Domain and Process databases. The Process database is disabled by default and requires explicit administrator enablement.
Domain Database¶
The Domain database is shared across all processes within a domain. It's used for storing domain-wide data. All queries use XQuery. Emakin provides Save
and Load
functions for simpler operations. Save
overwrites existing nodes; Load
uses XQuery for retrieval.
Saving Data to the Domain Database¶
This example uses XmlNode.Save to store the Customer
node under the Customer/<Id>
path:
1 |
|
Loading Data from the Domain Database¶
This example uses XmlNode.Load to retrieve the Customer
node:
1 |
|
More complex XQuery queries are also supported (see XQuery documentation). For example:
1 2 3 4 5 6 7 |
|
Process Database¶
The Process database is automatically created for each process and stores workflow data for reporting and statistics. This data mirrors the relational database but in a more compact XML format, facilitating report generation.
Note
The Process database is disabled by default and requires administrator enablement.
Instance Data¶
Instance metadata (within <Instance>
tags) includes workflow details and a list of completed work items. A background job ("Instance Xml Database Replication") updates the database upon work item completion. Use the Background Jobs Manager to monitor this job.
Example Instance Data:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Form Data¶
Form data (within <form>
tags) is similarly stored and updated upon work item completion. A background job ("Form Data Xml Database Replication") manages this update.
Example Form Data:
1 2 3 4 5 |
|