coderz.py

Keep Coding Keep Cheering!

Scatter-Gather Router

The Scatter-Gather component is a routing event processor that processes a Mule event through different parallel processing routes that contain different event processors.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Custom Metadata Selector (.^myCustomMetadata)

The following example uses userName.^myCustomMetadata to return the value of custom metadata that is defined as a variable (named userName) in the header of the script as a DataWeave script.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Raw Metadata Selector (.^raw)

The following example uses the Set Payload component (set-payload) to produce a binary value, then uses the Transform Message component (ee:transform) component to return raw data for the MD5 (MD5(payload.^raw)) of the binary value.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

MIME Type Metadata Selector (.^mimeType)

In the following Mule app flow, the Loggers use payload.^mimeType to select a string “my string”, then to select a string that is set within an fx expression (#[“my string as String type” as String]) in the Set Payload (set-payload) component.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Media Type Metadata Selector (.^mediaType)

Returns the MIME type of a value that includes parameters (for example, application/json;charset=UTF-16). The expression in the value of { “myMediaType” : payload.^mediaType } might return “myMediaType”: “/; charset=UTF-8” for an input POJO.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Encoding Metadata Selector (.^encoding)

In the following Mule app flow, the Logger uses payload.^encoding to select the encoding of “my string”`set in the Set Payload (`set-payload) component.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Class Metadata Selector (.^class)

Returns the class of the Plain Old Java Object (POJO). The value might result from calling a method in a Java class or have a data type (such as String or DateTime) that DataWeave treats as a Java value.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Content Length Metadata Selector (.^contentLength)

In the following Mule app flow, the Logger uses payload.^contentLength to select the length of the string my string, set in the Set Payload (set-payload) component.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Metadata Selector (.^someMetadata)

Returns the value of specified metadata for a Mule payload, variable, or attribute.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Filter Selectors (myKey[?($ == “aValue”)])

myKey[?($ == “aValue”)] returns only the values of matching keys within an array or object. Note that ? is also used in Key Present Validator. If no key-value pairs match, the result is null.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Advertisement