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
feat: ALTER WORKFLOW command with full activity manipulation
Add ALTER WORKFLOW support to modify existing workflows via MDL:
- SET properties (Name, Description, AdminPage, ContextEntity)
- INSERT/DROP/REPLACE activities (UserTask, Decision, ParallelSplit, etc.)
- INSERT/DROP outcomes and paths on activities
- SET conditions on decision outcomes
- INSERT/DROP boundary events on user tasks
- @n positional disambiguation for duplicate activity names
- Version-gated to Mendix 9.12+
Includes grammar rules, AST nodes, visitor, executor with 22 unit
tests, 17 visitor tests, and a 324-line doctype test example.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| Set activity page |`SET ACTIVITY name PAGE Module.Page`| Change user task page |
280
+
| Set activity description |`SET ACTIVITY name DESCRIPTION 'text'`| Activity description |
281
+
| Set activity targeting |`SET ACTIVITY name TARGETING MICROFLOW Module.MF`| Target user assignment |
282
+
| Set activity XPath |`SET ACTIVITY name TARGETING XPATH '[expr]'`| XPath targeting |
283
+
| Set activity due date |`SET ACTIVITY name DUE DATE 'expr'`| Activity-level due date |
284
+
| Insert activity |`INSERT AFTER name CALL MICROFLOW Module.MF`| Insert after named activity |
285
+
| Drop activity |`DROP ACTIVITY name`| Remove activity by name |
286
+
| Replace activity |`REPLACE ACTIVITY name WITH activity`| Replace activity in-place |
287
+
| Insert outcome |`INSERT OUTCOME 'name' ON activity { body }`| Add outcome to user task/decision |
288
+
| Drop outcome |`DROP OUTCOME 'name' ON activity`| Remove outcome |
289
+
| Insert path |`INSERT PATH ON activity { body }`| Add path to parallel split |
290
+
| Drop path |`DROP PATH 'name' ON activity`| Remove parallel split path |
291
+
| Insert condition |`INSERT CONDITION 'name' ON activity { body }`| Add decision branch |
292
+
| Drop condition |`DROP CONDITION 'name' ON activity`| Remove decision branch |
293
+
| Insert boundary event |`INSERT BOUNDARY EVENT ON activity INTERRUPTING TIMER ['expr'] { body }`| Add boundary timer |
294
+
| Drop boundary event |`DROP BOUNDARY EVENT ON activity`| Remove boundary event |
295
+
296
+
**Activity references** can be identifiers (`ReviewOrder`) or string literals (`'Review the order'`). Use `@N` suffix for positional disambiguation when multiple activities share a name (e.g., `ACT_Process@2`).
297
+
298
+
**Multiple actions** can be combined in a single ALTER statement.
299
+
300
+
**Example:**
301
+
```sql
302
+
-- Set workflow-level properties
303
+
ALTER WORKFLOW Module.OrderApproval
304
+
SET DISPLAY 'Updated Order Approval'
305
+
SET DESCRIPTION 'Updated description';
306
+
307
+
-- Modify an activity
308
+
ALTER WORKFLOW Module.OrderApproval
309
+
SET ACTIVITY ReviewOrder PAGE Module.AlternatePage;
310
+
311
+
-- Insert and drop activities
312
+
ALTER WORKFLOW Module.OrderApproval
313
+
INSERT AFTER ReviewOrder CALL MICROFLOW Module.ACT_Escalate;
314
+
ALTER WORKFLOW Module.OrderApproval
315
+
DROP ACTIVITY ACT_Notify@1;
316
+
317
+
-- Manage outcomes on a user task
318
+
ALTER WORKFLOW Module.OrderApproval
319
+
INSERT OUTCOME 'Escalate'ON ReviewOrder {
320
+
CALL MICROFLOW Module.ACT_Review;
321
+
};
322
+
ALTER WORKFLOW Module.OrderApproval
323
+
DROP OUTCOME 'Hold'ON ReviewOrder;
324
+
325
+
-- Boundary events
326
+
ALTER WORKFLOW Module.OrderApproval
327
+
INSERT BOUNDARY EVENT ON ReviewOrder INTERRUPTING TIMER 'addHours([%CurrentDateTime%], 2)' {
328
+
CALL MICROFLOW Module.ACT_BoundaryHandler;
329
+
JUMP TO ReviewOrder;
330
+
};
331
+
ALTER WORKFLOW Module.OrderApproval
332
+
DROP BOUNDARY EVENT ON ReviewOrder;
333
+
```
334
+
335
+
**Tip:** Run `DESCRIBE WORKFLOW Module.Name` first to see activity names.
0 commit comments