1. Mar 3, 2023 4:00 PM IST
Bangalore MuleSoft Meetup
Group Present’s # 20
DataWeave Extension Library
2. Organizer
About:
● Mulesoft Meetup Leader
● Working as MuleSoft Developer & Administrator @
Salesforce.
● 5+ years of Experience.
● Certified MuleSoft Developer and Architect.
● Bangalore and Hyderabad Meetup Leader
Bharath Kumar NJ,
AMTS, Salesforce
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.
3
4. A recording of this meetup will be uploaded to events page within 72 hours.
Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab.
Make it more Interactive!!!
Share us the feedback! Rate this meetup session by filling feedback form at the end of the day.
We Love Feedbacks !!
Housekeeping
4
5. About the Speaker :
Introductions
Shyam Raj Prasad,
Senior Principal Engineer,
Tricon Infotech Private Limited
5
● Working as Senior Principal Engineer 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
7. ● DataWeave is the functional 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
8. 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
9. 9
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)
10. 10
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.
11. 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.
11
12. 12
Understanding the DataWeave Project
Structure
DataWeave projects use Apache Maven to build and declare project dependencies. The following
diagram shows the DataWeave project structure:
18. 18
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.
21. Take a stand !
21
●Nominate yourself for the next meetup speaker
https://sfdc.co/hyd-meetup-nomination
22. 22
● Share:
○ Tweet using the hashtag #MuleSoftMeetups #MuleSoftCommunity
○ Join Bangalore Group: https://meetups.mulesoft.com/bangalore
● 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?