Tech

Summer 2024 Anypoint Code Builder Release

Photo of Olga Kepa, MuleSoft Developer Written by Olga Kepa, MuleSoft Developer,   Aug 1, 2024

It’s been some time since my last blog on Anypoint Code Builder, so today, I'll guide you through its most recent changes. The latest release was in June, and to say it was a big one is an understatement!

Here is a list of updates and changes included in the latest release:

  • DataWeave Expression Builder.
  • Component configuration enhancements.
  • Support for multiple Mule runtime versions with Java 17 or 11.
  • Custom Java classes and code.
  • Maven settings.
  • MUnit support.
  • API Governance for REST API.

Today, I'll walk you through the first four features, covering the rest in part two. So stay tuned.

Let’s start with DataWeave Expression Builder.


DataWeave Expression Builder

It is now possible to build expressions using DataWeave using UI, for the components that accept expressions (fx fields). The feature provides panels for:

  • Data – to select a value, 
  • Functions – list of DataWeave functions to be used,
  • Preview – to run the functions on the sample data.

As an example, let's take a look at the ‘Hello World’ project we've used in previous blogs. As demonstrated in the image below, there are the three mentioned panels. From the functions list, I selected function 'upper' which capitalises the supplied string.

Dashboard showing what happens when you choose the 'upper' function in Anypoint Code Builder.

Dashboard showing what happens when you choose the 'upper' function in Anypoint Code Builder.

Now, in the preview panel, we can see the result of the selected function.

Dashboard showing the preview panel.

Dashboard showing the preview panel.

Component configuration enhancements

If we check the UI for the components, we can see two new additions – Input and Output tabs. Using these, we can view Mule event metadata from the payload, attributes, and Mule variables.

Here we can see the Input tab:

Dashboard showing the input tab.

Dashboard showing the Input tab.

And the Output tab:

Dashboard showing the Output tab.

Dashboard showing the Output tab.


Support for multiple Mule runtime versions with Java 17 or 11

Anypoint Code Builder now supports Mule Java 11 and 11 versions and following runtime versions 4.4, 4.6, and 4.7. It is also possible to select runtime and Java versions when creating a project, as seen below:

Example of selecting runtime and Java versions when creating a project.

Example of selecting runtime and Java versions when creating a project.


Custom Java classes and code

The new release includes support for Java code. Now, we have the ability to use Java classes directly from Anypoint Code Builder. To continue with our example, I've created a simple Java class and placed it under src/main/java.

Example of using Java classes directly in Anypoint Code Builder.

Example of using Java classes directly in Anypoint Code Builder.

To use it in our code, I utilised the "Invoke Static" component. The class name was pre-populated, and I selected the function from the drop-down list.

Example of using the "Invoke Static" component.

Example of using the "Invoke Static" component.


Next time

In the next part of this blog, I will cover the remaining three functionalities: Maven Settings, MUnit Support, and API Governance for REST APIs. Stay tuned!


Topics: MuleSoft Tech

We’d love to hear your opinion on this post