Data Model in Simplified Mode
In DWKit, Data Model does not necessarily correspond to a particular database table. The simplified mode can be applied to create the data model. In this mode, no database tables are created; instead, all the data model records are stored in one universal table, dwEntities. This table has a number of predefined attributes saved in different columns. User-defined attributes are extension attributes, that is, they all are saved in a common column as JSON.
The reasons to use the data model in the simplified mode are:
- rapid prototyping, no time is spent on creating the database scripts and paying attention to the database in general;
- storage of relatively small dictionaries and data with a simple structure.
The data model created in the simplified mode always has the following attributes:
- Id - GUID primary key.
- ParentId - GUID - to build hierarchical data models; should be used as a reference to the same data model.
- ReferenceId - GUID - to build references; should be used as a reference to another data model.
- CreatedBy - user reference. User identifier, who has created the entry, automatically saved here.
- ChangedBy - user reference. User identifier, who has changed the entry, automatically saved here.
- Created - time of entry creation, saved automatically.
- Changed - time of entry change, saved automatically.
- Name - entry name (document name)
- SchemeName - DWKit is used, but only if several workflow schemes are specified for the form.
- State - filled in automatically, if Workflow Plugin enabled. This is the system name of the workflow process state.
- StateName - filled in automatically, if Workflow Plugin enabled. This is the localized name (by default localization) of the workflow process state.
- DataModelName - the data model name, filled in automatically.
- Extensions - this column stores all user-defined attributes.
The interface for the data model creation in the simplified mode is the following:
- The data model type, simplified should be chosen.
- The data model name.
- User-defined attributes of the data model. All of them are extension attributes that can be either columns or references. Using and creating of these attributes is no different from regular extension attributes.
- The list of system attributes, not editable.
When binding to a form, the usage of the simplified data model is no different from the standard data model.