0

My requirement is to do externalized dwl mapping files outside of the project and not include in src/main/resources folder.

To fulfil the requirement I need suggestion how I can proceed. Please check the below point provide any article or the way how I can implement-

  1. Can I keep dwl folder outside of the project? I tried to provide the file path in transform message like this #[MULE::${dwl.location}]/common/set-client-secret.dwl but this is not working.
  2. Is it possible to create dwl library for all dwl mappings files and can we import in transform message?

example: Below we have dwl mapping file that should be inside common library and in mule flow how can import just defining something like import::bad_request.dwl

%dw 2.0
output application/json
---
{
  message: "Bad request",
  error: error.description default ""
}
1
  • Questions in Stackoverflow should focus in only one topic. I recommend to create a separate question for 2) and include more context. Questions that lack focus could be closed as "Needs more focus" stackoverflow.com/help/closed-questions
    – aled
    Commented Mar 14, 2023 at 20:38

1 Answer 1

0

I don't think it is possible to reference DataWeave files directly from outside the project directory using standard methods. What is possible is to create DataWeave libraries and publish them to Anypoint Exchange for reuse in applications. If you don't want to use Exchange is probably possible to use the libraries as any other jar file, deploying to a Maven repositories and referencing it as a dependency in your project pom.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.