Skip to main content

Code Generation

ITB generates code and configuration artifacts from your data model using the template engine.

This page is the how: pressing the button, reading the phases, downloading the result. Why a particular file appeared — which rule matched it and what that rule read — is How generation works.

Generate All​

  1. Click the Generate All Artifacts button (play icon) on the right side of the header toolbar, to the left of Model Actions.
info

The button is only visible when the template generation endpoint is configured and reachable: the client asks for api/v1/template/generate-all when it starts and hides the button if that endpoint is not there.

  1. A modal dialog opens and walks through several phases:
PhaseStatusDescription
PreparingGreenChecking whether the model has unsaved changes
SavingBlueAuto-saving the model if changes are pending
GeneratingBlueCalling the backend generation endpoint
SuccessGreen ✓Generation completed
ErrorRed ✗Generation failed (error message displayed)
  1. Click Close when generation is complete.

Code generation dialog

During generation, the model lock is acquired to prevent concurrent edits. The lock is automatically released when generation completes — whether it succeeds or fails.

Downloading Artifacts​

After a successful generation, use Download Artifacts in the header's Model Actions menu to export the generated output as an .artifacts.itb.zip file. This archive contains all files produced by the template engine.

Code generation in header

Prerequisites​

For code generation to work:

  • The ITB API must have template generation configured (the /api/v1/template/generate-all endpoint must be available).
  • Your model should be complete — all entities, attributes, and relations that the templates reference must be defined.
  • The model must be saved before generation (ITB auto-saves if needed).
  • At least one template pack must be installed. What gets generated comes from a pack, not from the application — see Template Packs for installing one and Pack Configuration for how a pack decides what your model produces.