|
| 1 | +-- ############################################################################ |
| 2 | +-- FOLDER EXAMPLES |
| 3 | +-- ############################################################################ |
| 4 | +-- |
| 5 | +-- This file demonstrates the MDL syntax for managing project folders: |
| 6 | +-- creating documents in folders, moving documents between folders, |
| 7 | +-- and dropping empty folders. |
| 8 | +-- |
| 9 | +-- Folders are created implicitly when referenced in FOLDER clauses or |
| 10 | +-- MOVE statements. DROP FOLDER removes empty folders explicitly. |
| 11 | +-- |
| 12 | +-- Prerequisites: Assumes a module 'FolderTest' exists. |
| 13 | +-- |
| 14 | +-- ############################################################################ |
| 15 | + |
| 16 | +create module FolderTest; |
| 17 | + |
| 18 | +-- MARK: - Create Documents in Folders |
| 19 | + |
| 20 | +/** |
| 21 | + * Level 1.1: Create a microflow in a folder (auto-creates the folder) |
| 22 | + */ |
| 23 | +CREATE MICROFLOW FolderTest.ACT_Process() |
| 24 | +RETURNS Boolean |
| 25 | +FOLDER 'Processing' |
| 26 | +BEGIN |
| 27 | + RETURN true; |
| 28 | +END; |
| 29 | +/ |
| 30 | + |
| 31 | +/** |
| 32 | + * Level 1.2: Create another microflow in a nested folder |
| 33 | + */ |
| 34 | +CREATE MICROFLOW FolderTest.ACT_Archive() |
| 35 | +RETURNS Boolean |
| 36 | +FOLDER 'Processing/Archive' |
| 37 | +BEGIN |
| 38 | + RETURN true; |
| 39 | +END; |
| 40 | +/ |
| 41 | + |
| 42 | +-- MARK: - Move Documents Between Folders |
| 43 | + |
| 44 | +/** |
| 45 | + * Level 2.1: Move a microflow to a different folder (auto-creates target) |
| 46 | + */ |
| 47 | +MOVE MICROFLOW FolderTest.ACT_Process TO FOLDER 'Resources'; |
| 48 | +/ |
| 49 | + |
| 50 | +/** |
| 51 | + * Level 2.2: Move a microflow to module root (out of folder) |
| 52 | + */ |
| 53 | +MOVE MICROFLOW FolderTest.ACT_Archive TO FolderTest; |
| 54 | +/ |
| 55 | + |
| 56 | +-- MARK: - Drop Folders |
| 57 | + |
| 58 | +/** |
| 59 | + * Level 3.1: Drop an empty nested folder |
| 60 | + */ |
| 61 | +DROP FOLDER 'Processing/Archive' IN FolderTest; |
| 62 | +/ |
| 63 | + |
| 64 | +/** |
| 65 | + * Level 3.2: Drop the now-empty parent folder |
| 66 | + */ |
| 67 | +DROP FOLDER 'Processing' IN FolderTest; |
| 68 | +/ |
| 69 | + |
| 70 | +/** |
| 71 | + * Level 3.3: Move contents out, then drop folder |
| 72 | + */ |
| 73 | +MOVE MICROFLOW FolderTest.ACT_Process TO FolderTest; |
| 74 | +DROP FOLDER 'Resources' IN FolderTest; |
| 75 | +/ |
| 76 | + |
| 77 | +-- cleanup |
| 78 | +drop module FolderTest; |
0 commit comments