MuleSoft Certified Developer – Level 1 — Question 144
A Mule project contains a DataWeave module file WebStore.dwl that defines a function named loginUser. The module file is located in the project’s src/main/resources/libs/dw folder.
What is correct DataWeave code to import all of the WebStore.dwl file’s functions and then call the loginUser function for the login “[email protected]”?
Answer options
- A. import libs.dw.WebStore --- loginUser( “[email protected]” )
- B. import * from libs::dw --- WebStore::loginUser( “[email protected]” )
- C. import * from libs::dw::WebStore --- loginUser( “[email protected]” )
- D. import libs.dw --- WebStore.loginUser( “[email protected]” )
Correct answer: C
Explanation
The correct answer is C because it properly imports all functions from the WebStore module using the correct namespace and then directly calls the loginUser function. Option A is incorrect as it does not import all functions correctly. Option B incorrectly uses the namespace for calling the function, and option D does not utilize the correct import syntax for accessing the functions within the module.