uc-apx create branch
Splice an anonymous branch construct into the page. The branch jumps
to —target-page after submit, optionally setting items via —item-pair,
clearing caches with —clear-cache, and gating execution on a button
press or server-side condition.
Branches are anonymous in MMD — uniqueness is by execution.sequence. Pass —sequence explicitly if you need a specific ordering; otherwise it auto-increments from the max existing branch sequence + 10.
uc-apx create branch [flags]| Flag | Type | Default | Description |
|---|---|---|---|
--action | string | behavior.target.action (e.g. resetPagination) | |
--authz | string | security.authorizationScheme (id of an authorization scheme) | |
--clear-cache | stringArray | Page id (or substitution like &APP_PAGE_ID.) to clear; repeat for multiple | |
--dry-run | Print rendered branch to stdout without writing | ||
--item-pair | stringArray | Set ITEM=VALUE on the target page; repeat for multiple | |
--name | string | Branch display name (optional) | |
--no-success-message | Emit successMessage: false on the target block (suppresses the default success message) | ||
--page | string | Source page (numeric ID, alias, or name) [required] | |
--save-state | Emit saveStateBeforeBranching: true on the behavior block | ||
--sequence | int | execution.sequence (default: max existing branch sequence + 10) | |
--server-side-condition | string | Free-form serverSideCondition body (e.g. “type=expression value=…”); mutually exclusive with —when-button-pressed | |
--target-page | int | Destination page id [required] | |
--when-button-pressed | string | Branch only when this button was pressed (shortcut for serverSideCondition.whenButtonPressed) |
Global Flags
Section titled “Global Flags”| Flag | Type | Default | Description |
|---|---|---|---|
--app-dir | string | . | Path to the APEX application directory |
--json-pretty | Output in pretty-printed JSON (human-readable) instead of minified JSON | ||
--toon | Output in TOON format (human-readable, token-efficient) instead of JSON |
Examples (from help)
Section titled “Examples (from help)”uc-apx create branch \ --page 10 \ --name "Back to customer" \ --target-page 50 \ --item-pair P50_ID=&P10_ID. \ --clear-cache 10 \ --when-button-pressed saveExample Generated APEXlang
Section titled “Example Generated APEXlang”Using --dry-run to preview the generated construct (no files are written):
uc-apx --app-dir examples/brookstrut create branch --page 46 --name Go to Home --target-page 1 --when-button-pressed @reset --dry-runGenerated APEXlang
branch ( name: Go to Home execution { sequence: 20 } behavior { target: { page: 1 } } serverSideCondition { whenButtonPressed: @reset } )