Loading
Salesforce から送信されるメールは、承認済ドメインからのみとなります続きを読む

Trailing Zeros Trimmed in DataWeave 4.5 Runtime and above: Expected Behavior and Workaround

公開日: Sep 18, 2025
説明

The user encountered an issue where zero decimal parts in numeric values were being truncated in the transform message when using Mule runtime 4.5 and above. This behavior violated API contracts that required double-type numbers to retain trailing zeros, such as 10.00 or 180.00.

The root cause of the issue is a change introduced in Mule 4.5 runtime and above, where the DataWeave component was updated to trim trailing zeros in numeric values. This behavior aligns with the JSON specification for the number data type, which does not preserve insignificant trailing zeros.

Reference: Mule 4.5 Release Notes 

"Trailing zeroes after the decimal point are now removed by default for JSON, YAML, CSV, and DataWeave formats."

解決策

1. Use a runtime argument to retain trailing zeros by setting the following property: -Dcom.mulesoft.dw.stripTrailingZeroes=false.

2. Set 'minMuleVersion' to '4.4.0' in artifact.json to retain DataWeave behavior from version 4.4, even when running on newer runtimes.

ナレッジ記事番号

005208317

 
読み込み中
Salesforce Help | Article