goto
Jump to a label within the current section, optionally based on a condition.
The goto method will only navigate to a label within the same section.
Properties
goto
An object that accepts the following properties.
goto.label
The label in section to jump to. It must match a label defined with the label method.
A SWML variable reference is resolved when the goto runs.
goto.when
A JavaScript condition that determines whether to perform the jump. If the condition evaluates to true, the jump is executed. If omitted, the jump is unconditional.
goto.max
The maximum number of times to jump, from the minimum of 1 to max 100 jumps. Accepts an integer or a SWML variable
reference (for example, ${vars.max_retries}) that resolves to a jump count in that range.
The jump count belongs to the target label: every goto in the current execution that jumps to the same label adds to that
count, and each goto compares its own max against it. Once the count reaches max, the jump is skipped and execution
continues with the next method.