You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`docker run` handles everything: downloads MxBuild and runtime (if not cached), initializes the Docker stack (if needed), builds the PAD package, starts the containers, and optionally waits for the runtime to report successful startup.
52
52
53
+
## Creating an Empty Mendix App
54
+
55
+
To create a new blank Mendix project for testing (requires mxbuild to be downloaded first):
The `mx create-project` command creates an MPR v2 project with the standard Mendix module structure. You can then use the Docker workflow to build and run it.
67
+
53
68
## Step-by-Step Workflow
54
69
55
70
If you prefer more control, use the individual commands:
MxBuild 11.6.3+ expects runtime files (`pad/`, `lib/`, `launcher/`, `agents/`) inside its own `runtime/` directory, but `mxcli setup mxbuild` only downloads the build tools (not the full runtime). If the PAD build fails with `StudioPro.conf.hbs does not exist` or `ClassNotFoundException`, copy the runtime directories into mxbuild:
**Important:** The PAD build output may only include partial runtime bundles (5 jars instead of 354). If the runtime fails to start with `ClassNotFoundException: com.mendix.container.support.EventProcessor`, copy the full runtime into the PAD build output:
This creates a `.docker/` directory with Docker Compose configuration for the Mendix app + PostgreSQL.
83
123
124
+
**Port conflicts:** If default ports (8080/8090/5432) are already in use, check with `ss -tlnp | grep -E '808|809|543'` and use `--port-offset N` to shift all ports:
125
+
126
+
```bash
127
+
# Check which ports are occupied
128
+
ss -tlnp | grep -E '808[0-9]|809[0-9]|543[0-9]'
129
+
130
+
# Use offset to avoid conflicts (e.g., offset 5 → 8085/8095/5437)
131
+
mxcli docker init -p app.mpr --port-offset 5
132
+
```
133
+
84
134
### 3. Check project for errors
85
135
86
136
```bash
@@ -346,6 +396,9 @@ All defaults can be overridden in `.docker/.env`.
346
396
| Build fails with version error | Requires Mendix >= 11.6.1 for PAD support |
347
397
| No Dockerfile in PAD output | Normal for MxBuild 11.6.3+ — `mxcli docker build` auto-generates one |
348
398
| Runtime not found / runtimelauncher.jar missing | Run `mxcli setup mxruntime -p app.mpr` or let `docker build` auto-download |
399
+
|`StudioPro.conf.hbs does not exist`| Runtime not linked into mxbuild — see "Runtime-to-MxBuild Copying" above |
400
+
|`ClassNotFoundException: EventProcessor`| PAD has partial runtime bundles — copy full runtime into `.docker/build/lib/runtime/` (see above) |
401
+
| Port already allocated | Check ports with `ss -tlnp \| grep 808` and use `docker init --port-offset N --force`|
349
402
|`' etc/Default' is not a file`| Dockerfile CMD passes config arg — `docker build` patches this automatically |
350
403
|`DatabasePassword has no value`| Ensure `RUNTIME_PARAMS_DATABASE*` env vars are in docker-compose.yml — re-run `mxcli docker init --force`|
351
404
|`Password should not be empty (debugger)`| Add `RUNTIME_DEBUGGER_PASSWORD` — re-run `mxcli docker init --force`|
Calculated attributes derive their value from a microflow at runtime. Use `CALCULATED BY Module.Microflow` to specify the calculation microflow.
332
+
333
+
**IMPORTANT: CALCULATED attributes are only supported on PERSISTENT entities.** Using CALCULATED on non-persistent entities will produce a validation error.
334
+
335
+
```sql
336
+
@Position(100, 100)
337
+
CREATE PERSISTENT ENTITY Module.OrderLine (
338
+
/** Unit price */
339
+
UnitPrice: DecimalNOT NULL,
340
+
/** Quantity ordered */
341
+
Quantity: IntegerNOT NULL,
342
+
/** Total price, calculated by microflow */
343
+
TotalPrice: Decimal CALCULATED BY Module.CalcTotalPrice
344
+
);
345
+
```
346
+
347
+
**Syntax variants:**
348
+
-`CALCULATED BY Module.Microflow` — recommended, binds the calculation microflow directly
349
+
-`CALCULATED Module.Microflow` — also valid (`BY` keyword is optional)
350
+
-`CALCULATED` — bare form, marks as calculated but requires manual microflow binding in Studio Pro
Copy file name to clipboardExpand all lines: .claude/skills/mendix/manage-security.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,13 +171,18 @@ ALTER PROJECT SECURITY DEMO USERS OFF;
171
171
### Demo Users
172
172
173
173
```sql
174
-
-- Create demo user with roles
174
+
-- Create demo user (auto-detects entity that generalizes System.User)
175
175
CREATE DEMO USER 'demo_admin' PASSWORD 'Admin123!' (Administrator, SuperAdmin);
176
176
177
+
-- Create demo user with explicit entity
178
+
CREATE DEMO USER 'demo_admin' PASSWORD 'Admin123!' ENTITY Administration.Account (Administrator, SuperAdmin);
179
+
177
180
-- Remove demo user
178
181
DROP DEMO USER 'demo_admin';
179
182
```
180
183
184
+
The ENTITY clause specifies which entity (generalizing `System.User`) to use. If omitted, it auto-detects the unique System.User subtype in the project. If multiple subtypes exist, you must specify ENTITY explicitly.
185
+
181
186
## Starlark Lint Rule APIs
182
187
183
188
Security data is available in Starlark lint rules (`.star` files):
Calculated attributes derive their value from a microflow at runtime. Use `CALCULATED BY Module.Microflow` to specify the calculation microflow.
332
+
333
+
**IMPORTANT: CALCULATED attributes are only supported on PERSISTENT entities.** Using CALCULATED on non-persistent entities will produce a validation error.
334
+
335
+
```sql
336
+
@Position(100, 100)
337
+
CREATE PERSISTENT ENTITY Module.OrderLine (
338
+
/** Unit price */
339
+
UnitPrice: DecimalNOT NULL,
340
+
/** Quantity ordered */
341
+
Quantity: IntegerNOT NULL,
342
+
/** Total price, calculated by microflow */
343
+
TotalPrice: Decimal CALCULATED BY Module.CalcTotalPrice
344
+
);
345
+
```
346
+
347
+
**Syntax variants:**
348
+
-`CALCULATED BY Module.Microflow` — recommended, binds the calculation microflow directly
349
+
-`CALCULATED Module.Microflow` — also valid (`BY` keyword is optional)
350
+
-`CALCULATED` — bare form, marks as calculated but requires manual microflow binding in Studio Pro
@@ -417,6 +451,8 @@ Both double-quote (ANSI SQL) and backtick (MySQL) styles are supported. You can
417
451
418
452
**Boolean attributes** auto-default to `false` when no `DEFAULT` is specified.
419
453
454
+
**CALCULATED** marks an attribute as calculated (not stored). Use `CALCULATED BY Module.Microflow` to specify the calculation microflow. Calculated attributes derive their value from a microflow at runtime.
455
+
420
456
**ButtonStyle** supports all values: `Primary`, `Default`, `Success`, `Danger`, `Warning`, `Info`.
@@ -1084,12 +1084,15 @@ Creates a demo user for development/testing.
1084
1084
1085
1085
**Syntax:**
1086
1086
```sql
1087
-
CREATE DEMO USER '<username>' PASSWORD '<password>' (<userrole> [, ...])
1087
+
CREATE DEMO USER '<username>' PASSWORD '<password>'[ENTITY <Module.Entity>] (<userrole> [, ...])
1088
1088
```
1089
1089
1090
+
The optional `ENTITY` clause specifies the entity that generalizes `System.User` (e.g., `Administration.Account`). If omitted, the system auto-detects the unique `System.User` subtype.
1091
+
1090
1092
**Example:**
1091
1093
```sql
1092
1094
CREATE DEMO USER 'demo_admin' PASSWORD 'Admin123!' (AppAdmin);
1095
+
CREATE DEMO USER 'demo_admin' PASSWORD 'Admin123!' ENTITY Administration.Account (AppAdmin);
0 commit comments