Skip to content

Backend-Scripts

You can develop custom backend scripts that can then be called by request actions. These scripts can be written in Groovy or Kotlin. We do recommend using Kotlin.

ScriptSupport

Insight backend scripts have access to ScriptSupport which offers a variety of useful utilities for everyday scenarios like displaying an error message in the client or refreshing specific records.

You can show error messages. Example:

ScriptSupport.fail("Invalid id: ${id}")

You can tell the client to refresh specific records by listing their paths. Example:

ScriptSupport.refreshPaths(listOf("tree/node/1", "tree/node/2"))

You can tell the client to show a message. Example:

ScriptSupport.showMessage("message")

You can tell the client to show a warning. Example:

ScriptSupport.showWarning("message")

You can tell the client to refresh specific trees. Example:

ScriptSupport.refreshTrees(listOf("tree", "tree"))

You can return a specific json value to the client. Example:

return ScriptSupport.returnValue(mapOf("newId" to id))