---
schema_version: "1"
id: 51c33eba01f7bf76d23b82ef38657c75b07889ef9c3bfcbc0c03c7e0d26cc473
title: DataWeave 2.4.0 Release Notes
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/release-notes/dataweave/dataweave-2.4.0-release-notes.md
canonical_url: https://docs.mulesoft.com/release-notes/dataweave/dataweave-2.4.0-release-notes
source_site: docs.mulesoft.com
content_type: documentation
content_hash: ca9c088e8cc5ded5ee27e6394c84878b28c44580b0a4e1b69004546cd0a51bd1
description: MuleSoft Documentation Site
latest: true
---
---
product: Release Notes
version: master
---

# DataWeave 2.4.0 Release Notes

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## July 2024

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>Unicode characters now render correctly at the beginning of the string when using the DataWeave writer function with the <code>onlyData</code> flag enabled.</p></div></div></td><td><div><div><p>W-14855645</p></div></div></td></tr><tr><td><div><div><p>The Apache POI library is now upgraded.</p></div></div></td><td><div><div><p>W-18253747</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## June 2024

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>A memory leak of the binding context no longer occurs when using the <code>foreach</code> scope.</p></div></div></td><td><div><div><p>W-18472194</p></div></div></td></tr><tr><td><div><div><p>DataWeave now correctly parses unquoted strings without raising a format error.</p></div></div></td><td><div><div><p>W-18118138</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## November 2024

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>Apache POI folder used for temporal files is no longer deleted.</p></div></div></td><td><div><div><p>W-16899674</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## September 2024

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>DataWeave now preserves MimeType properties correctly.</p></div></div></td><td><div><div><p>W-16161736</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## July 2024

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>The Flat File module now adds the <code>substituteCharacterAsMissingValue</code> reader property.</p></div></div></td><td><div><div><p>W-15571377</p></div></div></td></tr><tr><td><div><div><p>The Flat File module now adds the <code>fillRedefinesByMaxLength</code> writer property.</p></div></div></td><td><div><div><p>W-15973636</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## June 2024

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>A <code>java.io.IOException</code> exception no longer occurs when writing the same binary input multiple times for JSON and XML formats.</p></div></div></td><td><div><div><p>W-14589732</p></div></div></td></tr><tr><td><div><div><p>The Excel writer now generates XLSX files using ZIP specification 2.0.</p></div></div></td><td><div><div><p>W-15534640</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## May 2024

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>Internal libraries are now upgraded.</p></div></div></td><td><div><div><p>W-15296551</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## April 2024

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>The Excel reader no longer reads furigana characters.</p></div></div></td><td><div><div><p>W-14991276</p></div></div></td></tr><tr><td><div><div><p>Coercion of the third parameter on the ternary function executor now works as expected.</p></div></div></td><td><div><div><p>W-15061008</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## February 2024

### Patch 2.4.0-20240119-20240215

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>Performance is now improved when coercing addition and subtraction operations.</p></div></div></td><td><div><div><p>W-14927555</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

