DataWeave: Working with literal types

Literal types will let you define a type as an enumeration of possible values. This is useful in the use cases when a variable or function call can only take one out of a small set of possible values, for example, like days in a week (Saturday, Sunday, etc.) or HTTP request methods (GET, POST, DELETE, etc.). 

DataWeave: Taking advantage of the type system

The type system can help you save time preventing errors, find quickly the function you need, instead of looking for it in the documentation, and let you code using types to define different behaviors for functions. In this post, I’ll show you how the DataWeave type system can help you develop in a more efficient and clear way.

Streamlining the development experience with Studio 7.7

October 30 2020

1 comment.

I am happy to announce our new release of Anypoint Studio 7.7 is now available. Our goal with every new Anypoint Studio release is to further improve and streamline the API and integration development process for our MuleSoft devs. This means making it faster to build, with more powerful and more intuitive tooling. This release includes a new perspective for inspecting input and output payloads when using DataWeave, the ability to natively create API specifications in Studio,

Updating fields with DataWeave made easy: The update operator

This new operator has been called the best thing to happen to DataWeave since sliced bread. It is the result of extensive work with our users on their day-to-day needs. In this blog post, you’ll see first hand how DataWeave scripts can be simplified in 4.3.0 by taking advantage of the latest feature to change field values.

How to be a matchmaker using DataWeave and regular expressions

In this blog, we’ll look at how a regular expression (regex) can give you the power to transform text in your DataWeave programming. When you need to select, replace, remove, or transform text, you can define a regex pattern to define what you want to match, and perhaps one that defines what you’d like to provide as a substitute.

How to review concatenation functions in DataWeave 2.0

Contrary to what most developers believe, there are different ways to achieve concatenation in DataWeave 2.0 for several data types. While the most popular function to achieve this is by using the plus plus (++) function, it is not the only way to concatenate data types. Before taking the Anypoint Platform Development: DataWeave (Mule 4) training, I used the ++ (plus plus) function to concatenate data types like arrays, strings,

How to untie multilevel structures with DataWeave recursive calls

August 10 2020


It’s rare for developers to work with flat data structures — instead we often work with multilevel data structures. Normally, XML uses multiple layers of hierarchy. We need to perform changes on all the levels, without knowing how deep into the hierarchy we need to process the entire structure.

Developers typically use recursive calls to solve these types of problems. In this blog post, we will see how to implement simple recursive calls using DataWeave.

How to create reusable DataWeave scripts for healthcare acceleration

Tyler Haigh, DevOps Engineer at New South Wales Health Pathology (NSWHP), spoke at our MuleSoft CONNECT Digital event in APAC. He has more than four years of experience using Anypoint Platform. Recently, his projects focused on creating reusable DataWeave scripts for healthcare acceleration at NSWHP. In this blog, he shares how he uses DataWeave and MUnit testing to improve NSWHP healthcare messaging systems and patient experience. 

How to write curried functions in DataWeave

One of the most valuable characteristics of DataWeave is that it is a functional programming language. This means it is dynamically able to solve problems with various approaches — one being currying, which is a common feature of functional programming languages like Haskel (from where it derives), and JavaScript. 

In this post, I’ll explain what currying is and how to write curried functions in DataWeave.

Understanding “big-O complexity” in DataWeave

Sometimes developers face optimization challenges in their code — regardless of the programming language they use. One of the most common optimization challenges is the complexity (or performance) of an algorithm that increases and grows infinitely when the number of arguments it has to process increases. This is called big-O complexity or big-O notation.

In this blog post, you’ll learn how to perform DataWeave code optimization to improve performance by following the big-O notation principles.