Dataweave Playground Sans Docker
New tooling for transforming metadata leverages and improves your Dataweave skills.
Join the DZone community and get the full member experience.Join For Free
The DataWeave Playground is an integrated development environment that enables you to experiment with complex Mappings and Transformations outside of AnypointStudio. When we first looked at the Playground, a creation of Mariano De Achaval and the Mulesoft Dataweave team, it was an experimental version running inside of a Docker container. While still a work in progress, through the magic of GraalVM, the Playground runs sans Docker, as a binary on Mac, Linux and Windows.
In my earlier article Transformative Moments we started in the middle of the story, showing you how to get immediate value from the DataWeave Command Line interface (DW CLI). We went on to learn how to create Command Line Services which created information pipelines from data source to sink. Now we'll rewind to the beginning of the story to talk about the most important piece of all, the DataWeave Playground.
We'll begin by creating the DW CLI folder and the environment settings which are needed. To make these changes permanent you can add them to your path in the Windows environment dialog settings or to the .bashrc file in your Linux HOME directory.
Download the DW CLI Runtime
In the environment settings above we configured the location for the DW CLI runtime onto your path. Download the runtime from the DW CLI Github repository. The Zip files are located in the Manually paragraph.
After you unzip the download, install the bin and libs folders into the .dw folder you created in the Initial Configurations section above.
Running the DW Playground
After you've completed the download and install, we can take a look at the most prominent part of the DW CLI, the Playground. You can refer to the articles above for more information on the wizardry you can unleash with the DW CLI. Our focus here will be on the Playground.
The first time you invoke the Playground it fetches the code from the Git repository, installs it into your .dw folder and runs the Playground. When the Playground starts you can open it using your browser, it listens on Port 8082.
The IDE should be familiar and intuitive, with your Input sources of information on the left, scripting in the middle and the output on the right.
Clicking on the default input type allows you to change to another type such as XML or CSV.
You can open the DW API reference from the button bar at the bottom and the Log Viewer as well.
In the top right you can change the language level to conform with the runtime version you'll be working with.
You can find plenty of examples to try out in the Playground in the DataWeave Cookbook. This should give you enough to get going and improve your skills with DataWeave. If you enjoy the Playground be sure to give it a Star!
Opinions expressed by DZone contributors are their own.