Salesforce Certified MuleSoft Developer I Exam Practice Test

Page: 1 / 14
Total 235 questions
Question 1

What DataWeave expression transforms the array a to the XML output?



Answer : A

For such questions always look for Syntax:

I call it 'Wrap the Map'

trains:

{(

When mapping array elements (JSON or JAVA) to XML, wrap the map operations in {(..)}

-{ } are defining the object

-( ) are transforming each element in the array as a key/value pair


Question 2

Refer to the exhibits. APIKit router is used to generate the flow components for RAML specification.

The Mule application must be available to REST clients using the two URL's

http://localhost:8081/internal and http://localhost:8081/external

How many APIKit Router components are generated to handle requests to every endpoint defined in RAML specification?

1. Library.raml

2. /books

3. get:

4. post:

5. /order:

6. get

7. patch

8. /members

9. get:



Answer : A


Question 3

Refer to the exhibits. In the color flow , both the variable named color and payload are set to "red".

An HTTP POST request is then sent to the decideColor flow's HTTP Listener.

What is the payload value at the Logger component after the HTTP request completes?



Answer : C


Question 4

What is output of Dataweave flatten function?



Answer : C

Correct answer is Array.

Flatten turns a set of subarrays (such as [ [1,2,3], [4,5,[6]], [], [null] ]) into a single, flattened array (such as [ 1, 2, 3, 4, 5, [6], null ]).

This example defines three arrays of numbers, creates another array containing those three arrays, and then uses the flatten function to convert the array of arrays into a single array with all values.

Source

%dw 2.0

output application/json

var array1 = [1,2,3]

var array2 = [4,5,6]

var array3 = [7,8,9]

var arrayOfArrays = [array1, array2, array3]

---

flatten(arrayOfArrays)

Output

[ 1,2,3,4,5,6,7,8,9 ]


Question 5

Refer to the exhibits.

What payload and variable are logged at the end of the main flow?



Answer : B

Correct answer is [[5, 10, 15, 20], 5]

Key thing to note here is that any changes made to payload in for each loop are not available outside for each scope where as variable value updated in for each loop is visible out side for each loop too.

In this example , sequence can be described as follows

1) Payload is set to the value [5, 10, 15, 20]

2) Variable is set to the value of 1

3) For each loop is executed four times and in each loop payload value is updated to append 'Req' and variable is count is increased by 1

4) Once control comes out of for each , payload changes made within for each are not visible. Hence payload at this point of time is equal to payload available before entering for each loop which was [5, 10, 15, 20]. Similarly variable value updated in for each loop is also available outside hence variable value is 5 as it was updated in loop.

5) Hence correct answer is [[5, 10, 15, 20], 5]

For Each Scope

The For Each scope splits a payload into elements and processes them one by one through the components that you place in the scope. It is similar to afor-each/forloop code block in most programming languages and can process any collection, including lists and arrays. The collection can be any supported content type, such asapplication/json,application/java, orapplication/xml.

General considerations about the For Each scope:

By default, For Each tries to split the payload. If the payload is a simple Java collection, the For Each scope can split it without any configuration. The payload inside the For Each scope is each of the split elements. Attributes within the original message are ignored because they are related to the entire message.

For Each does not modify the current payload. The output payload is the same as the input.

For non-Java collections, such as XML or JSON, use a DataWeave expression to split dat

a. Use theCollectionfield for this purpose.


Question 6

An organization's Center for enablement (C4E)has built foundational assets (API specifications and implementation templates, common frameworks, and best practices guides) and published them to Anypoint Exchange.

What is a metric related to these foundational assets that helps the organization measure the success of it's C4E efforts?



Answer : C

Below are the Key performance indicators (KPIs), to measure and track the and success of the C4E and its activities, as well as the growth and health of the application network. Most of the metrics can be extracted automatically, through REST APIs, from Anypoint Platform.

* # of assets published to Anypoint Exchange

* # of interactions with Anypoint Exchange assets

* # of APIs managed by Anypoint Platform

* # of System APIs managed by Anypoint Platform

* # of API clients registered for access to APIs

* # of API implementations deployed to Anypoint Platform

* # of API invocations

* # or fraction of lines of code covered by automated tests in CI/CD pipeline

* Ratio of info/warning/critical alerts to number of API invocations


Question 7

A company has defined two RAML fragments, Book Data Type and Book Example to be used in APIs.

What would be valid RAML to use these fragments ?



Answer : D

* RAML file contains lot of information that could be considered as 'not API-describing'. Sort of 'economy-class' members.

Equally important, but not necessarily part of the main RAML file.

* Through !includes, RAML allows us to build file-distributed API definitions, which is not only useful to encourage code reuse but also improves readability.

* We can create RAML fragments with such code and then include them in main RAML project using !include like:

types:

Book: !include bookDataType.raml and

examples:

input: !include bookExample.raml

* Additionally for

----------------------------------------------------------------------------------------------------------------------------------------

Correct Answer: D


Page:    1 / 14   
Total 235 questions