Skip to main content

SpEL Introduction

1 What exactly is tSM SpEL?

tSM SpEL is the scripting dialect that powers automation across the Telco Service Management platform. Based on the Spring Expression Language (SpEL) and hardened for multi‑tenant production, it combines:

  • the expressiveness of Java / Kotlin (objects, lambdas, dates, maths),
  • a sandbox that exposes only safe, whitelisted APIs,
  • more than 1 500 service methods that let you query or mutate any tSM entity, and
  • first‑class helpers for JSON, collections, dates, spreadsheets and external calls.

From one‑line conditions to multi‑step data pipelines, SpEL is the single language you use everywhere in tSM.

2 Where will I meet SpEL inside tSM?

AreaTypical examples
Process EngineBPMN gateways, task listeners, timers
tQL & Calculationscustom columns, SLA/KPI formulas
Dynamic Formsshow / hide fields, default values
Public API hookspre‑/post‑processing of requests
Scripts & Bindingsentity‑event triggers, reusable functions

(Open any order or ticket, press ⋯ → SpEL Console, and you are already scripting inside the live context.)

3 Why use SpEL for automation?

  • Context‑aware – variables like #order, #ticket, #currentUser() are injected automatically.
  • Concise yet powerful – collection selectors, JSON parsing, flow‑control DSL and a rich service layer shrink boiler‑plate to a few lines.
  • Uniform – the same syntax drives orchestration, CRM, billing, inventory and integrations, so you learn once and reuse everywhere.
  • Safe – reflection, I/O and class loading are blocked; every script runs in a tenant‑aware sandbox.
  • Live‑debuggable – execute snippets in the console, step through breakpoints and inspect every intermediate value.

4 What comes next – a guided tour of the Spellbook

Below is a quick preview of each chapter so you can jump straight to the part you need.

SectionWhat you will find there
SyntaxAll core syntax on one page: console shortcuts, literals, operators, flow control, type extensions, context variables. Copy‑and‑paste examples included.
ConnectorsHow to talk to the outside world without leaving SpEL: REST, SOAP and SQL clients with retries, authentication, logging and JSON/XML helpers. 30‑second cheat‑sheet + builder reference.
Service ClientsThe SpEL façades around every Public API endpoint. Learn the five client families (CRUD, Filtering, Code‑based, Key‑based, Bulk), identifiers versus business keys, query options and async calls.
BindingsWiring scripts to runtime events. Covers entity‑event triggers, script‑to‑script calls, publishing scripts as HTTP endpoints, transaction boundaries and async queuing.
Built‑in FunctionsAlphabetical catalogue of every type extension and #standaloneHelper() shipped with the platform – strings, lists, maps, dates, numbers, UUIDs, JSON, error handling, randomness …
Spreadsheet APIWorking with Excel‑style data in memory: create sheets, rows and cells; style them; serialise to/from JSON; validate models – all from SpEL.
Examples & PatternsFull, real‑world scripts distilled from production: data enrichment, conditional retries, dynamic provisioning, idempotent integrations, anti‑patterns to avoid.

Read the Quick Reference if you need a fast refresher, or dive into any specialised chapter when building a specific piece of automation.


Happy scripting – and remember: every expression, no matter how small, runs with the full power of the tSM platform behind it.