### Patch 2.4.0-20240119

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>Caching now works correctly when coercing for addition and subtraction operations.</p></div></div></td><td><div><div><p>W-14591653</p></div></div></td></tr><tr><td><div><div><p><code>do</code> scope declarations with pattern matching now properly reflect variable names when variables are optimized with common subexpression elimination.</p></div></div></td><td><div><div><p>W-14514837</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## November 2023

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>The cached function coercion now works correctly for a second time when an argument is constant.</p></div></div></td><td><div><div><p>W-13763138</p></div></div></td></tr><tr><td><div><div><p>The DataWeave <code>sum</code> function with a single numeric string arg now returns <code>Number</code> type instead of <code>String</code>.</p></div></div></td><td><div><div><p>W-14086694</p></div></div></td></tr><tr><td><div><div><p>Reading Avro schema with an array of <code>enum</code> type items no longer returns an error.</p></div></div></td><td><div><div><p>W-14252745</p></div></div></td></tr><tr><td><div><div><p>Inconsistent XML encoding detection no longer occurs between indexed and in-memory parsers.</p></div></div></td><td><div><div><p>W-13805995</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## October 2023

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>System property <code>com.mulesoft.dw.xml_writer.declareXmlNamespace</code> has been included to manage adding implicit namespaces like <code>xml</code> in the XML writer.</p></div></div></td><td><div><div><p>W-11965399</p></div></div></td></tr><tr><td><div><div><p>Temporary files are now closed for inputs bigger than 1.5 MB.</p></div></div></td><td><div><div><p>W-13868202</p></div></div></td></tr><tr><td><div><div><p>Milliseconds information is now preserved when converting the <code>java.util.Date</code> type.</p></div></div></td><td><div><div><p>W-14002706</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## September 2023

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>An invalid UUID logical type in Avro module now throws an exception as expected.</p></div></div></td><td><div><div><p>W-13943112</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## July 2023

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>Multipart reader performance is enhanced by using the proper input stream implementation.</p></div></div></td><td><div><div><p>W-13099773</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## June 2023

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>Streaming support now works correctly for JSON.</p></div></div></td><td><div><div><p>W-11790958</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## May 2023

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>Closing resources immediately after reading when using <code>text/plain</code> MIME type.</p></div></div></td><td><div><div><p>W-12398584</p></div></div></td></tr><tr><td><div><div><p>Incorrect trimming of whitespaces no longer occurs when reading XML content.</p></div></div></td><td><div><div><p>W-12528980</p></div></div></td></tr><tr><td><div><div><p>Fixed <code>splitBy</code> management of large strings so <code>String</code> and <code>Regex</code> options are consistent with each other.</p></div></div></td><td><div><div><p>W-12452407</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## April 2023

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>Added cache Java values evaluation to avoid consuming streams more than once.</p></div></div></td><td><div><div><p>W-12635909</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## March 2023

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>Fixed <code>IndexOutOfBoundsException</code> that occurred when combining the usage of heap memory for internal buffering with a customized buffer size.</p></div></div></td><td><div><div><p>W-12247447</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## February 2023

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p><code>dw::core::Dates::atBeginningOfWeek</code> now works correctly when the input <code>DateTime</code> is Sunday.</p></div></div></td><td><div><div><p>W-11940166</p></div></div></td></tr><tr><td><div><div><p>The new <code>com.mulesoft.dw.javaSqlDateToDate</code> system property enables mapping <code>java.sql.Date</code> to <code>Date</code> instead of <code>DateTime</code>.</p></div></div></td><td><div><div><p>W-12043162</p></div></div></td></tr><tr><td><div><div><p>The <em>Resource already closed</em> exception no longer occurs when using the write function with a value bigger than 1.5MB with Avro format.</p></div></div></td><td><div><div><p>W-12067821</p></div></div></td></tr><tr><td><div><div><p>Cacheable overloaded functions, such as <code>then</code>, now dispatch to the correct function definition when called multiple times.</p></div></div></td><td><div><div><p>W-12073562</p></div></div></td></tr><tr><td><div><div><p>The <code>default</code> behavior now works correctly when having a null value coming from the Mule runtime.</p></div></div></td><td><div><div><p>W-12166609</p></div></div></td></tr><tr><td><div><div><p>High memory usage no longer occurs when using the <code>dw::core::Arrays::divideBy</code> function with an in-memory Array as input.</p></div></div></td><td><div><div><p>W-12167313</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## January 2023

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p>The function <code>dw::core::Dates::atBeginningOfHour</code> now works as expected when an hour is represented as a single digit.</p></div></div></td><td><div><div><p>W-11620156</p></div></div></td></tr><tr><td><div><div><p>Escaped quote characters now work as expected in CSV Module.</p></div></div></td><td><div><div><p>W-12128349</p></div></div></td></tr><tr><td><div><div><p>The FlatFile module now provides a reader property, <code>retainEmptyStringFieldsOnParsing</code>, for handling fields that lack values. When set to <code>true</code>, this property makes the reader retain these fields and set their values to an empty string. The default behavior of the reader is to remove those fields.</p></div></div></td><td><div><div><p>W-12036336</p></div></div></td></tr><tr><td><div><div><p>Data payloads without line breaks no longer work when using <code>lenient</code> as the <code>recordParsing</code> property. The other options to <code>recordParsing</code> support records that lack line breaks. <code>noTerminator</code> is preferred for fixed-length records that lack a line break.</p></div></div></td><td><div><div><p>W-12472890</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## November 2022

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Issue Resolution</th><th>ID</th></tr></thead><tbody><tr><td><div><div><p><code>onNull</code> functions now work as expected.</p></div></div></td><td><div><div><p>W-11865849</p></div></div></td></tr><tr><td><div><div><p>Instead of returning an empty array in some scenarios, iterating flat file arrays now work as expected.</p></div></div></td><td><div><div><p>W-11932440</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## September 2022

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Description</th><th>Issue</th></tr></thead><tbody><tr><td><div><div><p>Visual Studio Code extension no longer breaks with binary input format in the test scenario inputs directory.</p></div></div></td><td><div><div><p>W-11507190</p></div></div></td></tr><tr><td><div><div><p>Namespace is now added on elements when previously used at a deeper structure level.</p></div></div></td><td><div><div><p>W-11349764</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## August 2022

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The August Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Description</th><th>Issue</th></tr></thead><tbody><tr><td><div><div><p>The message for the <code>StackOverflow</code> script compilation error is no longer hidden.</p></div></div></td><td><div><div><p>W-11215958</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## July 2022

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The July Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Description</th><th>Issue</th></tr></thead><tbody><tr><td><div><div><p>Writing binary values with the JSON writer no longer outputs the base of the values.</p></div></div></td><td><div><div><p>W-11326859</p></div></div></td></tr><tr><td><div><div><p>This release fixes Avro property handling.</p></div></div></td><td><div><div><p>W-11324418</p></div></div></td></tr><tr><td><div><div><p>This release improves handling of streams that do not declare a size.</p></div></div></td><td><div><div><p>W-11277575</p></div></div></td></tr><tr><td><div><div><p>Fix <code>write</code> function so Avro format can be handled.</p></div></div></td><td><div><div><p>W-11047202</p></div></div></td></tr><tr><td><div><div><p>This release improves handling of string values in XML format.</p></div></div></td><td><div><div><p>W-11273037</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## June 2022

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The June Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Description</th><th>Issue</th></tr></thead><tbody><tr><td><div><div><p>DataWeave now parses Java objects without errors.</p></div></div></td><td><div><div><p>W-10832766</p></div></div></td></tr><tr><td><div><div><p>The <code>text/plain</code> reader now correctly ignores the byte order mark (BOM). The JSON writer now uses the encoding information available in Binary values when writing them as String values instead of using the writer configuration encoding. To restore the previous behavior, enable the system property <code>com.mulesoft.dw.decode_binaries_with_writer_encoding</code>.</p></div></div></td><td><div><div><p>W-10696255</p></div></div></td></tr><tr><td><div><div><p>Multiline string indentation on YAML now works correctly.</p></div></div></td><td><div><div><p>W-10955882</p></div></div></td></tr><tr><td><div><div><p>The FlatFile module now includes the <code>allowLenientWithBinaryNotEndElement</code> property to support existing behavior.</p></div></div></td><td><div><div><p>W-10935528</p></div></div></td></tr><tr><td><div><div><p>Fixed <code>ClassCastException</code> in multipart module.</p></div></div></td><td><div><div><p>W-10943884</p></div></div></td></tr><tr><td><div><div><p>DataWeave now shows a descriptive error when there is an unsupported output mime type.</p></div></div></td><td><div><div><p>W-10876534</p></div></div></td></tr><tr><td><div><div><p>The indexed XML reader no longer adds unnecessary text fields to XML objects.</p></div></div></td><td><div><div><p>W-10942171</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## March 2022

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The March Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Description</th><th>Issue</th></tr></thead><tbody><tr><td><div><div><p>A direct memory error no longer occurs when the <code>com.mulesoft.dw.directbuffer.disable</code> system property is enabled.</p></div></div></td><td><div><div><p>SE-24186</p></div></div></td></tr><tr><td><div><div><p>Duplicate declarations for namespace prefixes in XML no longer occur.</p></div></div></td><td><div><div><p>W-10648792 / DW-1081</p></div></div></td></tr><tr><td><div><div><p>Exceptions are no longer thrown due to use of the <code>default</code> operator with <code>fromBase64</code>.</p></div></div></td><td><div><div><p>W-10648825 / SE-23812</p></div></div></td></tr><tr><td><div><div><p>Avro unions with enums are now supported.</p></div></div></td><td><div><div><p>W-10706991</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## February 2022

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The February Mule patch release addresses
the following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Description</th><th>Issue</th></tr></thead><tbody><tr><td><div><div><p>An endless loop issue no longer occurs when writing a CSV file with <code>bufferSize=0</code>.</p></div></div></td><td><div><div><p>DW-1074</p></div></div></td></tr><tr><td><div><div><p>Creating sample files using the <code>binary</code> type no longer causes an error.</p></div></div></td><td><div><div><p>DW-390</p></div></div></td></tr><tr><td><div><div><p>Corrected the documentation of the`Periods::between` function.</p></div></div></td><td><div><div><p>DW-1070</p></div></div></td></tr><tr><td><div><div><p>Upgraded some dependencies, including avro and jackson, and removed unused AWS dependencies (#1673).</p></div></div></td><td><div><div><p>DW-1080</p></div></div></td></tr><tr><td><div><div><p>Upgraded the <code>edi-parser</code> with SLF4J.</p></div></div></td><td><div><div><p>CONN-9598</p></div></div></td></tr><tr><td><div><div><p>Performing transformations from avro to other formats no longer causes an exception when the <code>enum</code> type field is present.</p></div></div></td><td><div><div><p>SE-23802</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## January 2022

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The January Mule patch release addresses the
following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Description</th><th>Issue</th></tr></thead><tbody><tr><td><div><div><p>Flow retyping inside dynamic functions now works as expected.</p></div></div></td><td><div><div><p>DW-677</p></div></div></td></tr><tr><td><div><div><p>DataWeave no longer incorrectly sets autostreaming.</p></div></div></td><td><div><div><p>DW-918</p></div></div></td></tr><tr><td><div><div><p>The <code>UnsupportedTypeCoercionToLiteralException</code> error is now caught when using the similar operator (<code>~=</code>).</p></div></div></td><td><div><div><p>DW-932</p></div></div></td></tr><tr><td><div><div><p>JSON streaming now works correctly.</p></div></div></td><td><div><div><p>DW-940</p></div></div></td></tr><tr><td><div><div><p>The <code>AttributeDelegate</code> function no longer causes a stack overflow error.</p></div></div></td><td><div><div><p>SE-23494</p></div></div></td></tr><tr><td><div><div><p>Removing objects by property name now works as expected.</p></div></div></td><td><div><div><p>SE-23444</p></div></div></td></tr><tr><td><div><div><p>When using arrays, the XML writer properly keeps namespaces.</p></div></div></td><td><div><div><p>SE-23299</p></div></div></td></tr><tr><td><div><div><p>DataWeave now correctly parses large strings in JSON transformations.</p></div></div></td><td><div><div><p>SE-23291</p></div></div></td></tr><tr><td><div><div><p>A Scatter Gather issue that caused DataWeave to throw the <code>ArrayIndexOutOfBoundsException</code> error no longer occurs.</p></div></div></td><td><div><div><p>SE-22431</p></div></div></td></tr><tr><td><div><div><p>Comparison operators for <code>dateTime</code> type now work as intended.</p></div></div></td><td><div><div><p>SE-22025</p></div></div></td></tr><tr><td><div><div><p>Local variable resolution now works as expected.</p></div></div></td><td><div><div><p>SE-21847</p></div></div></td></tr><tr><td><div><div><p>Avoid closing resources prematurely when using the <code>write</code> function, which affects MUnit tests.</p></div></div></td><td><div><div><p>SE-23483</p></div></div></td></tr><tr><td><div><div><p>Fix <code>OutOfMemory</code> error using <code>writeLinesWith</code> function, which affected the <code>ndjson</code> module.</p></div></div></td><td><div><div><p>SE-23759</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## November 2021

DataWeave 2.4.0 is bundled with the Mule 4.4.0 release. The November Mule patch release addresses
the following DataWeave issues:

<table><colgroup><col> <col></colgroup><thead><tr><th>Description</th><th>Issue</th></tr></thead><tbody><tr><td><div><div><p>Fixed a <code>ClassCastException</code> that occurred in the Avro module by correcting its generated MIME type.</p></div></div></td><td><div><div><p>SE-21869</p></div></div></td></tr><tr><td><div><div><p>Comments within YAML files processed in Mule applications are no longer erased.</p></div></div></td><td><div><div><p>DW-706</p></div></div></td></tr><tr><td><div><div><p>You can now disable the removal of self-referencing implicit variables.</p></div></div></td><td><div><div><p>DW-893</p></div></div></td></tr><tr><td><div><div><p>DataWeave now allows mixed content structures (text and nodes) when reading and writing XML content.</p></div></div></td><td><div><div><p>SE-21464</p></div></div></td></tr><tr><td><div><div><p>Functions in the <code>Dates</code> module now accept one-digit numbers for months and days.</p></div></div></td><td><div><div><p>DW-894</p></div></div></td></tr><tr><td><div><div><p>Improved the performance of splitting functionality.</p></div></div></td><td><div><div><p>DW-776</p></div></div></td></tr><tr><td><div><div><p>Improved the performance of the JSON module.</p></div></div></td><td><div><div><p>DW-706</p></div></div></td></tr></tbody></table>

For details about the Mule release and patch updates, see
[Mule Runtime Engine 4.4.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes).

## October 5, 2021

This MuleSoft programming language simplifies data transformation tasks and serves as Mule runtime’s
expression language for configuring components and connectors. Build powerful integration solutions
with intuitive scripting capabilities.

For more detail, see [DataWeave Language](https://docs.mulesoft.com/dataweave/latest/).

## What’s New

The 2.4.0 version of DataWeave introduces new features and enhancements.

Release notes for previous versions of DataWeave are available within
[Mule Runtime Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-esb).

### New Features

- Ability to read larger-than-memory strings automatically. When you are using the indexed reader
  strategy and processing a string with a size larger than 1.5 MB, DataWeave automatically splits
  the value in chunks to avoid out-of-memory issues. Related reader properties include
  `com.mulesoft.dw.max_memory_allocation` and `com.mulesoft.dw.buffered_char_sequence.enabled`.
  Refer to
  [Indexed Readers in DataWeave](https://docs.mulesoft.com/dataweave/2.4/dataweave-indexed-readers#large-strings-management).

- New reader and writer properties for working with data formats. For example, the XML writer now
  enables you to define namespaces at the root level.

- Many new modules, functions, types, annotations, and variables. Some are experimental and subject
  to change in future releases.

For additional detail, see [What’s New in DataWeave](https://docs.mulesoft.com/dataweave/2.4/whats-new-in-dw)

### Enhancements

A number of DataWeave functions are overloaded to introduce new helper functions for handling `null`
values, including:

- Core:

  - `entriesOf`

  - `namesOf`

  - `keysOf`

  - `valuesOf`

  - `replace`

  - `--`

  - `contains`

  - `sizeOf`

  - `endsWith`

  - `joinBy`

  - `scan`

  - `splitBy`

  - `startsWith`

  - `matches`

  - `match`

- Arrays:

  - `countBy`

  - `sumBy`

  - `divideBy`

  - `take`

  - `drop`

  - `slice`

  - `indexWhere`

  - `splitAt`

  - `takeWhile`

  - `dropWhile`

  - `splitWhere`

  - `partition`

  - `firstWith`

- Strings:

  - `charCode`

  - `charCodeAt`

  - `fromCharCode`

  - `repeat`

> [!NOTE] The `default` operator no longer captures `null` function calls because the functions
> themselves now manage the `null` value. Uses of these functions with the `default` operator might
> behave unexpectedly for this reason.

## Compatibility

This table specifies which version of DataWeave is bundled with each Mule runtime engine release:

<table><colgroup><col> <col></colgroup><thead><tr><th>Mule Version</th><th>DataWeave Version</th></tr></thead><tbody><tr><td><p>4.13</p></td><td><p>2.13</p></td></tr><tr><td><p>4.12</p></td><td><p>2.12</p></td></tr><tr><td><p>4.11</p></td><td><p>2.11</p></td></tr><tr><td><p>4.10</p></td><td><p>2.10</p></td></tr><tr><td><p>4.9</p></td><td><p>2.9</p></td></tr><tr><td><p>4.8</p></td><td><p>2.8</p></td></tr><tr><td><p>4.7</p></td><td><p>2.7</p></td></tr><tr><td><p>4.6</p></td><td><p>2.6</p></td></tr><tr><td><p>4.5</p></td><td><p>2.5</p></td></tr><tr><td><p>4.4</p></td><td><p>2.4</p></td></tr><tr><td><p>4.3</p></td><td><p>2.3</p></td></tr><tr><td><p>4.2</p></td><td><p>2.2</p></td></tr><tr><td><p>4.1</p></td><td><p>2.1</p></td></tr><tr><td><p>3.9</p></td><td><p>1.2</p></td></tr><tr><td><p>3.8</p></td><td><p>1.1</p></td></tr><tr><td><p>3.7</p></td><td><p>1.0</p></td></tr></tbody></table>

## Fixed Issues

The following table lists bug fixes that are specific to the initial release of DataWeave 2.4.0.
This release also incorporates all fixes to DataWeave, including patch updates through the September
2021 release, that are listed in
[Mule Runtime 4.3.0 Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.3.0-release-notes).

<table><colgroup><col> <col></colgroup><thead><tr><th>Description</th><th>Issue</th></tr></thead><tbody><tr><td><div><div><p>Added the <code>writeDeclaredNamespaces</code> XML writer property to write all declared namespaces in the root element.</p></div></div></td><td><div><div><p>DW-16</p></div></div></td></tr><tr><td><div><div><p>Added the <code>writeDeclaration</code> YAML writer property to avoid writing the header declaration.</p></div></div></td><td><div><div><p>DW-162</p></div></div></td></tr><tr><td><div><div><p>Added a new <code>Strings</code> module for easier string data management.</p></div></div></td><td><div><div><p>DW-406</p></div></div></td></tr><tr><td><div><div><p>Added the constant folding functionality so that DataWeave replaces operations involving constant values with the actual result. For example, <code>1024*8</code> is replaced at compile time with the resulting value <code>8192</code>.</p></div></div></td><td><div><div><p>DW-427</p></div></div></td></tr><tr><td><div><div><p>Added flow retyping to the type system, which enables better accuracy within flow-control structures featuring checks that involve typing.</p></div></div></td><td><div><div><p>DW-438</p></div></div></td></tr><tr><td><div><div><p>Added code inspectors so that quick fixes are suggested with best practices, such as replacing <code>null</code> checks with a <code>default</code> expression, or replacing <code>sizeOf() == 0</code> with <code>isEmpty()</code>.</p></div></div></td><td><div><div><p>DW-33/DW-632</p></div></div></td></tr><tr><td><div><div><p>Added an inspection to replace <code>using</code> with <code>do</code> blocks.</p></div></div></td><td><div><div><p>DW-771</p></div></div></td></tr><tr><td><div><div><p>Improved error messages when creating Java objects.</p></div></div></td><td><div><div><p>DW-565</p></div></div></td></tr><tr><td><div><div><p>Improved performance on floating point number parsing by identifying in advance if the number has a floating point or not.</p></div></div></td><td><div><div><p>SE-20614</p></div></div></td></tr><tr><td><div><div><p>Extended the common subexpression elimination process to work with index selectors.</p></div></div></td><td><div><div><p>SE-19934</p></div></div></td></tr><tr><td><div><div><p>Added functions that work with <code>null</code> values to the <code>Core</code>, <code>Arrays</code>, and <code>String</code> modules.</p></div></div></td><td><div><div><p>DW-425</p></div></div></td></tr><tr><td><div><div><p>Improved JSON performance by copying bytes from input to output directly during JSON-to-JSON data transformations.</p></div></div></td><td><div><div><p>DW-230</p></div></div></td></tr><tr><td><div><div><p>Improved YAML support of scalar types, string quotations, custom tags, and comment retention.</p></div></div></td><td><div><div><p>DW-687</p></div></div></td></tr><tr><td><div><div><p>Added the <code>filterTree</code> function to the <code>Tree</code> module to be able to filter any data structure.</p></div></div></td><td><div><div><p>DW-160</p></div></div></td></tr><tr><td><div><div><p>Added validations for index tokens in CSV format.</p></div></div></td><td><div><div><p>DW-577</p></div></div></td></tr><tr><td><div><div><p>Added support for the Java classes <code>OptionalInt</code>, <code>OptionalDouble</code> and <code>OptionalLong</code>.</p></div></div></td><td><div><div><p>DW-628</p></div></div></td></tr><tr><td><div><div><p>Added support for <code>file:/example/file.txt</code> as a valid URL.</p></div></div></td><td><div><div><p>DW-195</p></div></div></td></tr><tr><td><div><div><p>Added warning when using the design-time only format <code>application/dw</code> without <code>dataOnly</code> mode.</p></div></div></td><td><div><div><p>DW-873</p></div></div></td></tr><tr><td><div><div><p>Added experimental <code>run</code> and <code>eval</code> functions to dynamically execute scripts.</p></div></div></td><td><div><div><p>DW-170</p></div></div></td></tr><tr><td><div><div><p>Added the concept of optional function parameters in the type system.</p></div></div></td><td><div><div><p>DW-874</p></div></div></td></tr><tr><td><div><div><p>Improved CSV streaming to avoid unnecessary processing.</p></div></div></td><td><div><div><p>DW-876</p></div></div></td></tr><tr><td><div><div><p>Improved the <code>mapObject</code> function to avoid unnecessary processing.</p></div></div></td><td><div><div><p>DW-535</p></div></div></td></tr><tr><td><div><div><p>Improved the <code>flatten</code> function to avoid unnecessary processing.</p></div></div></td><td><div><div><p>DW-509</p></div></div></td></tr><tr><td><div><div><p>Improved code validation. Now an error returns when a variable is using the same name as an input.</p></div></div></td><td><div><div><p>DW-522</p></div></div></td></tr><tr><td><div><div><p>Improved the precision of math operations and added a property to retain the previous behavior: <code>com.mulesoft.dw.math.exact_precision</code>.</p></div></div></td><td><div><div><p>SE-16452</p></div></div></td></tr><tr><td><div><div><p>Improved handling of big XML files to fix potential I/O exceptions.</p></div></div></td><td><div><div><p>DW-250</p></div></div></td></tr><tr><td><div><div><p>Fixed error locations when scripts feature dynamic string selectors.</p></div></div></td><td><div><div><p>DW-875</p></div></div></td></tr><tr><td><div><div><p>Fixed a false negative error message when using multiple union types.</p></div></div></td><td><div><div><p>DW-297</p></div></div></td></tr><tr><td><div><div><p>The <code>write</code> function return types are now consistent with input types.</p></div></div></td><td><div><div><p>DW-298</p></div></div></td></tr><tr><td><div><div><p>The <code>update</code> operator no longer fails when working with repeated keys and attributes.</p></div></div></td><td><div><div><p>DW-306</p></div></div></td></tr><tr><td><div><div><p>Processing of XML documents with comments and <code>streaming</code> enabled now works as expected.</p></div></div></td><td><div><div><p>DW-307</p></div></div></td></tr><tr><td><div><div><p>DataWeave no longer fails to parse a single key-value pair with a conditional and parentheses.</p></div></div></td><td><div><div><p>DW-309</p></div></div></td></tr><tr><td><div><div><p>The type system now validates overloaded functions as parameters.</p></div></div></td><td><div><div><p>DW-316</p></div></div></td></tr><tr><td><div><div><p>Parallel processing on <code>ndjson</code> now works as expected.</p></div></div></td><td><div><div><p>DW-325</p></div></div></td></tr><tr><td><div><div><p>Fixed a materialization and streaming failure.</p></div></div></td><td><div><div><p>DW-368</p></div></div></td></tr><tr><td><div><div><p>Fixed the behavior of the <code>slice</code> function.</p></div></div></td><td><div><div><p>DW-409/DW-410</p></div></div></td></tr><tr><td><div><div><p>Fixed the ability to import namespaces from external modules.</p></div></div></td><td><div><div><p>DW-414</p></div></div></td></tr><tr><td><div><div><p>DataWeave now produces the error <code>Division by Zero</code> when dividing by <code>0.0</code> instead of an internal exception.</p></div></div></td><td><div><div><p>DW-415</p></div></div></td></tr><tr><td><div><div><p>DataWeave now properly validates that <code>do</code> blocks do not contain any reserved word declaration.</p></div></div></td><td><div><div><p>DW-416</p></div></div></td></tr><tr><td><div><div><p>Running <code>flatten</code> on <code>flatten</code> no longer causes loss of values.</p></div></div></td><td><div><div><p>DW-691</p></div></div></td></tr><tr><td><div><div><p>The <code>update</code> operator now works when no attribute is defined.</p></div></div></td><td><div><div><p>DW-216</p></div></div></td></tr><tr><td><div><div><p>Improved handling of binary data to prevent running out of memory when calculating sizes of processed data.</p></div></div></td><td><div><div><p>SE-16559</p></div></div></td></tr><tr><td><div><div><p>The <code>com.mulesoft.dw.coercionexception.verbose</code> property no longer logs data from coercion exceptions.</p></div></div></td><td><div><div><p>SE-15487</p></div></div></td></tr><tr><td><div><div><p>Using nested binary functions no longer produces a <code>StackOverflow</code> error.</p></div></div></td><td><div><div><p>SE-16092</p></div></div></td></tr><tr><td><div><div><p>DataWeave no longer returns <code>UnsupportedOperationException</code> when parsing an invalid script.</p></div></div></td><td><div><div><p>DW-294</p></div></div></td></tr><tr><td><div><div><p>Fixed a potential <code>IndexOutOfBoundException</code> when using overloaded functions with four parameters.</p></div></div></td><td><div><div><p>DW-159</p></div></div></td></tr><tr><td><div><div><p>Added support for dumping Flat File and Avro schemas when <code>com.mulesoft.dw.dump_files</code> is enabled.</p></div></div></td><td><div><div><p>DW-137</p></div></div></td></tr><tr><td><div><div><p>Improved code compilation. Implicit inputs are not added if a variable with the same name is explicitly defined.</p></div></div></td><td><div><div><p>DW-630</p></div></div></td></tr></tbody></table>

## Upgrade

For upgrades to the 2.4.0 version of DataWeave, which is bundled within Mule runtime engine, see
[Upgrading Mule Runtime Engine (Versions 4.x to 4.n)](https://docs.mulesoft.com/release-notes/mule-runtime/updating-mule-4-versions).

## See Also

- [Salesforce Help](https://help.salesforce.com)

- [MuleSoft Services](https://www.mulesoft.com/support-and-services)

- [Troubleshooting a Failing DataWeave Script](https://docs.mulesoft.com/dataweave/latest/dataweave-troubleshoot)

- [Known Issues](https://help.salesforce.com/s/issues)
