Contact Us 1-800-664-9073

On Saturday April 1, 2023, from 9 AM to 2 PM (PDT), content will be unavailable due to scheduled maintenance.

This version of the product has entered Extended Support. You can switch to the latest version, or use the version selector in the left navigation.

Core Types (dw::Core)

DataWeave 2.2 is compatible and bundled with Mule 4.2. Standard Support for Mule 4.2 ended on May 2, 2021, and this version of Mule will reach its End of Life on May 2, 2023, when Extended Support ends.

Deployments of new applications to CloudHub that use this version of Mule are no longer allowed. Only in-place updates to applications are permitted.

MuleSoft recommends that you upgrade to the latest version of Mule 4 that is in Standard Support so that your applications run with the latest fixes and security enhancements.

Type Definition Description


type Any = Any

The top-level type. Any extends all of the system types, which means that anything can be assigned to a Any typed variable.


type Array = Array

Array type that requires a Type(T) to represent the elements of the list. Example: Array<Number> represents an array of numbers, and Array<Any> represents an array of any type.

Example: [1, 2, "a", "b", true, false, { a : "b"}, [1, 2, 3] ]


type Binary = Binary

A blob.


type Boolean = Boolean

A Boolean type of true or false.


type CData = String {cdata: true}

XML defines a CData custom type that extends from String and is used to identify a CDATA XML block.

It can be used to tell the writer to wrap the content inside CDATA or to check if the string arrives inside a CDATA block. CData inherits from the type String.


output application/xml --- { "user" : "Shoki" as CData }


<?xml version="1.0" encoding="UTF-8"?><user><![CDATA[Shoki]]></user>


type Comparable = String | Number | Boolean | DateTime | LocalDateTime | Date | LocalTime | Time | TimeZone

A union type that represents all the types that can be compared to each other.


type Date = Date

A date represented by a year, month, and day. For example: |2018-09-17|


type DateTime = DateTime

A Date and Time within a TimeZone. For example: |2018-09-17T22:13:00Z|


type Dictionary = { _?: T }

Generic dictionary interface.


type Enum = String {enumeration: true}

This type is based on the Enum Java class.

It must always be used with the class property, specifying the full Java class name of the class, as shown in the example below.


"Max" as Enum {class: "com.acme.MuleyEnum"}


type Iterator = Array {iterator: true}

This type is based on the iterator Java class. The iterator contains a collection and includes methods to iterate through and filter it.

Just like the Java class, Iterator is designed to be consumed only once. For example, if you pass it to a Logger component, the Logger consumes it, so it becomes unreadable by further elements in the flow.


type Key = Key

A key of an Object.

Examples: { myKey : "a value" }, { myKey : { a : 1, b : 2} }, { myKey : [1,2,3,4] }


type LocalDateTime = LocalDateTime

A DateTime in the current TimeZone. For example: |2018-09-17T22:13:00|


type LocalTime = LocalTime

A Time in the current TimeZone. For example: |22:10:18|


type NaN = Null {NaN: true}

java.lang.Float and java.lang.Double have special cases for NaN and Infinit. DataWeave does not have these concepts for its number multi-precision nature. So when it is mapped to DataWeave values, it is wrapped in a Null with a Schema marker.


type Namespace = Namespace

A Namespace type represented by a URI and a prefix.


type Nothing = Nothing

Bottom type. This type can be assigned to all the types.


type Null = Null

A Null type.


type Number = Number

A number type: Any number, decimal, or integer is represented by the Number` type.


type Object = Object

Type that represents any object, which is a collection of Key and value pairs.

Examples: { myKey : "a value" }, { myKey : { a : 1, b : 2} }, { myKey : [1,2,3,4] }


type Pair = { l: LEFT, r: RIGHT }

A type used to represent a pair of values.

Introduced in DataWeave 2.2.0. Supported by Mule 4.2 and later.


type Period = Period

A period.


type Range = Range

A Range type represents a sequence of numbers.


type Regex = Regex

A Java regular expression (regex) type.


type SimpleType = String | Boolean | Number | DateTime | LocalDateTime | Date | LocalTime | Time | TimeZone | Period

A union type that represents all the simple types.


type String = String

String type


type Time = Time

A time in a specific TimeZone. For example: |22:10:18Z|


type TimeZone = TimeZone

A time zone.


type Type = Type

A type in the DataWeave type system.


type Uri = Uri


View on GitHub