Skip to main content

The model

An application is described by one YAML document. Every tool reads the same document: both generators, the eml command line, the modelling tool and the in-browser bundle.

Two forms, one meaning​

FormFileUse it when
CEDM model*.cedm.yaml, opens with cedm:You want to import entities from the CEDM library and add your own.
Model document*.eml.yaml, opens with eml:You want to write every entity yourself.

A CEDM model is lowered into a model document before it is compiled, so both forms generate the same application. appwithai convert turns one into the other.

cedm: "1.0"
application:
name: Sales and Order Management
domain: sales
imports:
- module: common # the shared foundation: parties, places, currencies…
- entity: Customer
- entity: SalesOrder
ui:
categories:
- name: Sales
icon: badge-dollar-sign
entities: [Customer, SalesOrder]

What a model can declare​

Section (model document)Declares
entitiesRecords, their attributes, help text, form sections, icons and parent entities
enumsValue lists, with labels and descriptions for each value
relationshipsHow entities relate; the key goes on the right side automatically
categoriesHow entities are grouped on the dashboard
stateMachinesWhich moves a record may make between states
rulesBusiness rules on lifecycle events, compiled to GoRules decision graphs
sagasMulti-step processes, compiled to BPMN
automationsA trigger, conditions that must all hold, and ordered steps
rbacRestrictions on operations and moves, by role
hooksPoints where your own Rust code runs around reads and writes
reports and dashboardsRead-only queries shipped with the application
triggersExternal events and schedules that call a handler

A CEDM model expresses the same things in the library's terms: imports, entities, enums, ui, authorization, rules, processes, automations, hooks, triggers, reports and dashboards.

Checked before anything is generated​

Reading a model runs three layers, in order:

  1. YAML. Version 1.2, and a duplicate key is an error, not a silent overwrite.
  2. The schema. What a document may contain, with types and allowed values.
  3. The checker. Cross-references the schema cannot express: an edge between two states that exist, a rule that reads only real columns, a report that is a single read.

Every finding names its document path, line and column. Many have an automatic repair that keeps the author's comments.

Help is part of the model​

The help written on an entity, attribute, value or relationship becomes the application's built-in help: on its window, its tab and every field. Write it for the person using the screen.