Skip to content

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]
FlagTypeDefaultDescription
--actionstringbehavior.target.action (e.g. resetPagination)
--authzstringsecurity.authorizationScheme (id of an authorization scheme)
--clear-cachestringArrayPage id (or substitution like &APP_PAGE_ID.) to clear; repeat for multiple
--dry-runPrint rendered branch to stdout without writing
--item-pairstringArraySet ITEM=VALUE on the target page; repeat for multiple
--namestringBranch display name (optional)
--no-success-messageEmit successMessage: false on the target block (suppresses the default success message)
--pagestringSource page (numeric ID, alias, or name) [required]
--save-stateEmit saveStateBeforeBranching: true on the behavior block
--sequenceintexecution.sequence (default: max existing branch sequence + 10)
--server-side-conditionstringFree-form serverSideCondition body (e.g. “type=expression value=…”); mutually exclusive with —when-button-pressed
--target-pageintDestination page id [required]
--when-button-pressedstringBranch only when this button was pressed (shortcut for serverSideCondition.whenButtonPressed)
FlagTypeDefaultDescription
--app-dirstring.Path to the APEX application directory
--json-prettyOutput in pretty-printed JSON (human-readable) instead of minified JSON
--toonOutput in TOON format (human-readable, token-efficient) instead of JSON
Terminal window
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 save

Using --dry-run to preview the generated construct (no files are written):

Terminal window
uc-apx --app-dir examples/brookstrut create branch --page 46 --name Go to Home --target-page 1 --when-button-pressed @reset --dry-run
Generated APEXlang
branch (
name: Go to Home
execution {
sequence: 20
}
behavior {
target: {
page: 1
}
}
serverSideCondition {
whenButtonPressed: @reset
}
)