A function named newProdCode needs to be defined thataccepts two input parameters, an
integer value for itemID and a string value for productCategory, and returns a new product
code. What is the correct DataWeave code to define the newProdCode function?
A.
fun newProdCode{itemID: Number, productCategory: String) —> "PC-" ++
productCategory ++ (itemID as String)
B.
fun newProdCode(itemID: Number, productCategory: String) = "PC-" ++
productCategory ++ (itemID as String)
C.
function newProdCode(itemID: Number, productCategory: String) =
"PC-" ++ productCategory++ (itemID as String)
D.
var newProdCode(itemID: Number, productCategory: String) ->
"PC-" ++ productCategory ++ (itemID as String)
fun newProdCode(itemID: Number, productCategory: String) = "PC-" ++
productCategory ++ (itemID as String)
Refer to the exhibits. The main flow contains an HTTP Request in the middle of the flow.
The HTTP Listeners and HTTP Request use default configurations.
A web client submits a request to the main flow's HTTP Listener that includes query
parameters for the pedigree of the piano.
What values are accessible to the Logger component at the end of the main flow?
A. payload
B. payload
pedigree query params
C. payload
producer var
D. payload
pedigree query params producer var
In this case as outbound call is made using HTTP: POST /child , all attributes will be replaced by this invocation. Hence query parameter will not be accessible at logger. Hence correct answer is option 2.
What is minimal requirement in a flow for a Mule application to compile?
A. Event Source
B. Event Processors
C. Error handlers
D. Source and processors both
Process section is must to get compiles. Process section must have one or more processors
What should this endpoint return?
http://dev.acme.com/api/patients?name=John&surname=Bell
A. Patient with name as John
B. Patient with surname as bell
C. Patients with either name as John or surname as Bell
D. Patients with name as John and surname as Bell
Explanation:
Query parameters are a defined set of parameters attached to the end of a url. They are
extensions of the URL that are used to help define specific content or actions based on the
data being passed. To append query params to the end of a URL, a ‘?’ Is added followed
immediately by a query parameter.
To add multiple parameters, an ‘&’ is added in between each.
Hence coming back to question, endpoint would return Patients with name as John and
(and is very important here) surname as Bell.
What is not true about application properties?
A. Application properties can be encrypted
B. Application properties can be overridden with system properties
C. Application properties can be defined in .yaml file only
D. Application properties provide easier way to manage configurable values
Application properties can be defined in .yaml or in .properties file.
How would you debug Mule applications?
A. By Deploying apps on production
B. Checking RAML specifications
C. Using debugger component
D. Use third party debugger application
Debugger can be used to debug applications to see event data movine from one flow to other.
Refer to the exhibits.
The Batch job processes an array of strings.
What information is logged by the logger component after the batch job scope completes
processing of the input payload?
A. Total Records Processed: 3
Successful Records: 3
Failed Records: 0
payload: ["A","B","C"]
B. ["A","B","C"]
C. Total Records Processed: 3
Successful Records: 3
Failed Records: 0
payload: ["a", "b", "c"]
D. Total Records Processed: 3
Successful Records: 3
Failed Records: 0
Explanation:
Correct answer is as below. On complete phase only has access to batch job result
statistics and payload is not available.
Total Records Processed: 3
Successful Records: 3
Failed Records: 0
A Mule project contains a DataWeave module like WebStore.dwl that defines a function
named loginUser. The module file is located in the project's src/main/resources/libs/etl
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 "Todd.Pal@mulesoft.com"?
A. 1. 1. import libs.etl
2. 2. ---
3. 3. WebStore.loginUser("Todd.Pal@mulesoft.com")
B. 1. 1. import * from libs::etl
2. 2. ---
3. 3. WebStore::loginUser("Todd.Pal@mulesoft.com")
C. 1. 1. import libs.etl.WebStore
2. 2. ---
3. 3. loginUser("Todd.Pal@mulesoft.com")
D. 1. 1. import * from libs::etl::WebStore
2. 2. ---
3. 3. loginUser("Todd.Pal@mulesoft.com")
Explanation:
* To use custom modules, you need to import the module or functions you want to use by
adding the import directive to the head of your DataWeave script, for example:
1) Does not identify any functions to import from the String module:
import dw::core::Strings
2) To identify a specific function to import from the String module:
import camelize, capitalize from dw::core::Strings
3) To import all functions from the String module:
import * from dw::core::Strings
The way you import a module impacts the way you need to call its functions from a
DataWeave script. If the directive does not list specific functions to import or use * from to
import all functions from a function module, you need to specify the module when you call
the function from your script.
* In given scenario, it's mentioned to import all of the WebStore.dwl
So correct answer is:
Reference: https://docs.mulesoft.com/mule-runtime/4.3/dw-functions
Page 3 out of 29 Pages |
Mulesoft MCD-Level-1 Exam Questions Home | Previous |