DataWeave Extension Library, a powerful tool designed to enhance the DataWeave experience within Visual Studio Code. DataWeave is a domain-specific language (DSL) commonly used for data transformation, enabling conversion between various formats or structures in integration scenarios.
3. Safe Harbour Statement
● Both the speaker and the host are organizing this meet-up in individual capacity only.
We are not representing our companies here.
● This presentation is strictly for learning purposes only. Organizer/Presenter do not
hold any responsibility that same solution will work for your business requirements.
● This presentation is not meant for any promotional activities.
4. Housekeeping
● A recording of this meetup will be uploaded to events page within 24 hours.
● Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab. Make it more
Interactive!!!
● Give us feedback! Rate this meetup session by filling feedback form at the end of the day.
We Love Feedbacks!!! Its Bread & Butter for Meetup.
5. ● Working as Engineering Leader at Tricon Infotech
Private Limited.
● 13+ years of Total Experience.
● 5+ years experience in Mulesoft.
● Certified MuleSoft Developer and Architect.
● MuleSoft Mentor
● Patna MuleSoft Meetup Leader
● Top Contributors of MuleSoft Help Forum
● Founder of DataWeave Fun
Speaker
Shyam Raj Prasad
6. Agenda
● DataWeave
● DataWeave Library Extension
● Development of DataWeave library
● Features of Dataweave Library extension
● Packaging and deployment of DataWeave Library
● Demo
7. ● DataWeave is the programming language designed by MuleSoft for data transformation.
● DataWeave enables you to build a simple solution for a common use case for integration developers:
read and parse data from one format, transform the data, and write it out as a different format.
● For example, a DataWeave script can receive a CSV file as input and transform it into an array of
complex JSON objects, or receive an XML input and write the data out to a flat file format.
DataWeave Language
9. The DataWeave extension to Visual Studio Code enhances productivity when you are building DataWeave
libraries. The extension provides the following capabilities:
● Ability to work on your DataWeave modules and mappings in a standalone manner, outside of a Mule
application.
● Instant execution of your DataWeave mappings, including live preview of data transformations.
● Language support, including autocompletion, navigation, refactoring, formatting, quick fixes, and syntax
highlighting.
● Debugging support for DataWeave mappings.
● Automatic generation of a documentation template that you can use to provide your own DataWeave
library documentation in Exchange.
● An embedded DataWeave Maven plugin with the following features:
○ Integration of packaging and deployment of your DataWeave libraries with your Maven lifecycle.
○ Integration with Exchange to share and consume DataWeave libraries.
● An embedded DataWeave testing framework that enables you to build automated unit and integration
tests easily.
DataWeave Library Extension
10. Requirements
● Java 8 or 11 provided
● Apache Maven (3.6.3 minimum)
● Microsoft Visual Studio Code for your specific operating system
● DataWeave 2.0 (BETA) library in VS code (Extensions tab)
11. Developing DataWeave Libraries
A DataWeave library is a reusable package of DataWeave module and mapping files, and
resource files, such as JSON, XML, and CSV. To develop DataWeave libraries, first create
a new DataWeave project in Visual Studio Code where you then create, preview, and test
custom mappings and modules.
If you want to try out your mapping without creating a DataWeave project, you can either
open your .dwl mapping file directly in Visual Studio Code or create a new one and use
sample data and scenarios.
12. DataWeave Modules and Mapping
● Dataweave modules can define functions, variables, types, and namespaces. You can import
these modules into a DataWeave script to use the features.
● Dataweave module cannot contain an output directive, body expression, or the separator (---)
between header and body sections.
● Dataweave mapping files are a type of module that contains a complete DataWeave script
that you can import and use in another DataWeave script or reference in a Mule component.
13. Understanding the DataWeave
Project Structure
DataWeave projects use Apache Maven to build and declare project dependencies. The following
diagram shows the DataWeave project structure:
19. Packaging and Deploying DataWeave
Libraries
Apache Maven plugin for DataWeave to integrate the packaging and deployment of your
DataWeave libraries with your Maven lifecycle. The plugin enables you to run six main
goals:
● compile Compiles the source code for your DataWeave library.
● test Tests the compiled source code using the DataWeave testing framework.
● data-weave:generate-docs Automatically generates the documentation for your
DataWeave library.
● package : Packages the compiled code in a .jar file.
● data-weave:deploy-docs :Uploads the auto-generated documentation for your
DataWeave library to Anypoint Exchange.
● deploy :Automatically uploads your DataWeave library to the deployment target and
uploads the auto-generated documentation to Exchange.
22. Take a stand !
●Nominate yourself for the next meetup speaker and suggest a topic as well.
23. Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Invite your network to join: https://meetups.mulesoft.com/calicut
Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the
program
What’s next?