Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,28 @@ Flex Gateway supports a subset of DataWeave in policy configuration expressions.
* xref:dataweave::dw-strings-functions-substringbeforelast.adoc#substringbeforelast1[`substringBeforeLast(text: String, separator: String): String`]
* xref:dataweave::dw-strings-functions-substringbeforelast.adoc#substringbeforelast2[`substringBeforeLast(text: Null, separator: String): Null`]

=== toBase64

* xref:dataweave::dw-binaries-functions-tobase64.adoc#tobase641[`toBase64(content: Binary): String`]

=== fromBase64

* xref:dataweave::dw-binaries-functions-frombase64.adoc#frombase641[`fromBase64(base64String: String): Binary`]

[NOTE]
====
Flex Gateway doesn't support DataWeave expressions with binary type results. To use the `dw::Binaries::fromBase64('dXNlcjpwYXNz')` function, transform the result to a string. Transform the binary output to a string with the `dw::util::Coercions::toString(binary: Binary, encoding: String): String` function. For example, `#[dw::util::Coercions::toString(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), 'UTF-8')]`.
If using a different function that transforms the binary by default, such as `#[splitBy(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), ':')]`, you can skip manually transforming the binary.
====

=== toBinary

* xref:dataweave::dw-coercions-functions-tobinary.adoc#tobinary1[`toBinary(str: String, encoding: String): Binary`]

=== toString

* xref:dataweave::dw-coercions-functions-tostring.adoc#tostring3[`toString(binary: Binary, encoding: String): String`]

[[available-predefined-variables]]
== Available Predefined Variables

Expand All @@ -150,7 +172,7 @@ Flex Gateway supports a subset of DataWeave in policy configuration expressions.
** `authentication.properties`

* `payload`
** Use the `payload` variable to read the request body as a string. You can't parse this variable.
** Fields depend on the current payload. For example, `#[payload]` returns the body of the message.

* xref:dataweave::dataweave-variables-context.adoc[`vars`]
** Individual policies support different sets of variables. For information, refer to the policies listed in xref:policies-included-directory.adoc[].