Script Editor
Edit Groovy and JavaScript scripts inside iFlows directly from your browser — no SAP Web IDE needed.
Opening the Editor
From the Assets tab, click the pencil icon next to any iFlow, or right-click → Edit Scripts. The editor opens in a full-screen panel showing all scripts inside that iFlow.
Browsing Scripts
The left panel lists all script files found inside the iFlow archive:
.groovy— Groovy scripts (most common).js— JavaScript scripts.xsl/.xslt— XSLT mappings- Click any file to load it into the editor
Editing and Saving
The editor is a full Monaco editor (same as VS Code) with syntax highlighting for Groovy and JavaScript.
- Cmd/Ctrl + S — save the current file back into the iFlow zip on the CPI server
- Save & Deploy button — saves and immediately triggers a redeploy of the iFlow
- Changes are saved to the design-time artifact only — use Deploy to push them to runtime
⚠ Important: Saving a script modifies the iFlow artifact on CPI. The running runtime version is unchanged until you click Deploy. Always test in a non-production tenant first.
Linting
CPI Studio includes a comprehensive lint engine with 25+ rules. Groovy scripts are checked by three dedicated rule sets that run automatically when you lint an iFlow:
- Forbidden APIs (Security) — Flags
System.exit(),Runtime.getRuntime(),new File(),ProcessBuilder, and.exec()which are blocked in the CPI sandbox - Best Practices (Guidelines) — Detects
Thread.sleep(),printStackTrace(), empty catch blocks, and hardcoded URLs - Syntax Checks (Guidelines) — Unmatched braces/parentheses and unclosed multi-line comments
The linter scans all .groovy and .gsh files in the iFlow and reports exactly how many files were checked, so you can confirm full coverage.
Contextual Toolbar
When you open a file in the editor, the toolbar shows context-sensitive buttons based on the file type:
- XML / IFLW files: Format XML, Validate XML
- XSL / XSLT files: Format XML, Validate XML, Test XSLT (inline simulator)
AI Script Assistant (Pro/Enterprise)
With an OpenAI API key configured, the editor shows an ✨ Ask AI button. You can:
- Ask the AI to explain what the current script does
- Ask it to refactor for readability or performance
- Describe a requirement in plain English and let AI generate the Groovy code
- Ask it to fix a specific error from the message log
See AI Assistant for full details.
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Cmd/Ctrl + S | Save current file |
| Cmd/Ctrl + Shift + P | Command palette |
| Cmd/Ctrl + F | Find in file |
| Cmd/Ctrl + Shift + F | Find across all scripts |
| Alt + Shift + F | Format document |
| Cmd/Ctrl + Z | Undo |