logologo
Get Started
Guide
Development
Plugins
API
Home
English
简体中文
日本語
한국어
Español
Português
Deutsch
Français
Русский
Italiano
Türkçe
Українська
Tiếng Việt
Bahasa Indonesia
ไทย
Polski
Nederlands
Čeština
العربية
עברית
हिन्दी
Svenska
Get Started
Guide
Development
Plugins
API
Home
logologo
RunJS Overview
Import Modules
Render in Container

Globals

window
document
navigator

ctx

ctx.blockModel
ctx.collection
ctx.collectionField
ctx.dataSource
ctx.dataSourceManager
ctx.element
ctx.exit()
ctx.exitAll()
ctx.filterManager
ctx.form
ctx.getModel()
ctx.getValue()
ctx.getVar()
ctx.i18n
ctx.importAsync()
ctx.initResource()
ctx.libs
ctx.location
ctx.logger
ctx.makeResource()
ctx.message
ctx.modal
ctx.model
ctx.notification
ctx.off()
ctx.on()
ctx.openView()
ctx.render()
ctx.request()
ctx.requireAsync()
ctx.resource
ctx.route
ctx.router
ctx.setValue()
ctx.sql
ctx.t()
ctx.view
Previous Pagectx.element
Next Pagectx.exitAll()

#ctx.exit()

Terminate the current flow execution. Subsequent steps will not run. Use when conditions are not met, the user cancels, or a non-recoverable error occurs.

You can call it in FlowEngine scripts such as JSField, JSItem, or Action.

#Type definition (simplified)

exit(): never;

Calling ctx.exit() throws an internal FlowExitException, which is caught by the flow engine to stop the current flow. After calling it, remaining statements will not execute.

Related methods:

  • ctx.exit() - terminate the current flow
  • ctx.exitAll() - terminate all flows related to the current event

Tips:

  • Use for pre-checks, permission checks, or user cancel scenarios
  • You can show a message first via ctx.message, ctx.notification, or a modal
  • To stop all flows under the current event, use ctx.exitAll()