---
schema_version: "1"
id: 8e44c6840962af09a1a7af5643d90dea3f62c2dd0733d8223a938855bb975192
title: Migrating Transformers
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.3/migration-transformers.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.3/migration-transformers
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 32b7506d8b87015ba0c54895eba46e03eb0cedf76957ef704233abff277ba9ad
description: MuleSoft Documentation Site
release: "4.3"
latest: false
---
---
product: Mule Runtime
version: 4.3
---

# Migrating Transformers

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

Mule 4 does not require `transformers` anymore. Now that DataWeave is the default expression
language and the repeatable streams feature is supported, most (if not all) scenarios that required
a transformer no longer exist.

## Migrating Type Transformers

In Mule 3, the same data can be represented using different types. For instance, a JSON can be
stored using a `String`, `InputStream`, `OutputHandler`, or `ByteArray`. In the same way, an XML can
be represented with those same types or in a Java DOM document.

In Mule 4, every format that is not binary is handled automatically by Mule. So you do not need to
be concerned about the type that is carrying the content.

### InputStream to String Transformations

In Mule 3, the `<object-to-string-transformer>` was commonly used so that data held by an
`InputStream` could be consumed by more than one processor. Because Mule 4 has the concept of
repeatable streams, this is no longer required.

### Object Model Representation for JSON and XML

To access the content of an XML or JSON document in Mule 3, a conversion to a Java object
representation model was needed so that Java code or MEL could be used later. In Mule 4, the
expression language of the runtime completely supports JSON and XML (and many other formats), so
this conversion is no longer needed. You simply use a DataWeave expression to access the data.

## Migrating Custom Transformers

Most likely, any custom transformers you used to handle supported data formats are no longer needed,
so they can be migrated to use the expression language. The DataWeave script can be externalized to
a file if the same transformation needs to be occur in several places.

For cases where you transform data in ways that DataWeave does not support, you should use the Java
module or the Scripting module and use custom code to perform the transformation.

## See Also

[DataWeave Language](https://docs.mulesoft.com/mule-runtime/4.3/dataweave)

[Scripting Module](https://docs.mulesoft.com/scripting-module/latest/)

[Java Module](https://docs.mulesoft.com/java-module/latest/)

[Streaming in Mule Apps](https://docs.mulesoft.com/mule-runtime/4.3/streaming-about)

[Why DataWeave is the Main Expression Language in Mule 4 Beta](https://blogs.mulesoft.com/dev-guides/how-to-tutorials/why-dataweave-main-expression-language-mule-4/)
