Converts JSON to a string and writes to a file


How can i convert a JSON object to String and write to a file? The output type in data weave is application/java

If the output in DataWeave is set to application/json just sending the payload to a file transport should write the payload to the file.


        <dw:transform-message doc:name="Transform Message">
            <dw:set-payload><![CDATA[%dw 1.0
%output application/json
        <file:outbound-endpoint path="/tmp" outputPattern="jsonoutput"   responseTimeout="10000" doc:name="File"/>