Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MuleSoft for Salesforce Developers

You're reading from   MuleSoft for Salesforce Developers A practitioner's guide to deploying MuleSoft APIs and integrations for Salesforce enterprise solutions

Arrow left icon
Product type Paperback
Published in Sep 2022
Publisher Packt
ISBN-13 9781801079600
Length 490 pages
Edition 1st Edition
Arrow right icon
Authors (3):
Arrow left icon
Arul Christhuraj Alphonse Arul Christhuraj Alphonse
Author Profile Icon Arul Christhuraj Alphonse
Arul Christhuraj Alphonse
Alexandra Martinez Alexandra Martinez
Author Profile Icon Alexandra Martinez
Alexandra Martinez
Akshata Sawant Akshata Sawant
Author Profile Icon Akshata Sawant
Akshata Sawant
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Part 1:Getting Started with MuleSoft
2. Chapter 1: Introduction to APIs and MuleSoft FREE CHAPTER 3. Chapter 2: Designing Your API 4. Chapter 3: Exploring Anypoint Studio 5. Chapter 4: Introduction to Core Components 6. Chapter 5: All About Anypoint Platform 7. Part 2: A Deep Dive into MuleSoft
8. Chapter 6: Learning DataWeave 9. Chapter 7: Transforming with DataWeave 10. Chapter 8: Building Your Mule Application 11. Chapter 9: Deploying Your Application 12. Chapter 10: Secure Your API 13. Chapter 11: Testing Your Application 14. Part 3: Integration with Salesforce and Other Connectors
15. Chapter 12: MuleSoft Integration with Salesforce 16. Chapter 13: MuleSoft Connectors and Use Cases 17. Chapter 14: Best Practices, Tips, and Tricks 18. Chapter 15: Certification and Interview Tips 19. Index 20. Other Books You May Enjoy

Understanding modules in DataWeave

Some programming languages make use of libraries to import functions or methods from other pieces of code. This is helpful to reuse complex functionality that was written by someone else instead of trying to reinvent the wheel and wasting precious development time while trying to develop the code yourself. In DataWeave, these libraries of code are called modules. You can either use other existing DataWeave modules or create your own custom modules, which we will see later in Using the Transform Message component in Anypoint Studio section.

Let’s see the syntax to import these modules in DataWeave.

Importing modules and functions

There are several ways of importing modules or functions to your DataWeave scripts, depending on your preference. But all of them make use of the import keyword and must be located within the header of your script. Let’s see some examples:

  • Import the whole module: You can import the whole module...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime