Skip to main content
Version: 2.4

Scripts & Bindings

The tSM SpEL binding layer connects your scripts to the outside world: from reacting to live platform events to calling one script from another, publishing scripts as HTTP endpoints, or exposing them as AI-callable tools via MCP.


Binding types at a glance

Binding typeTriggerTypical use-casePage
EventsInternal lifecycle event (order created, ticket closed, timer fired …)Automate business logic whenever something happens in the platformEvent Bindings
Script-to-script@script.myPackage.myScript(params)Re-use a SpEL script from inside another scriptScript-to-Script
RESTPOST /scripts/package/my-scriptExpose a script to external systems over HTTPREST Bindings
MCPAI agent tool call via Model Context ProtocolExpose a script as an AI-callable tool with typed inputs & outputsMCP Bindings

Common concepts

paramsFormCode and resultFormCode

Every binding type benefits from the script's parameter and result forms. A tSM Form is simultaneously a JSON Schema (data model) and a UI definition, so a single artefact covers:

  1. Validation — parameters are checked against the schema before execution.
  2. Documentation — field labels, descriptions, and constraints serve as living API docs.
  3. UI / AI contract — the SpEL Console, BPMN modeler, REST consumers, and MCP agents all leverage the same schema.

Transactions

All bindings interact with the tSM transaction model. Understanding when your script runs inside vs. outside a database transaction is critical:

  • Synchronous event bindings run inside the triggering transaction.
  • Async event bindings run after the transaction commits (read-only snapshot).
  • Script-to-script calls share the caller's transaction.
  • REST bindings each get their own transaction.
  • MCP bindings each get their own transaction.

For details, see SpEL and Transactions and the Transactions overview.


Pages in this section