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?
Area | Typical examples |
---|---|
Process Engine | BPMN gateways, task listeners, timers |
tQL & Calculations | custom columns, SLA/KPI formulas |
Dynamic Forms | show / hide fields, default values |
Public API hooks | pre‑/post‑processing of requests |
Scripts & Bindings | entity‑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.
Section | What you will find there |
---|---|
Syntax | All core syntax on one page: console shortcuts, literals, operators, flow control, type extensions, context variables. Copy‑and‑paste examples included. |
Connectors | How 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 Clients | The 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. |
Bindings | Wiring scripts to runtime events. Covers entity‑event triggers, script‑to‑script calls, publishing scripts as HTTP endpoints, transaction boundaries and async queuing. |
Built‑in Functions | Alphabetical catalogue of every type extension and #standaloneHelper() shipped with the platform – strings, lists, maps, dates, numbers, UUIDs, JSON, error handling, randomness … |
Spreadsheet API | Working with Excel‑style data in memory: create sheets, rows and cells; style them; serialise to/from JSON; validate models – all from SpEL. |
Examples & Patterns | Full, 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.