Contact Us 1-800-596-4880

To Move Transformation to Separate Files (Anypoint Studio)

By default, the DataWeave code from a Transform Message component is expressed inline within your Mule XML file. You can instead keep each in a separate file ( .dwl ) and have your XML reference them. These files are packaged with your Mule application when built.

To export the DataWeave code to a .dwl file:

  • click the Edit Current Target button

    Code showing a payload in JSON format
  • Select the 'File' radio button

    A dialog box prompts the user to select a target, with options to input a file and choose between inline or file source code
  • Type a name for your .dwl file

  • Click OK

A file is created under the src/main/resources folder in your project containing your DataWeave code.