A local, version-controlled alternative to the MuleSoft DataWeave Playground - develop, test, and share DataWeave transformations offline.
| Feature | Online Playground | This Project |
|---|---|---|
🔌 Offline Development |
❌ |
✅ |
📂 Version Control (Git) |
❌ |
✅ |
🤖 AI (Copilot, Claude, Antigravity, etc) |
❌ |
✅ |
🔄 CI/CD Integration |
❌ |
✅ |
💻 Full IDE Support |
❌ |
✅ |
📦 Reusable Module Libraries |
❌ |
✅ |
🏢 Enterprise Formats (Excel, FlatFile, Avro) |
❌ |
✅ |
🚀 Publish to Exchange |
❌ |
✅ |
🧪 Automated Unit Testing |
❌ |
✅ |
⚡ Quick Experimentation |
✅ |
✅ |
🛠️ Custom Module Creation |
✅ |
✅ |
🎮 Mimics Online Playground Experience |
✅ |
✅ |
🆓 Free and Open Source |
✅ |
✅ |
playground/
|-- pom.xml
|-- README.md
|-- README.adoc
`-- src/
|-- main/
| |-- dw/
| | |-- DateFormatConversionModule.dwl
| | |-- Mule.dwl
| | `-- main.dwl
| `-- resources/
| `-- properties.yaml
`-- test/
|-- dw/
| `-- DateFormatConversionModuleTest.dwl
`-- resources/
|-- DateFormatConverstionModuleMapping/
| `-- Playground/inputs/payload.json
`-- main/
`-- Playground/inputs/
|-- attributes.dwl
|-- correlationId.dwl
|-- error.dwl
|-- payload.dwl
`-- vars.dwlThis repository currently uses src/main/dw/main.dwl as the closest equivalent to the online DataWeave playground.
| Online Playground | Local Project |
|---|---|
Main Editor Panel |
|
Reusable snippets |
|
Input Panel |
|
Output Panel |
DataWeave: Run Preview or Maven test output |
-
Edit
src/main/dw/main.dwlfor quick experiments. -
Use
Mule::p(…)fromMule.dwlwhen you need mock property access. -
Move reusable logic into dedicated modules under
src/main/dw/. -
Add assertion-based tests under
src/test/dw/when logic needs regression coverage.
Location: src/main/dw/DateFormatConversionModule.dwl
Utilities for date and time formatting conversions.
link:src/main/dw/DateFormatConversionModule.dwl[role=include]Location: src/main/dw/Mule.dwl
Utilities for Mule runtime property access simulation.
link:src/main/dw/Mule.dwl[role=include]This project currently supports two complementary workflows.
Use src/main/dw/main.dwl together with the fixtures in src/test/resources/main/Playground/inputs/.
link:src/test/resources/main/Playground/inputs/payload.dwl[role=include]link:src/test/resources/main/Playground/inputs/attributes.dwl[role=include]link:src/test/resources/main/Playground/inputs/vars.dwl[role=include]link:src/test/resources/main/Playground/inputs/error.dwl[role=include]link:src/test/resources/main/Playground/inputs/correlationId.dwl[role=include]The Anypoint Code Builder extension for VS Code provides real-time preview capabilities for DataWeave mappings.
-
📄 Input files under
src/test/resources/main/Playground/inputs/
%dw 2.0
output application/json
---
payload.users map (user) -> {
fullName: user.firstName ++ " " ++ user.lastName,
email: lower(user.email)
}%dw 2.0
import dateTimeConversion from DateFormatConversionModule
output application/json
---
{
timestamp: dateTimeConversion(now(), "yyyy-MM-dd'T'HH:mm:ss"),
readable: dateTimeConversion(now(), "MMMM dd, yyyy")
}%dw 2.9
// src/main/dw/StringUtilsModule.dwl
fun titleCase(text: String): String =
text splitBy " "
map (word) -> upper(word[0]) ++ lower(word[1 to -1])
joinBy " "
fun removeWhitespace(text: String): String =
text replace /\s+/ with ""%dw 2.0
// src/test/dw/StringUtilsMapping.dwl
import * from StringUtilsModule
output application/json
---
{
titleCaseResult: titleCase("hello world"),
noWhitespace: removeWhitespace("hello world")
}/**
* Brief description of what the function does.
*/
fun myFunction(param: Type): ReturnType = ...Share your modules with others by publishing to Anypoint Exchange.
-
Anypoint Platform account with Exchange contributor permissions
-
Configure credentials in
~/.m2/settings.xml
<server>
<id>exchange</id>
<username>your-username</username>
<password>your-password</password>
</server>Replace the placeholder organization id in pom.xml, then uncomment the Exchange configuration.
link:pom.xml[role=include]-
🍴 Fork the repository
-
🌿 Create a feature branch (
git checkout -b feature/amazing-module) -
💾 Commit your changes (
git commit -m 'Add amazing module') -
📤 Push to the branch (
git push origin feature/amazing-module) -
🔃 Open a Pull Request