Data Model¶
Use the data model to define the XML structure that stores process data at runtime. Forms, scripts, rules, pools, and screens all read from or write to this structure.
Emakin uses XML to manage process data, which enables flexible schemas and advanced querying with XPath and XQuery.
Data Model Structure¶
The process's data structure is defined using an XSD schema, which can reference external XSD files. All XML processing adheres to this schema.
Each workflow instance is stored in a single XML file. Upon creation, a form element is automatically added, and workflow pools are appended as needed.
Data Model Design and Modification¶
The Emakin process designer provides a user-friendly interface for data model design. Underlyingly, the data model is defined in XSD. The form designer automatically creates corresponding data model fields; custom fields can be added via the data model designer.
Example Data Model (XSD)¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
This XSD generates XML data like this:
1 2 3 4 5 6 7 8 9 10 11 | |
Data Model Bindings¶
Workflow pools and screens bind to the data model's root element (e.g., " Data" in the example above). This root element is the context for form elements, scripting ($Xml variable), and other operations. XPath expressions handle binding to nested elements.
Form Element Bindings¶
A textbox bound to MyField:
1 | |
Binding to a nested element:
1 | |
Namespace Support¶
Emakin uses an empty namespace by default. To use namespaces, define them in the namespaces section with an empty prefix. This modifies XPath expressions (form bindings, script evaluations) to incorporate the namespace.