Skip to main content

Hello all,

 

To comment out the source code from flow, Mule uses standard xml comments tag <!-- -->.  

This made some issues with Dataweave as it uses '---' separator and using '--' shows error in AnypointStudio 6(Mule3.x). 

I had to change from '---' to '- - -' to comment out soruce code.

 

In Mule4, this issues became much more serious, as Mule 4 uses dataweave expression instead of MEL. 

And evenmore, most of listener supports setting response types as follows 

 #output text/plan --- "vars.name : " ++ write(vars.name)

 

It is quite annoying to change whole '---' to other patterns temporary and to change back to original code.

 

Is there any alternative ways to solve this inconvenience?

How do you guys comment out some code in Mule4 flow?

 

Regards,

5 respuestas
  1. 10 oct 2019, 21:30

    We seem to be going round and round here. Let me say this...unless you externalize the dataweave script(s), you cannot comment XML code with Ctrl+Shift+/. That being said, the externalized dataweave expressions are within the same project...they are not anywhere outside of that project. By default, they are saved in src/main/resources. If writing dataweave expressions to a separate files is not an option, then my suggestion will not help in what you trying to do. IMO, externalizing the dataweave script has a couple of advantages: (1) Keeps my XML code clean i.e. it only contains xml and nothing else, so I dpn't have to deal with expressing non-xml content with CDATA element...that usually makes my code look ugly (2) If the dataweave expression needs to reusable, all I have to do is oint to the file where it is located rather than redefine it inline.

     

    my 2 cents.

    -gopal

0/9000