-
Notifications
You must be signed in to change notification settings - Fork 7
[Feature] Script Task Virtual Documents with Language Support & AI Writeback #860
Copy link
Copy link
Open
Labels
featureNew feature or requestNew feature or request
Description
Motivation
When editing script tasks in the BPMN properties panel, users are limited to a small text area without syntax highlighting, IntelliSense, or AI assistant support. This makes writing and maintaining non-trivial scripts painful — especially for Camunda 7 projects that rely on inline Groovy or JavaScript.
Feature Description
Virtual Documents via FileSystemProvider
When a user selects a scripting language on a script task and clicks an "Open in Editor" button, the extension opens a virtual document (bpmn-script://<taskId>/script.<ext>) in a full VS Code editor tab. Using FileSystemProvider (not TextDocumentContentProvider) ensures the document is writable, so:
- Users get full syntax highlighting and IntelliSense
- AI coding assistants (e.g. Claude in VS Code) can read and write the document
- Edits are synced back to the
<script>element in the BPMN XML automatically
Autocompletion for Camunda 7 APIs
Provide autocompletion for the Camunda execution context (execution, task, connector) across supported script languages:
| Language | Approach |
|---|---|
| JavaScript | .d.ts type declaration stubs — full IntelliSense out of the box |
| Python (Jython) | .pyi stub files — picked up by Pylance automatically |
| Groovy | Custom CompletionItemProvider scoped to bpmn-script scheme |
| Ruby (JRuby) | Custom CompletionItemProvider (lower priority) |
| JUEL | Custom CompletionItemProvider (lower priority) |
Phased Rollout
Phase 1 — Virtual Documents + JS/Python stubs (high value, low effort)
- Implement
FileSystemProviderforbpmn-script://URI scheme - Ship
.d.tsstubs for the Camunda 7 execution context (e.g.execution.getVariable(),task.getAssignee()) - Ship
.pyistubs for Python/Jython equivalent - Map BPMN properties panel language selection → VS Code
languageId - Sync virtual document edits back to BPMN XML
<script>content
Phase 2 — Groovy autocompletion
- Register a
CompletionItemProviderfor Groovy scoped to thebpmn-scriptscheme - Cover
execution.*,task.*, andconnector.*API surfaces
Phase 3 — Ruby / JUEL (lower priority)
- Same
CompletionItemProviderpattern for remaining languages
Acceptance Criteria
-
FileSystemProviderregistered forbpmn-script://scheme; virtual documents are read/write - Opening a script task in the editor sets the correct
languageIdbased on the selected script language - Edits in the virtual document are synced back to the BPMN XML model
- JavaScript
.d.tsstubs provide IntelliSense forexecution,task, andconnectorobjects - Python
.pyistubs provide equivalent autocompletion via Pylance - AI tools (e.g. Claude for VS Code) can read and edit virtual script documents
- Groovy
CompletionItemProvideroffers completions forexecution.*methods
References
- Design doc:
docs/features/advanced-scripting.md - Camunda 7 scripting docs: https://docs.camunda.org/manual/7.22/user-guide/process-engine/scripting/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request