# Warnings reference Every warning the module raises: 71 in all, each with a stable id, its exact message, why it matters, how to fix it, and a smallest example that raises it. Ids are stable within UJN 0.1 and may change before 1.0. The module does not write them yet. ## action-exit-no-trigger `an exit from an action takes no trigger` - When: An exit out of an action, meaning any arrow that is not a call into a system or a write into a data store, has a `[trigger]`. - Why: An action is the system acting, not the user, so its exits are picked by guards, or all fire when unguarded, never by a user's trigger. - How to fix it: Drop the brackets: write the condition as a guard, `act --> a : valid`, or leave the exit unlabeled. The user's trigger belongs on the arrow into the action. - Spec: 14.4, 13.5, 21 ```ujn @startujn journey J "Journey" action act view a act --> a : [Go] @endujn ``` ## action-timeout-needs-timeout-exit `has a timeout but no exit guarded timeout` - When: An action has a valid `timeout` and at least one exit, but no exit whose guard is exactly `timeout`. - Why: A timeout means the action can run out of time, so one exit must say where the user goes when it does; without it that outcome is missing from the journey. - How to fix it: Add an exit guarded `timeout` (`check -x-> slow : timeout`), or remove the `timeout` key if the action cannot time out. - Spec: 14.3, 21 ```ujn @startujn journey J "Journey" action check { timeout: 10 s } view done check --> done @endujn ``` ## actor-and-ref-have-no-type ` has no type` - When: An actor or a journey reference has a `type` key; the message reads "an actor has no type" or "a ref has no type". - Why: Actors and references have no type menu, so the value cannot change the drawing; the key is ignored. - How to fix it: Remove the `type` key. To say what kind of person an actor is, use `role`. - Spec: 4.5, 12.1, 18.1, 21 ```ujn @startujn journey J "Journey" actor user { type: admin } @endujn ``` ## arrow-key-known `key does not apply to an arrow` - When: An arrow's block holds a key other than `flags`, `payload`, `returns`, `trace`, `context`, `a11y`, `tooltip`, `arrow_spacing`, `color_line`, `color_text` or `color_background`. - Why: An arrow has its own short set of keys, and a node key such as `route` or `type` means nothing on it. The value is kept in the model under `extra`, so a tool can try out a new field. - How to fix it: Remove the key, or move it to the node it belongs to. - Spec: 13.9, 4.4, 21 ```ujn @startujn journey J "Journey" view a view b a --> b : [Go] { route: /b } @endujn ``` ## arrow-spacing-is-pixels `arrow_spacing is a number of pixels, 0 or more, or default, not ; the render block's is used` - When: An arrow's `arrow_spacing` is neither a number of 0 or more (with or without `px`) nor `default`; quotes and case do not matter. - Why: The room along an arrow must be a size in pixels for the layout to use. The arrow falls back to the `render` block's value, or to the layout's own room when the `render` block has none. - How to fix it: Write a number of pixels, 0 or more, such as `arrow_spacing: 40` or `40px`, or write `default`. - Spec: 19.8, 13.9, 21 ```ujn @startujn journey J "Journey" view a view b a --> b : [Go] { arrow_spacing: wide } @endujn ``` ## arrow-written-once `the same arrow twice` - When: Two arrows have the same source, target, kind (navigation, negative or return), trigger and guard; it is raised on each later copy. A direction hint does not tell arrows apart, and `..>` and `.x.>` are the same kind. - Why: Two such arrows say the same thing twice, which is usually a copy-and-paste slip. - How to fix it: Delete one copy, or, if they are two real exits, tell them apart with a different trigger or guard. - Spec: 21, 13.2 - Module note: Section 21 says the arrow is drawn once; the module draws both copies and keeps both in the model. ```ujn @startujn journey J "Journey" view a view b b ..> a b ..> a @endujn ``` ## boolean-is-true-or-false ` must be true or false, not ` - When: `auto` in the `increment` block, `collapsed` on a view, or `blocks` on a modal, drawer, popover or toast has a value other than `true` or `false` (any case, without quotes; a quoted `"true"` also raises it). - Why: The key is a switch, and a value that is neither is ignored. For `auto`, display id assignment stays as it was, which is off unless an earlier entry turned it on; for `collapsed` and `blocks`, the view keeps its default and may not behave as the writer meant. - How to fix it: Write `true` or `false` without quotes, or the key alone for `true` (`auto`, `collapsed`). - Spec: 5, 6, 11.3, 11.4, 21 ```ujn @startujn journey J "Journey" view a { collapsed: maybe } @endujn ``` ## call-no-label `a call takes no trigger and no guard; its payload says what is sent` - When: An arrow from an action into a system (a call) has a trigger or a guard. - Why: A call is part of the action and happens while it runs; it is not an exit that someone picks or a condition selects, so a label has no meaning on it. - How to fix it: Remove the label and put what is sent in the payload: `act --> s { payload: [email] }`. - Spec: 14.5, 14.4, 21 ```ujn @startujn journey J "Journey" action act system s act --> s : ok @endujn ``` ## color-block-holds-color-keys `not a color key in : ` - When: An entry in a color block is not a color key of its kind: `color_frame`, `color_icon`, `color_title`, `color_description` or `color_background` for a node kind; `color_line`, `color_text` or `color_background` for `arrow_color`. - Why: Color blocks hold only color defaults; any other key, or a color key of the other family, is skipped. - How to fix it: Use a color key of the block's kind, or move the entry to the node or arrow it belongs to. - Spec: 10.2, 13.9, 21 - Module note: Section 21 says an unknown key is kept under `extra`; the module drops it. ```ujn @startujn view_color { color_line: #887788 } journey J "Journey" view a @endujn ``` ## color-block-type-known `unknown type in ` - When: A typed color block, `_color_`, names a type its kind does not have, or `arrow_color_` names an arrow kind other than `navigation`, `negative` or `return`. An actor and a reference have no types, so any `actor_color_` or `ref_color_` raises it. - Why: No node or arrow can have that type, so the block colors nothing; usually the type is misspelled. - How to fix it: Use a type of that kind (11.2, 12.1, 14.2, 15.2, 16.2, 17.2) or an arrow kind (13.9), or use the untyped block `_color`. - Spec: 10.2, 13.9, 21 ```ujn @startujn view_color_dialog { color_frame: #887788 } journey J "Journey" view a @endujn ``` ## color-is-hex-or-name `not a color: ` - When: A color key on a node, on an arrow or in a color block has a value that is neither `#` with 3, 6 or 8 hex digits nor a color name PlantUML knows. - Why: PlantUML would draw an unknown name as white, so the value is ignored and the color comes from the color blocks or the theme instead. - How to fix it: Use a hex color (`#5555d0`) or a PlantUML color name (`LightBlue`). - Spec: 5, 10.1, 10.2, 13.9, 21 ```ujn @startujn journey J "Journey" view login { color_frame: blue-ish } @endujn ``` ## data-store-only-actions `a data store connects only to actions` - When: An arrow joins a data store, at either end, to a node that is not an action. - Why: Only an action reads or writes a store: the system does the work, and a view or any other node does not touch storage directly. Reads and writes are worked out from arrows between actions and stores. - How to fix it: Go through an action: the view leads to an action, and the action writes to the store or reads from it. - Spec: 16.4, 21 ```ujn @startujn journey J "Journey" view a data d a --> d : [Save] @endujn ``` ## dismiss-from-list `dismiss takes escape, outside, close, timeout, or none alone: ` - When: A `dismiss` on a modal, drawer, popover or toast lists something other than `escape`, `outside`, `close`, `timeout` or `none`, lists `none` together with another item, has no value, or opens a list and never closes it. Case counts: `Escape` also raises it. - Why: `dismiss` tells the platform how the user can close an overlay without taking an exit. A way of closing that does not exist cannot be built, and `none` next to another way contradicts itself. The value is ignored and the type's default stays. - How to fix it: List only `escape`, `outside`, `close` and `timeout`, or write `dismiss: [none]` alone, and close the brackets. - Spec: 11.4, 5, 21 ```ujn @startujn journey J "Journey" view a { type: modal; dismiss: [escape, sideways] } @endujn ``` ## duration-is-number-and-unit `not a duration: ` - When: `timeout` on an action (of type action, wait, event or auth) or a handoff, or `duration` on a toast, is not a number followed by `ms`, `s`, `min`, `h` or `d`, with one optional space. - Why: The timeout is drawn on the meta line; on an action it also decides which exit is taken when time runs out (14.3), on a handoff it says how long the link stays valid (15.3). A value that is not a duration is ignored, so the node has no timeout. A toast's `duration` says how long it stays before it closes by itself (11.4); a value that is not a duration is ignored, and the toast keeps its 5 s default. - How to fix it: Write a number and a unit, for example `timeout: 5 min`, `timeout: 24h` or `duration: 500ms`. - Spec: 5, 11.4, 14.3, 15.3, 21 ```ujn @startujn journey J "Journey" action a { timeout: soon } @endujn ``` ## end-has-no-exits `an end has no exits` - When: An arrow leaves an end node (one warning per end, at the line of the first such arrow). - Why: An end is where the journey stops; an arrow out of it means the journey goes on, so the node is not an end. - How to fix it: Remove the arrow out of the end, or replace the end with the node the flow really goes through. - Spec: 17.4, 13.5, 21 ```ujn @startujn journey J "Journey" end done view home done --> home @endujn ``` ## every-node-reached-from-start `no path from a start reaches it` - When: The journey has at least one start and one arrow, and a node other than an actor or a data store is reached from no start through exits, resumes, calls, writes or reads (other returns do not count). - Why: A node the user can never get to is a missing arrow or a leftover; either way the journey as drawn is not the journey as meant. - How to fix it: Add the arrow that leads to the node from the flow, or remove the node. - Spec: 17.5, 21, 23.23 - Module note: The module checks this only when the journey also has at least one arrow; 17.5 and 21 say a journey with a start is enough, so a start and a view with no arrows get no warning. ```ujn @startujn journey J "Journey" start open_app view home view help open_app --> home @endujn ``` ## exit-needs-trigger `an exit from needs a trigger, written after a colon: [Trigger]` - When: A `-->` or `-x->` arrow out of a view or an actor has no `[trigger]`; returns and arrows into a start are not checked. - Why: The user leaves a view by doing something, such as a button, a link or a gesture, and an inline actor by picking an outcome; the trigger names it. Without it a reader cannot tell what leads where. - How to fix it: Add the trigger after a colon, `a --> b : [Next]`, or write the arrow as `..>` if it is a return. - Spec: 13.5, 12.3, 21 ```ujn @startujn journey J "Journey" view a view b a --> b @endujn ``` ## exits-all-guarded-or-none `guarded and unguarded exits on one ` - When: An action or a start has both guarded and unguarded exits; calls into systems and writes into stores do not count. is action or start. - Why: All unguarded exits fire, while exactly one guarded exit fires, so mixing the two on one node leaves it unclear what happens. A start is left as an action is, so the same rule applies. Whether to allow the mix is still open (23.18). - How to fix it: Guard every exit or none. To run something next to a guarded outcome, send that exit into a fork, whose unguarded exits all fire. - Spec: 14.4, 13.5, 17.4, 21, 23.18 ```ujn @startujn journey J "Journey" action act view a view b act --> a : ok act --> b @endujn ``` ## flag-known `unknown flag ` - When: A `flags` list on a node or an arrow holds a name that is not one of the eleven flags. - Why: Only the eleven flags have a meaning and a glyph; an unknown one, often a typo, is ignored, so the flag the writer meant is lost. - How to fix it: Use one of the eleven flags, in lowercase with hyphens: idea, future, not-implemented, out-of-scope, deprecated, experiment, risk, security, needs-decision, needs-updates, legacy. - Spec: 8, 21 ```ujn @startujn journey J "Journey" view login { flags: [later] } @endujn ``` ## flag-written-once `flag written twice: ` - When: The same flag appears twice on one node or arrow, in one `flags` list or across two `flags` entries (which also warn that the key is written twice). - Why: A flag is either set or not, so the second copy adds nothing and usually hides a copy-and-paste slip. - How to fix it: Remove the repeated flag. - Spec: 8, 21 ```ujn @startujn journey J "Journey" view login { flags: [future, future] } @endujn ``` ## flags-is-a-list `flags is a list: [future, risk]` - When: A `flags` key on a node or an arrow has no value, or its value opens with `[` and does not close with `]`. - Why: Flags are read as a list; a bare key or an unclosed bracket gives no flags at all, so the node or arrow is drawn as if it had none. - How to fix it: Write the flags as a closed list (`flags: [future, risk]`), or one flag bare (`flags: future`). - Spec: 8, 5, 13.8, 21 ```ujn @startujn journey J "Journey" view login { flags: [future } @endujn ``` ## focus-from-list `focus is trap, move or stay, not ` - When: A view's `focus` is not exactly `trap`, `move` or `stay`. The check is case-sensitive and does not remove quotes, so `Trap` and `"trap"` also raise it. - Why: Focus handling is part of what the platform builds for a view, and only these three behaviors exist. The value is ignored and the type's default stays. - How to fix it: Write `focus: trap`, `focus: move` or `focus: stay`, in lowercase and without quotes. - Spec: 11.4, 21 ```ujn @startujn journey J "Journey" view a { focus: grab } @endujn ``` ## fork-exits-unguarded `a fork has only unguarded exits` - When: An action of type `fork` has at least one exit with a guard. - Why: Every exit of a fork fires at the same time; a guard suggests a choice, which a fork never makes. - How to fix it: Remove the guards from the fork's exits; to choose one path, use a plain action with guarded exits instead. - Spec: 14.4, 14.2, 21 ```ujn @startujn journey J "Journey" action split { type: fork } view next split --> next : ok @endujn ``` ## friendly-id-is-handle-like `unique_id_friendly is letters, digits and _, not ` - When: A `unique_id_friendly` on a node or on the journey is not letters, digits and `_`, starting with a letter. - Why: A friendly id is read across files as `namespace.name`, so it uses the same characters as a handle. The value is ignored: a node falls back to its handle, and the journey to its id in lowercase. - How to fix it: Use only letters, digits and `_`, starting with a letter: `forgot_password`, not `forgot-password`. - Spec: 7.4, 21 ```ujn @startujn journey J "Journey" view a { unique_id_friendly: my-page } @endujn ``` ## handoff-left-by-resume-only `a handoff is left only by its resume arrows (..>)` - When: A `-->` or `-x->` arrow leaves a handoff. - Why: A handoff is where the user leaves the app; the only ways out of it are the user coming back, which are resume arrows. A `-->` would mean the flow moves on while the user is away. - How to fix it: If the user comes back here, make the arrow a `..>` resume with a trigger, `h ..> a : [Open link]`, on a handoff of type `returns` (the default). If the user does not come back (`no-return`), remove the arrow: the journey ends out there. - Spec: 15.4, 21 ```ujn @startujn journey J "Journey" handoff h { type: no-return } view a h --> a @endujn ``` ## handoff-resume-matches-start-route `the handoff's resume differs from the start's route ` - When: A handoff with a `resume` has a resume arrow into a `handoff-return` start whose `route` has a different value. - Why: Both keys name the link the user comes back through; two different values for one link leave readers and tools unsure which is right. - How to fix it: Make the two values the same, or write the link in one place only: the handoff's `resume` or the start's `route`. - Spec: 17.4, 15.3, 21, 23.19 ```ujn @startujn journey J "Journey" start back { type: handoff-return; route: /checkout/return } view checkout handoff bank { resume: /checkout/back } back --> checkout checkout --> bank : [Pay] bank ..> back : [Approve] @endujn ``` ## id-position-from-list `id_position is outside, inside, inside-top, inside-bottom or hidden, not ; the render block's is used` - When: A node's `id_position` value is not `outside`, `inside`, `inside-top`, `inside-bottom` or `hidden` (quotes and case do not matter). - Why: The node then draws its display id where the `render` block says (`outside` by default), whatever an earlier entry for the key said, so the id may not be where the author meant. - How to fix it: Use one of the five values, or remove the key to take the `render` block's. - Spec: 4.6, 21 ```ujn @startujn journey J "Journey" view a { id_position: top } @endujn ``` ## increment-key-known `unknown increment key ` - When: A key in the `increment` block is neither `auto` nor `_prefix`, `_delimiter`, `_start` or `_digits` for one of the nine node kinds. - Why: A misspelled setting or kind (`view_suffix`, `views_prefix`) is ignored, so the display ids would keep their defaults without notice. - How to fix it: Use a key of the `increment` block (6): `auto`, or `_prefix`, `_delimiter`, `_start` or `_digits`, with kind view, actor, system, action, handoff, data, start, end or ref. - Spec: 6, 21 - Module note: Section 21 says an unknown key is kept under `extra`; the module drops an unknown increment key. ```ujn @startujn increment { view_suffix: x } journey J "Journey" view a @endujn ``` ## increment-number-is-digits ` must be a number, not ` - When: A `_start` or `_digits` key in the `increment` block has a value that is not digits only, once quotes are removed. - Why: The counter's first number and its zero padding are whole numbers; another value is ignored, and the default (start 1, 3 digits) or an earlier entry is used. - How to fix it: Write digits only, for example `view_start: 2` or `view_digits: 3`. - Spec: 6, 5, 21 - Module note: Digits only is all the check asks for, so a value too large for a whole number (`view_start: 99999999999`) passes it and then stops the drawing with an internal error once `auto` is on; a very large `_digits` that fits (`2000000000`) gives no drawing at all. ```ujn @startujn increment { view_start: two } journey J "Journey" view a @endujn ``` ## join-has-one-exit `a join has one exit` - When: An action of type `join` has more than one exit. - Why: A join waits for every path coming in and then goes on along one path; a second exit splits the flow again, which is a fork's job. - How to fix it: Keep one exit on the join; to split the flow after it, lead that exit into a fork. - Spec: 14.4, 21 ```ujn @startujn journey J "Journey" action meet { type: join } view one view two meet --> one meet --> two @endujn ``` ## journey-key-known `key does not apply to the journey` - When: An entry directly under the journey line uses a key other than `description`, `context`, `trace`, `a11y`, `unique_id` or `unique_id_friendly`. - Why: The journey takes only those keys; any other key (a node key such as `route`, or a typo) is ignored, so the author would lose it without notice. - How to fix it: Fix the key's spelling, move the entry into the block of the node it belongs to, or remove it. - Spec: 3, 21 - Module note: Section 21 says an unknown key is kept under `extra`; the module drops an unknown journey key (the journey has no `extra` in the model). ```ujn @startujn journey J "Journey" route: /home view a @endujn ``` ## key-fits-node-type ` does not apply to type ` - When: A view has `blocks` or `dismiss` on a type other than modal, drawer, popover or toast, `duration` on a type other than toast, or `target` on a type other than new-window; or an action has `timeout` on a type other than action, wait, event or auth, or `channel` on a type other than message. - Why: The key means nothing for that type (a plain view is never dismissed, only a toast closes by itself); its value is kept under `extra` in the model but not used. - How to fix it: Remove the key, or change the type to one it applies to, for example `type: toast` for `duration`. - Spec: 11.4, 14.3, 21 ```ujn @startujn journey J "Journey" view a { duration: 3 s } @endujn ``` ## key-written-once `key written twice: ; the last one wins` - When: The journey's entries, a node's block or an arrow's block hold the same key more than once, for any key except the list keys `trace` and `a11y`. - Why: A single-value key holds one value, so the earlier line is overridden without anything else showing it; usually one of the two lines is a leftover or a typo. `flags` and `payload` are the exception: the module adds both lists up, although the message says the last one wins. - How to fix it: Delete the entry you do not mean. Only `trace` and `a11y` may be repeated; their values add up. For `flags` or `payload`, write one list that holds every item. - Spec: 5, 21 - Module note: `flags` and `payload` written twice add up (`flags: future; flags: risk` gives both flags), although the message and section 5 say the last one wins. The `render`, `increment` and color blocks never raise this warning: a key repeated there quietly replaces the earlier one, while section 5 asks for a warning for any key. ```ujn @startujn journey J "Journey" view a { title: "One"; title: "Two" } @endujn ``` ## label-needs-free-place `no free place by the arrow for its label, which is drawn where it is least in the way` - When: After the layout is made again with more room along the arrow, the arrow's label (its pill) still finds no free place by its line. - Why: The label is then drawn off its line, where it covers the least, so it can look as if it belongs to another arrow; the warning names the arrow to check. It is in the drawing's warnings box only, never in the model, so `warnings: hide` leaves it out entirely. - How to fix it: Give the label room: shorten it and the labels beside it, or leave a return unlabeled when it needs no label (in the example, `[Back]` and `[Open]`, or a bare `orders ..> orders`, draw no warning). - Spec: 13.10, 19.6, 20.6, 21 ```ujn @startujn journey J "Journey" view orders orders ..> orders : [Back to orders] orders --> orders : [Open details] @endujn ``` ## no-return-handoff-never-resumes `a no-return handoff has a way back` - When: A handoff of type `no-return` has an arrow into it with `returns`, or a resume arrow (`..>` or `.x.>`) out of it. - Why: The type says the journey ends out there; a way back contradicts it, so the drawing says both that the user returns and that they do not. - How to fix it: Remove the `returns` key and the resume arrows, or change the type to `returns` (the default) if the user does come back. - Spec: 15.4, 21 ```ujn @startujn journey J "Journey" view help handoff call_us { type: no-return } help --> call_us : [Call us] { returns } @endujn ``` ## node-key-known `key does not apply to ` - When: A node's block holds a key that is not defined for its keyword, such as `host` on a view or `role` on a system. is the keyword (view, actor, system, action, handoff, data, start, end, ref), with "an" before actor, action and end. - Why: An unknown key is usually a typo or a key of another kind. Its value is kept under `extra` in the model, so tools can try out a field before the language adopts it, but it is not drawn or checked. - How to fix it: Fix the spelling, move the key to the kind of node it belongs to, or remove it. - Spec: 4.4, 12.2, 21 ```ujn @startujn journey J "Journey" view a { host: example.com } @endujn ``` ## node-type-known `unknown type ; drawn as ` - When: The `type` of a view, system, action, handoff, data store, start or end is not one of that keyword's types. is the keyword's default type. - Why: The type sets the icon and the type name drawn and, for a view, its default behavior; an unknown type falls back to the default, so the node may look and behave unlike what the author meant. - How to fix it: Use a listed type, lowercase with hyphens: view (11.2), system (12.1), action (14.2), handoff (15.2), data (16.2), start and end (17.2). - Spec: 4.5, 21 ```ujn @startujn journey J "Journey" view a { type: dialog } @endujn ``` ## one-increment-block `a second increment block; its entries are added to the first` - When: A diagram holds a second `increment` block. The warning is raised once, at the second block. - Why: A journey has at most one `increment` block; a second one can quietly change the prefixes, starts or padding the first one set, because its entries are read as if they were in the first. - How to fix it: Merge the entries into one `increment` block. - Spec: 6, 21 ```ujn @startujn increment { auto } increment { view_digits: 2 } journey J "Journey" view a @endujn ``` ## one-render-block `a second render block; its entries are added to the first` - When: A diagram holds a second `render` block, before or after the journey line. The warning is raised once, at the second block. - Why: Drawing settings are meant to sit in one place, often a shared file brought in with `!include`; a second block can quietly change what the first one set, because its entries are read as if they were in the first. - How to fix it: Merge the entries into one `render` block. - Spec: 19.1, 21 ```ujn @startujn render { legend } render { corners: square } journey J "Journey" view a @endujn ``` ## only-action-calls-system `only an action calls a system` - When: An arrow goes into a system from any node that is not an action. - Why: A system is never reached by a screen or a person directly: only an action, something the system does, calls it, with the request as the call's payload. - How to fix it: Put an action between them: the node leads to the action, and the action calls the system with `-->`. - Spec: 14.5, 13.5, 21 ```ujn @startujn journey J "Journey" view a system s a --> s : [Go] @endujn ``` ## parent-is-a-handle `parent must be a handle, not ` - When: A view's `parent` value is not a handle (letters, digits and `_`, starting with a letter), for example a name that starts with a digit, or quoted text. - Why: `parent` links a view to the view it belongs to by handle; a value that cannot be a handle names no node, so it is ignored. - How to fix it: Write the parent view's handle bare, for example `parent: new_claim`. - Spec: 11.3, 4.2, 5, 21 ```ujn @startujn journey J "Journey" view a { parent: 2nd_step } @endujn ``` ## parent-is-a-view `parent is not a view of this journey` - When: A view's `parent` names a handle that no node of this journey declares, or a node that is not a view. - Why: `parent` tells the tools that read the model which view a step, tab or overlay belongs to (its wizard, its tabs view, or the one view it always opens over); a link to a missing node or a non-view cannot be grouped, so the module drops it and the model's `parent` is null. - How to fix it: Name the handle of a view declared in this journey, for example the wizard the step belongs to, or remove the `parent` key. - Spec: 11.3, 21 ```ujn @startujn journey J "Journey" view a { parent: b } @endujn ``` ## payload-is-a-list `payload is a list: [a, b]` - When: An arrow's `payload` has no value, or opens a list with `[` and never closes it. - Why: The payload says what crosses the arrow and is drawn in braces with its label. A payload without a list says nothing, so it is ignored. - How to fix it: Give it a list with the closing bracket, `payload: [email, password]`, or a single item, `payload: email`. - Spec: 13.6, 5, 21 - Module note: `payload:` with nothing after the colon raises no warning: the model gets a payload of one empty item. ```ujn @startujn journey J "Journey" view a view b a --> b : [Go] { payload } @endujn ``` ## point-from-list `point is auto, up, down, left or right, not ; auto is used` - When: A reference's `point` value is not `auto`, `up`, `down`, `left` or `right` (quotes and case do not matter). - Why: `point` turns the reference's shape; a value it cannot read falls back to `auto`, so the point faces away from the node its first arrow comes from, which may not be the side the author meant. - How to fix it: Use one of the five values, or remove the key for `auto`. - Spec: 18.2, 21 ```ujn @startujn journey J "Journey" ref r { journey: REG; point: north } @endujn ``` ## read-write-no-label `a read or a write takes no trigger and no guard; its payload says what moves` - When: An arrow between an action and a data store (a write into the store or a read out of it) has a trigger or a guard. - Why: A read or a write is part of its action, not an exit that someone picks or a condition selects, so a label has no meaning on it. - How to fix it: Remove the label and put what moves in the arrow's payload: `act --> d { payload: [claim] }`. - Spec: 16.4, 21 ```ujn @startujn journey J "Journey" action act data d act --> d : saved @endujn ``` ## ref-exit-no-trigger `an arrow out of a journey reference takes no trigger: the other journey ends` - When: An arrow out of a journey reference has a `[trigger]`. - Why: When the other journey ends, nobody clicks anything here, so there is nothing for a trigger to name; a guard names the outcome instead. - How to fix it: Remove the trigger, and name the outcome as a guard when there is more than one way back: `r ..> a : registered`. - Spec: 18.3, 13.5, 21 ```ujn @startujn journey J "Journey" ref r { journey: OTHER } view a r ..> a : [Done] @endujn ``` ## ref-exits-need-guards ` arrows leave the journey reference; each needs a guard naming an outcome` - When: More than one arrow leaves one journey reference and at least one of them has no guard. It is raised on the reference, at the first arrow's line. - Why: Each arrow out of a reference is one outcome of the other journey. With more than one, a guard must say which outcome leads where. - How to fix it: Name the outcome as a guard on each arrow: `r ..> a : registered` and `r ..> b : canceled`. - Spec: 18.3, 13.5 ```ujn @startujn journey J "Journey" ref r { journey: OTHER } view a view b r ..> a r ..> b @endujn ``` ## ref-journey-is-an-id `journey is the id of another journey, not ` - When: A reference's `journey` value is not a journey id (a letter or digit, then letters, digits, `.`, `_` or `-`), for example quoted text with a space. - Why: The reference stands for the journey with that id, and tools follow the id to it; a value that cannot be an id is ignored, so the model's `journey` for the reference is null. - How to fix it: Write the id from the other journey's journey line, bare, for example `journey: REG`. - Spec: 18.2, 3, 21, 22 ```ujn @startujn journey J "Journey" ref r { journey: "Other journey" } @endujn ``` ## ref-left-by-resume-only `only ..> arrows leave a journey reference` - When: A `-->` or `-x->` arrow leaves a journey reference. - Why: Arrows out of a reference say where this journey resumes once the other journey ends, so they are `..>` resume arrows, as out of a handoff. - How to fix it: Write the arrow as `..>`: `r ..> a`. - Spec: 18.3, 21 ```ujn @startujn journey J "Journey" ref r { journey: OTHER } view a r --> a @endujn ``` ## ref-needs-journey `a journey reference needs journey: , the id of the journey it stands for` - When: A `ref` node has no `journey` key. - Why: A reference stands for another journey; without that journey's id, neither readers nor tools can tell where the user goes. - How to fix it: Add `journey:` with the id from the other journey's journey line (`journey: REG`). - Spec: 18.2, 21 - Module note: The message prints as written; nothing is filled in there. ```ujn @startujn journey J "Journey" ref registration @endujn ``` ## render-arrow-spacing-is-pixels `arrow_spacing is a number of pixels, 0 or more, or default, not ; the default is used` - When: `arrow_spacing` in the `render` block is neither `default` nor a number of 0 or more, with or without `px` (quotes and case do not matter). - Why: The value sets the room the layout counts along every arrow; a value it cannot read falls back to the layout's own spacing (70 px), so the drawing differs from what the author asked for. - How to fix it: Write a number of pixels such as `arrow_spacing: 10`, `10px` or `7.5`, or `default`. - Spec: 19.8, 19.1, 21 ```ujn @startujn render { arrow_spacing: wide } journey J "Journey" view a @endujn ``` ## render-key-known `unknown render key ` - When: The `render` block holds a key other than `colors`, `corners`, `direction`, `legend`, `warnings`, `id_position` or `arrow_spacing`. - Why: A misspelled or invented drawing setting is ignored, so the drawing would keep its default without notice. - How to fix it: Use one of the keys of the `render` block (19.1), or remove the entry. - Spec: 19.1, 21 ```ujn @startujn render { theme: dark } journey J "Journey" view a @endujn ``` ## render-value-from-list ` is , not ; the default is used` - When: A `render` key `colors`, `corners`, `direction`, `legend`, `warnings` or `id_position` has a value outside its list (quotes and case do not matter). lists the values, for example `color or mono`. - Why: The key's default (`color`, `rounded`, `right`, `false`, `show`, `outside`) is used instead, whatever an earlier entry for the key said, so the drawing differs from what the author meant. - How to fix it: Use one of the listed values, for example `colors: mono`. - Spec: 19.1, 4.6, 21 ```ujn @startujn render { colors: sepia } journey J "Journey" view a @endujn ``` ## resume-needs-trigger `a resume arrow needs a trigger: what the user does out there` - When: A `..>` or `.x.>` arrow out of a handoff has no `[trigger]`. - Why: Coming back from a handoff is something the user does out there, such as opening a link or approving in a bank app, and the trigger says which, as for a view's exits. - How to fix it: Add what the user does as the trigger: `h ..> a : [Open link]`. - Spec: 15.4, 13.5 ```ujn @startujn journey J "Journey" handoff h view a h ..> a @endujn ``` ## returning-handoff-needs-way-back `a returning handoff needs a way back: { returns } on the arrow into it, or a ..> out of it` - When: A handoff of type `returns` (the default) has no arrow into it with `returns` and no resume arrow (`..>` or `.x.>`) out of it. - Why: The type says the user comes back, so the journey must show where they come back to; otherwise the return is missing from the drawing and the model. - How to fix it: Add `{ returns }` to the arrow into the handoff, add a resume arrow out of it (`bank ..> paid : [Approve]`), or set `type: no-return` if the user does not come back. - Spec: 15.4, 21 ```ujn @startujn journey J "Journey" handoff bank @endujn ``` ## returns-into-ref-or-handoff `returns only applies to an arrow into a journey reference or a handoff` - When: An arrow with `returns`, on its own or with a label, goes into anything other than a journey reference or a handoff (`returns: false` does not count). - Why: `returns` asks the renderer to draw the way back from another journey or from outside the app; on any other arrow there is nothing to come back from. It is ignored and nothing extra is drawn. - How to fix it: Remove `returns`, and write an explicit `..>` arrow if there is a way back. - Spec: 13.7, 21 ```ujn @startujn journey J "Journey" view a view b a --> b : [Go] { returns } @endujn ``` ## shared-prefix-same-start `kinds that share the prefix have different starts` - When: `increment` has `auto`, and a node without a display id belongs to a kind whose prefix and delimiter match a kind numbered earlier, but whose `_start` is different. It is raised once for each such node. - Why: Kinds that share a prefix share one counter so their ids never collide, and a counter can start only once. The module keeps the start of the first kind it numbered, so the later kind's start has no effect. - How to fix it: Give every kind that shares the prefix the same `_start`, or give those kinds different prefixes or delimiters. - Spec: 6, 21 ```ujn @startujn journey J "Journey" increment { auto; view_prefix: P; action_prefix: P; action_start: 5 } view a action b @endujn ``` ## shared-trigger-needs-guards ` exits share []; each needs a guard` - When: Two or more exits from one view or actor, or resume arrows from one handoff, have the same trigger and at least one has no guard. It is raised once per group, on the source node, at the first arrow's line. - Why: When one trigger leads to several places, the guards tell the outcomes apart. If one exit has no guard, nobody can tell which one is taken. - How to fix it: Give every exit that shares the trigger a guard, such as `[Sign in] valid` and `[Sign in] wrong password`, or give them different triggers. - Spec: 13.5, 15.4, 21 ```ujn @startujn journey J "Journey" view a view b view c a --> b : [Go] a --> c : [Go] @endujn ``` ## special-characters-quoted `quote text that holds ; } or an apostrophe: ` - When: A text value written without quotes holds `;`, `}` or an apostrophe, or a quoted value is not closed properly (a bare `"` inside it, or a backslash before the closing quote). - Why: Unquoted, these characters end an entry, close a block or start a trailing comment, so the same text placed elsewhere would be cut short; here the module keeps the value as written. - How to fix it: Put the text in double quotes: `title: "Customer's claims"`. - Spec: 5, 2 ```ujn @startujn journey J "Journey" view claims { title: Customer's claims } @endujn ``` ## start-entered-by-actor-or-resume `only the actor who starts the journey, or a handoff's resume into a handoff-return start, leads into a start` - When: An arrow leads into a start, and it is neither from an actor nor a handoff's resume arrow (`..>` or `.x.>`) into a start of type `handoff-return`. - Why: A start is where the journey begins, so only the person who begins it, or a user coming back from a handoff, enters it; any other arrow into a start is a loop inside the journey drawn as a new beginning. - How to fix it: Lead the arrow to the node after the start instead; to show who begins the journey, draw the arrow into the start from an actor; for a return from a handoff, use a `..>` from the handoff into a `handoff-return` start. - Spec: 17.4, 21 ```ujn @startujn journey J "Journey" start open_app view home open_app --> home home --> open_app @endujn ``` ## start-exit-no-trigger `an exit from a start takes no trigger` - When: An arrow out of a start has a `[trigger]`. - Why: A start is left as an action is: the journey simply begins and nobody chooses anything, so there is nothing for a trigger to name. - How to fix it: Remove the trigger; a choice the user makes belongs on an exit from the first view. - Spec: 17.4, 13.5 ```ujn @startujn journey J "Journey" start s view a s --> a : [Go] @endujn ``` ## start-needs-exit `a start with no exit` - When: The journey has at least one arrow, and a start has no arrow leaving it. - Why: A start is where the journey begins; with no exit nothing follows from it, so the flow it should begin is missing. - How to fix it: Add an arrow from the start to the first node of the journey (`open_app --> home`), or remove the start. - Spec: 17.4, 21 - Module note: The module checks this only when the journey has at least one arrow, a condition neither 17.4 nor 21 states: a journey with a start and no arrows gets no warning. ```ujn @startujn journey J "Journey" actor customer start open_app customer --> open_app @endujn ``` ## system-only-replies `a system only replies, with ..>, to an action that calls it` - When: An arrow leaves a system and is not a `..>` (or `.x.>`) into an action that has an arrow into that system. - Why: A system answers the action that called it and cannot move the flow on by itself. A reply to an action that never calls the system has no request to answer. - How to fix it: Make the arrow a `..>` reply to the action that calls the system, and continue the flow from that action. - Spec: 14.5, 13.5, 21 ```ujn @startujn journey J "Journey" system s view a s --> a @endujn ``` ## target-from-list `target is tab or window, not ` - When: A new-window view's `target` is not exactly `tab` or `window` (case-sensitive, quotes not removed). - Why: A new window opens either in a browser tab or in a separate window. Anything else cannot be built, so the value is ignored and the default, `tab`, stays. - How to fix it: Write `target: tab` or `target: window`, in lowercase and without quotes. - Spec: 11.4, 21 ```ujn @startujn journey J "Journey" view a { type: new-window; target: popup } @endujn ``` ## text-needs-value ` needs a value` - When: A text key (`title`, `description`, `context`, `route`, `role`, `host`, `channel`, `resume`, `location`, `tooltip`, `a11y`, or a `returns` label) is written alone or with nothing after the colon (for `returns`, only `returns:` with nothing after the colon; `returns` alone means true). - Why: A text key with no text says nothing, so the entry is ignored and the node keeps its default, such as the handle as its title. - How to fix it: Give the key its text (`title: "Login"`), or remove the entry. - Spec: 5, 4.4, 21 - Module note: Empty quotes pass: `title: ""` raises no warning and gives the node an empty title. ```ujn @startujn journey J "Journey" view login { title: } @endujn ``` ## timeout-guard-needs-action-timeout `an exit is guarded timeout, but the action has no timeout` - When: An action has an exit guarded exactly `timeout` but no valid `timeout` (none written, not a duration, or on a type it does not apply to). - Why: The `timeout` guard only means something when the action says how long it may take; without it a reader cannot tell when that exit is taken. - How to fix it: Give the action a `timeout` (`timeout: 10 s`) on a type that takes one (action, wait, event, auth), or rename the guard if the exit is not about time running out. - Spec: 14.3, 21 ```ujn @startujn journey J "Journey" action check view slow check --> slow : timeout @endujn ``` ## trace-is-a-list `trace is a list: [req:AUTH-01, test:login.spec.ts]` - When: A `trace` key on the journey, a node or an arrow has no value, or its value opens with `[` and does not close with `]`. - Why: Trace links are read as a list; a bare key or an unclosed bracket gives no links, so the thread from requirement to code is lost. - How to fix it: Write a closed list of `kind:reference` links: `trace: [req:AUTH-01, test:login.spec.ts]`. - Spec: 9.2, 5, 21 ```ujn @startujn journey J "Journey" view login { trace: [req:AUTH-01 } @endujn ``` ## trace-link-is-kind-reference `a trace link is kind:reference, not ` - When: An item of a `trace` list is not `kind:reference`: a lowercase kind, a colon, then the reference with no space after the colon. - Why: Tools sort and follow trace links by their kind (req, test, code and others); a link without one cannot be followed and is dropped. - How to fix it: Put the kind in front of the reference: `trace: [req:AUTH-01]`. - Spec: 9.2, 21 ```ujn @startujn journey J "Journey" view login { trace: [AUTH-01] } @endujn ``` ## traced-node-has-unique-id `has trace links but no unique_id, so other files cannot link back to it` - When: A node has at least one valid trace link (`kind:reference`) but no `unique_id`, neither a value nor `{{auto}}`. - Why: Trace links point out of the diagram; the requirement, test or code they name can link back only through the node's unique id, because the handle and the display id may change. - How to fix it: Add `unique_id: {{auto}}` to the node and run `java -jar plantuml.jar -populate_ids ` to fill it in. - Spec: 7.1, 9.2, 21 ```ujn @startujn journey J "Journey" view a { trace: [req:AUTH-01] } @endujn ``` ## unique-id-is-auto-or-hex `unique_id is neither {{auto}} nor 11 lowercase hex digits` - When: A `unique_id` on a node or on the journey is neither `{{auto}}` nor exactly 11 lowercase hex digits. - Why: A unique id is what tests, code, requirements and other diagrams link to. Only `-populate_ids` makes ids that are random and well formed, so a hand-typed or damaged id may collide or break those links. The value is still kept as written. - How to fix it: Write `unique_id: {{auto}}` and run `java -jar plantuml.jar -populate_ids `, or restore the original id if an existing one was damaged. - Spec: 7.5, 7.1, 21 ```ujn @startujn journey J "Journey" view a { unique_id: 12345 } @endujn ``` ## unique-id-populated-before-commit `unique_id is still {{auto}}. Generate it before your first commit: java -jar plantuml.jar -populate_ids ` - When: A node or the journey still has `unique_id: {{auto}}`, because the file was drawn without `-populate_ids`. is the file that holds the placeholder (an `!include`d file when it came from one), relative to the folder PlantUML runs in when it is inside that folder; it reads `` when there is no source file (`-pipe`). - Why: Until the placeholder is filled, the node has no permanent identity for other files to link to, and every `{{auto}}` must be filled before the file's first commit. The model marks the id as pending (`uniqueId` null, `uniqueIdPending` true). - How to fix it: Run the command the warning prints (`java -jar plantuml.jar -populate_ids `); it writes a generated id over the placeholder in the file. - Spec: 7.1, 7.2, 7.5, 21 ```ujn @startujn journey J "Journey" view a { unique_id: {{auto}} } @endujn ```