When you install a package, Dawiso transforms its JSON configuration into live metadata entities. Understanding this pipeline helps diagnose installation failures and structure packages that validate on the first attempt.
Version states
Every package version passes through four states in strict sequence:
| State | Trigger | What happens |
|---|---|---|
| CREATED | Upload or save | Raw JSON stored. No validation yet. |
| VALIDATED | Validate action | Schema checks, reference resolution, dependency verification. Errors block progression. |
| VERSIONED | Create version | Immutable snapshot created. Version number assigned. |
| INSTALLED | Install action | Loaders execute sequentially. Assets become live metadata entities in the database. |
A package cannot skip states. Each state transition runs its own checks before allowing progression to the next.
CREATED
The entry state. Dawiso stores the raw package JSON without interpreting it. The package appears in the management UI but has no effect on the running system. Editing the JSON is allowed in this state.
VALIDATED
The validation engine performs three categories of checks:
- Schema validation: Verifies the JSON structure matches the expected format for each asset type. Missing required fields, incorrect data types, and malformed references produce errors.
- Reference resolution: Resolves all cross-package references (
{packageKey}#{assetKey}) against installed packages. Unresolvable references produce errors. - Dependency verification: Confirms all entries in
dependsOnpoint to packages in INSTALLED state. Missing or non-installed dependencies produce errors.
Validation errors must be resolved before the package can progress. Warnings do not block progression but indicate potential issues.
VERSIONED
Creates an immutable snapshot of the validated JSON. The version number follows semantic versioning. Once versioned, the JSON cannot be edited; any changes require a new version.
INSTALLED
The installation engine executes loaders against the versioned snapshot. Each loader reads its asset type from the JSON and writes the corresponding database entities. This state transition is the only one that modifies the live metadata model.
The loader system
Installation executes 240+ sequential loaders, each responsible for one asset type. Loaders run in a fixed order defined by the system, not by the order assets appear in the package JSON.
Each loader performs three operations:
- Read the asset definition from the package JSON.
- Map the asset key to a database entity (create or update).
- Register the key → database ID mapping for downstream loaders.
This sequential design means later loaders can reference entities created by earlier loaders. It also means loader order violations cause predictable failures.
Loader execution flow
For each asset in its scope, a loader follows this sequence:
- Lookup: Check if an entity with this key already exists in the database (from a previous installation or a base package).
- Create or update: If the entity exists, update its properties. If not, create a new entity and assign a database ID.
- Register mapping: Store the
{packageKey}#{assetKey}→ database ID pair in the installation registry. - Cache update: Call
UpdateCacheDatato propagate the change to the in-memory cache.
If any step fails, the loader logs the error and, depending on severity, either skips the asset or aborts the entire installation.
Loader groups
Loaders are organized into five groups that execute in the order listed below.
Codetable loaders
Codetable loaders create foundational visual and UI assets: icons, colors, components, pages, and templates. These assets have no dependencies on structural metadata, so they load safely at the start of the sequence.
Codetable assets include:
- Icons: SVG definitions referenced by object types and UI components.
- Colors: Named color values for status indicators, badges, and chart elements.
- Components: Reusable UI building blocks (e.g.,
core#ownership_generic). - Pages: Full-page layout definitions for navigation targets.
- Templates:
mainandobjectDetailtemplates that define entity detail views.
Structural loaders
Structural loaders create the core metadata model: objectTypes, attributeTypes, relationTypes, workflows, workflowStates, and domainTypes. Each structural asset receives a database ID that downstream loaders reference.
They process assets in dependency order within the group. Object types load before attribute types because attributes reference their parent object type. Similarly, workflows load before workflow states.
Relationship loaders
Relationship loaders wire structural assets together: objectType-attribute mappings, objectType-relation mappings, feature attachments, and conditions. These loaders depend on structural assets existing in the database, which is why they run after structural loaders.
Key relationship assets:
- Object type-attribute mappings: Attach attribute types to object types, defining which fields appear on each entity.
- Object type-relation mappings: Define which relation types connect which object types.
- Feature attachments: Enable optional features (versioning, comments, lineage) on specific object types.
- Conditions: Define visibility and validation rules for attributes based on field values.
Integration loaders
Integration loaders configure external connectivity: external data sources, API mappings, and query sets. These loaders reference both structural assets (for schema alignment) and codetable assets (for UI presentation).
These assets connect Dawiso to external systems: data warehouses, BI tools, API endpoints. Each integration asset maps external schema elements to internal object types and attribute types.
Translation loaders
Translation loaders apply language-specific labels to every translatable asset created by previous loaders. Translation loaders run last because they reference assets from all other groups.
A translation entry for a nonexistent asset key fails silently: the label is stored but never displayed. This behavior is by design: it allows translation packages to ship labels for assets that may or may not be installed.
Translatable assets include object type names, attribute labels, workflow state names, domain type titles, page titles, and template section headers.
Asset key mapping
Every asset in a package has a string key (e.g., business_term, core#description). During installation, each key gets mapped to a numeric database ID. Dawiso maintains this mapping in a registry that serves three purposes:
- Dependency tracking: The system knows which database entities belong to which package version.
- Cleanup on deletion: Uninstalling a package removes all entities mapped to its keys.
- Duplicate detection: Installing a package that declares a key already owned by another package raises a conflict error.
Cross-package references use the {packageKey}#{assetKey} syntax. The loader resolves the package key first, then looks up the asset key within that package’s mapping.
Key uniqueness rules
Asset keys must be unique within their asset type and package scope. Two different packages can define an attribute type with the same local key (e.g., description), but cross-package references disambiguate them (core#description vs. cust_erp#description).
Within a single package, duplicate keys within the same asset type cause a validation error. Duplicate keys across different asset types are allowed; an object type key document and an attribute type key document can coexist.
Post-installation steps
Installation writes entities to the database, but three subsystems require separate updates before changes are fully visible.
Elasticsearch reindex
The installer refreshes the search indexes that the installation itself changes. It queues one forced index refresh (ES_REFRESH_INDEX) for every index the package adds, every index whose index name or settings row changes, and every active or hidden index whose shared settings row changes content, so those indexes pick up the new mapping without a manual reindex. A change to an object type’s search block alone (for example isSearchable, indexKey or boost) does not refresh anything: refresh the affected indexes in the search administration section.
The refresh deletes and recreates the index. Before that, it cancels the indexing tasks it makes redundant (tasks for that index, bulk indexing tasks such as index-all or space-level indexing, queued duplicate refreshes) and queues replacements after the refresh. Small targeted tasks for single objects or models are left alone. The refresh waits up to 5 minutes for running writers of the same index and fails the task if they do not stop.
The reindex operation processes all entities of the specified type. For large deployments, schedule reindex during low-traffic periods to avoid performance degradation.
In-memory cache refresh
Each loader calls UpdateCacheData after writing its entities. This handles most cache invalidation. Edge cases, particularly around template changes and workflow state transitions, may require a manual application restart.
Cache entries have no automatic TTL. Until explicitly refreshed, stale entries persist indefinitely. The UpdateCacheData mechanism targets specific cache keys, but complex template changes sometimes affect cache keys that the loader does not anticipate.
User space permissions recalculation
New object types and domain types may not appear in user catalogs until the permissions engine recalculates access. This recalculation runs on a schedule, not on-demand after installation. Administrators can trigger manual recalculation from the permissions administration section.
Permissions recalculation evaluates each user’s role assignments against the updated metadata model. New object types inherit default visibility rules, but custom permission configurations require explicit setup.
Concurrent package operations
Installs, rollbacks, and package deletions run one at a time per instance. A task that starts while another package operation is running waits. If the wait lasts longer than about two seconds, the task logs Waiting for another package operation to finish in its task log. A short wait for an operation that is just finishing logs nothing. The wait has no time limit. Waiting tasks run in the order they arrived, and each continues automatically when the running operation finishes. Cancelling a waiting task ends its wait, including a package deletion that is waiting for its turn.
While a package operation runs, the rest of the application is not blocked by it. This includes the metadata hash call that the application makes on first boot. Master-data and template hash updates are deferred to the end of the operation’s transaction.
A transient database failure during the operation, such as a deadlock or a database command timeout, is retried automatically from a clean state. If the task itself is restarted after such a failure, for an install or a reinstall, the errors of the earlier attempt appear as warnings with the note “This install attempt failed on a transient database error (deadlock or command timeout); its errors are logged as warnings because the task restarts the install while restarts remain”.
For related errors, see Troubleshooting Package Issues.
Troubleshooting common failures
Validation fails with “Reference not found”
The most common validation error. Occurs when an asset references another asset that either does not exist or belongs to a package not listed in dependsOn. To diagnose:
- Identify the failing reference from the validation error message (e.g.,
core_glossary#business_term). - Verify the referenced package (
core_glossary) is listed independsOn. - Verify the referenced package is in INSTALLED state.
- Verify the asset key (
business_term) exists in the referenced package.
Installation hangs or times out
Large packages with hundreds of assets may exceed default timeout thresholds. Each loader writes to the database and updates the cache sequentially. Packages with 500+ assets can take several minutes to install.
If installation times out, check the server logs for the last successfully processed loader. The installation can be retried; loaders use upsert logic, so re-running does not create duplicate entities.
Partial installation
The main install runs in one database transaction, so a failure during installation rolls that transaction back. If the process crashes mid-installation, loaders that already completed may have left changes behind, for example work done outside the transaction. The package remains in VERSIONED state (it does not transition to INSTALLED). Retrying the installation re-runs all loaders from the beginning. Completed loaders update existing entities rather than creating duplicates.
Gotchas
Loader order violations. If asset A references asset B, and B’s loader hasn’t run yet, validation reports “reference not found.” This happens when a structural asset references a codetable asset that loads later in the sequence. Check the loader order: the referenced asset’s loader must precede the referencing asset’s loader.
Translation namespace timing. The translations loader must run after all translatable assets exist. If you add a translation for an asset key that doesn’t exist yet (because its loader hasn’t run), the translation stores successfully but attaches to nothing. No error is raised.
Cache staleness after installation. Template and workflow changes may not reflect in the UI immediately after installation. If metadata appears outdated, verify that UpdateCacheData completed for the relevant loader. When in doubt, restart the application to force a full cache rebuild.
Elasticsearch refresh after a search block change. Installation refreshes only the search indexes it adds or changes. When a package changes only an object type’s search block, refresh the affected indexes by hand; until then, search for those object types returns stale results or none.
Post-installation checklist
- Verify the package version state is INSTALLED in the package management UI.
- Check the installation log for warnings or skipped assets.
- Refresh the affected search indexes if the package changed an object type’s
searchblock. - Confirm new object types appear in the catalog (if they don’t, trigger permissions recalculation).
- Open one instance of each new object type and verify the template renders correctly.
- Test search against new entity types to confirm index availability.
- Verify translations by switching the UI language and checking labels on new assets.
- If workflow states were added or modified, create a test entity and walk through each state transition.
- Review the key-to-ID mapping in the package registry for unexpected conflicts or missing entries.
- Confirm that relation types display correctly on both source and target object type pages.