MCD Level 1 - Part 3 Flashcards

1
Q

What valid RAML retrieves details on a specific customer by its customerId as a URI parameter?

A

/customers: /{customerId}: get:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A web client submits a request to http://localhost:8081?accountType=personal. The query parameter is captured using a Set Variable transformer to a variable named accountType. What is the correct DataWeave expression to log accountType?

A

vars: Keyword for accessing a variable. For example, through a DataWeave expression in a Mule component, such as the Logger, or from an Input or Output parameter of an operation. If the name of your variable is myVar, you can access it like this: vars.myVar

Hence correct answer is Account Type: #[vars.accountType]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the below is not the mandatory configurations for HTTP Listener?

A

Allowed methods is an optional configuration. If nothing is specified then all HTTP methods are supported.

Rest all are mandatory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Refer to the exhibits. What is valid text to set the user field in the Database connector configuration to the username value specified in the config.yaml file?

A

${db.username}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

As a part of requirement , application property defined below needs to be accessed as Dataweave expression. What is the correct expression to map it to port value?

A

Correct answer is { port : p(‘db.port’)}

This function returns a string that identifies the value of one of these input properties: Mule property placeholders, System properties, or Environment variables.

The p function returns a null value if the property is not set or if the function does not find the property.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Refer to the exhibits. A web client submits the request to the HTTP Listener. What response message would be returned to web client?

A

Correct answer is String is not blank.

As no error handling is provided. Default error is sent back which is String is not blank

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A flow contains an HTTP Listener as the event source. What is the DataWeave expression to log the Content-Type header using a Logger component?

A

[“Content-Type: ” ++ headers.’content-type’]

Correct answer is #[“Content-Type: ” ++ attributes.headers.’content-type’]

Reason in as below

1) Concatenation is always with ++ sign and not with + sign which makes two of the options incorrect

2) Headers can be accessed with attributes.headers and not with only headers which makes below option incorrect

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the object type returned by the File List operation?

A

Array of Mule event objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where would you create SLA Tiers for an API?

A

SLA Tiers are created in API Manager.

MuleSoft Doc Ref : https://docs.mulesoft.com/api-manager/2.x/policy-mule3-tutorial-manage-an-api#to-add-the-tier

Steps to create SLA Tier are as follows:

1) In API Manager, in API Administration, click a version.

2) Check that the API supports resource-level policies: On the API version details page, in Status, click Configure Endpoint, and check that Type is RAML.

3) Choose the SLA Tiers, and click Add SLA Tier. Set up limit on SLA tier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the default port used by Mule application debugger configuration in Anypoint Studio?

A

6666

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the module is imported automatically in Dataweave scripts?

A

Correct answer is Core (dw::Core)

This module contains core DataWeave functions for data transformations. It is automatically imported into any DataWeave script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is minimal requirement in a flow for a Mule application to compile?

A

Each flow must have one or more Event Processor section to get compiled successfully.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Where is metadata stored in a Mule project

A

Metadata is stored in application-types.xml flle located under src/main/resources.

Mule 4 applications contain an application-types.xml file, which is where metadata around your data types is stored. For example, if you create a new CSV type, that metadata will be added to this file. This new file is easy to share, commit, and merge when conflicts arise, which enables you to do more metadata-driven development.

MuleSoft Doc Ref : https://docs.mulesoft.com/mule-runtime/4.3/intro-studio#metadata-storage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the below is not a valid category for connector type?

Gold

A

Gold is not valid category for connector types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the purpose of the api:router element in APIkit?

A

Correct answer is Validates requests against RAML API specifications and routes them to API implementations

The APIkit Router is a key message processor that validates requests against the provided definition, enriches messages (for example by adding default values to the messages) and routes requests to a particular flow. Also, the Router raises errors messages if errors occurs while routing, validating or processing the user request.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

There are three routes configured for Scatter-Gather and incoming event has a payload is an Array of three objects. How routing will take place in this scenario?

A

Entire event would be sent to each route in parallel.

Scatter-Gather works as follows :
– The Scatter-Gather component receives a Mule event and sends a reference of this Mule event to each processing route.

– Each of the processing routes starts executing in parallel. After all processors inside a route finish processing, the route returns a Mule event, which can be either the same Mule event without modifications or a new Mule event created by the processors in the route as a result of the modifications applied.

– After all processing routes have finished execution, the Scatter-Gather component creates a new Mule event that combines all resulting Mule events from each route, and then passes the new Mule event to the next component in the flow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which of the below is used by Mule application to manage dependencies which make sharing the projects lightweight and easier

A

POM.xml contains info about the project and configurationn details used by Maven to build the project

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What module and operation will throw an error if a Mule events payload is not null?

A

Correct answer is Validation module’s Is Null operation

Validate Null Fails if the value is not null and not an instance of NullPayload

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

From which application , Organization Administrators can approve/revoke/delete SLA tier access requests

A

Organization Administrators can approve/revoke/delete SLA tier access requests via API Manager only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is not the function of API Gateway ?

A

Correct answer is Specify throttling , security and other policies

MuleSoft Doc Ref : https://docs.mulesoft.com/api-manager/2.x/api-gateway-capabilities-mule4

API Gateway is responsible for below functions.

1) Determine which traffic is authorized

2) Meter the traffic

3) Logs transaction

4) Apply throttling and other policies (Not specifying. These are specified in API Manager)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What of the below is not a feature of API Notebooks?

A

Correct answer is Creates a mock service for an API

API Notebook is an open source, shareable web application for API documentation, interactive API tutorial and example generatation, and a client for your API endpoints. Using API Notebook, you can make requests and quickly transform the responses into readable format. However it cannot be used to mock service for an API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

An SLA based policy has been enabled in API Manager. What is the next step to configure API proxy to enforce new SLA policy

A

Correct answer is Add required headers to RAML specification and redeploy new API proxy

MuleSoft Doc Ref : https://docs.mulesoft.com/api-manager/2.x/tutorial-manage-an-api

Steps are as below :

Add the Required RAML Snippet

SLA-based rate limiting requires adding a RAML or OAS snippet to your API. This procedure demonstrates adding a RAML snippet.

Specify the client ID and secret as query parameters.

Add a section called traits: at the RAML root level to define query parameters:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the use of DevKit in Mule 4?

A

The MuleSoft Anypoint DevKit, or simply DevKit, enables the development of MuleSoft Anypoint Connectors. But it is supported only in Mule 3. Mule 4 uses Mule SDK to create custom connectors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

A Scatter-Gather processes three separate HTTP requests. Each request returns a Mule event with a JSON payload. What is the final output of the Scatter-Gather?

A

Correct answer is An Object containing all three Mule event Objects

The Scatter-Gather component is a routing event processor that processes a Mule event through different parallel processing routes that contain different event processors. Each route receives a reference to the Mule event and executes a sequence of one or more event processors. Each of these routes uses a separate thread to execute the event processors, and the resulting Mule event can be either the same Mule event without modifications or a new Mule event with its own payload, attributes, and variables. The Scatter-Gather component then combines the Mule events returned by each processing route into a new Mule event that is passed to the next event processor only after every route completes successfully.

The Scatter-Gather component executes each route in parallel, not sequentially. Parallel execution of routes can greatly increase the efficiency of your Mule application and may provide more information than sequential processing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

To avoid hard-coding values, a flow uses some property placeholders and the corresponding values are stored in a configuration file. Where does the configuration file’s location need to be specified in the Mule application

A

Correct answer is A global element

When we create a configuration file , that file needs to added as Global Configuration file in Global element. A global element is a reusable object containing parameters that any number of elements in a flow can share. You reference a global element from Anypoint Connectors or components in your Mule application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is the output of Dataweave Map operator?

A

Returns an array that is the result of applying a transformation function (lambda) to each of the elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

A Mule flow has three Set Variable transformers. What global data structure can be used to access the variables?

A

Mule event is correct answer. Mule event has two parts which are as follows 1) Message (which contains payload and attributes like headers and query/uri parameters 2) Variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is the difference between a subflow and a sync flow?

A

Correct answer is Subflow has no error handling implementation where as sync flow has.

Subflow

A subflow processes messages synchronously (relative to the flow that triggered its execution) and always inherits both the processing strategy and exception strategy employed by the triggering flow. While a subflow is running, processing on the triggering flow pauses, then resumes only after the subflow completes its processing and hands the message back to the triggering flow.

Synchronous Flow

A synchronous flow, like a subflow, processes messages synchronously (relative to the flow that triggered its execution). While a synchronous flow is running, processing on the triggering flow pauses, then resumes only after the synchronous flow completes its processing and hands the message back to the triggering flow. However, unlike a subflow, this type of flow does not inherit processing or exception strategies from the triggering flow.

This type of flow processes messages along a single thread, which is ideally suited to transactional processing.

29
Q

Refer to the exhibits. What DataWeave expression transforms the conductorIds array to the XML output?

A

Points to remember:
* XML must have a root element.
* XML only allows one root element
* To avoid multiple root issues, you must create a root element for the XML output, whenever we transform output
* To transform a JSON array into XML repeated elements, use object constructor curly braces and evaluation parenthesis i.e. “{( )}“.
The transformation to XML would fail if the above mentioned considerations were not taken into account. Thus the transformation script declares a root element as trains and wraps the data in “{( )}“.
Whenever you see such type of question, always look out for root element followed by {( )}.
————————————————————————————————————————————————–
Correct answer:
trains:
{(
conductorIds map ((engId, index) ->
train: {
engineerId: engId
}
)
)}

30
Q

Pick the component with which DataWeave is tightly integrated.

A

Correct answer is Mule runtime
DataWeave is the MuleSoft expression language for accessing and transforming data that travels through a Mule app. DataWeave is tightly integrated with the Mule runtime engine, which runs the scripts and expressions in your Mule app.

31
Q

Refer to the exhibits. Each route in the Scatter-Gather sets the payload to the number shown in the label.
What response is returned to a web client request to the HTTP Listener?

A

After all processing routes have finished execution, the Scatter-Gather component creates a new Mule event that combines all resulting Mule events from each route, and then passes the new Mule event to the next component in the flow.
{
“0”: {
“attributes”: …,
“payload”: “100”
},
“1”: {
“attributes”: …,
“payload”: “200”
}
}

32
Q

Refer to the exhibit. What is the correct syntax to add a customer ID as a URI parameter in an HTTP Listener path?

A

Correct answer is {customerID}.

33
Q

Valid Flows in Mulesoft

A

sync flow
async flow
subflow

Sub flow is always synchronous.

34
Q

What is the correct way to format the decimal 200.1234 as a string to two decimal places?

A

Correct answer is 200.1234 as String {format: “.0#”} . Rest all options are not syntactically correct.

35
Q

How can you call a flow from Dataweave?

A

Correct answer is Look up function
This function enables you to execute a flow within a Mule app and retrieve the resulting payload.

36
Q

This Mule application has an HTTP Request that is configured with hardcoded values. To change this, the Mule application is configured to use a properties file named config.yaml.
What valid expression can the HTTP Request host value be set to so that it is no longer hardcoded?

A

Correct answer is ${training.host}
————————————————————————————————————————————————–
How to Configure Properties to Mule 4.X Platform?
1) Go to /src/main/resources project directory.
2) Create a configuration file with the name configuration.yaml inside the newly created config folder.

3) Go To Project > Global Element > Create > General >select the configuration.yaml file create in step- 2)

4) To verify develop a simple flow with HTTP listener which has above entries. Put the logger that prints the values on console.

5) Additional info: Similarly, when you want to access this port in DataWeave you need to use p function

37
Q

Where are values of query parameters stored in the Mule event by the HTTP Listener?

A

Attributes

38
Q

A Utlility.dwl is located in a Mule project at src/main/resources/modules. The Utility.dwl file defines a function named encryptString that encrypts a String What is the correct DataWeave to call the encryptString function in a Transform Message component?

A

Correct answer is
%dw 2.0
output application/json
import modules::Utility

Utility::encryptString( “John Smith” )

39
Q

A Mule application‘s HTTP Listener is configured with the HTTP protocol. The HTTP listeners port attribute is configured with a property placeholder named http.port. The mule application sets the http.port property placeholder‘s value to 9090
The Mule application is deployed to CloudHub without setting any properties in the Runtime manager Properties tab and a log message reports the status of the HTTP listener after the Mule application deployment completes.
After the mule applications is deployed, what information is reported in the worker logs related to the port on which the Mule application‘s HTTP Listener listens?

A

Cloudhub expose services on port 8081 and override value in http.port with this one .
Sample log in Runtime Manager is below
21:15:53.148 08/08/2021 Worker-0 ArtifactDeployer.start.01 INFO
Listening for connections on ‘http://0.0.0.0:8081‘

40
Q

The API needs to be updated using the company wide standard for the Plan data type. The Object data type has already been published to Anypoint Exchange with the global reference mentioned below. ACME/DataTypes/PlanData.raml
What is valid RAML specification that reuses the Plan Data type?

A

RAML keyword to use a reference is !include.
The purpose of an include is to modularize a complex property value in a RAML definition by placing the property value in an external file.
Hence option 2 and 3 are invalid as they contain the keyword reference instead of include.
Also references to data types are included under type field and not dataType field. Hence option 1 is the correct answer.

41
Q

From which application , Organization Administrators can approve/revoke/delete SLA tier access requests?

A

Organization Administrators can approve/revoke/delete SLA tier access requests via API Manager only.
Approve or Reject Access Requests
After users request access to your API instance from Anypoint Exchange, you can manually approve or reject requests from API Manager.

42
Q

How can you call a flow from Dataweave?

A

Correct answer is Look up function
This function enables you to execute a flow within a Mule app and retrieve the resulting payload.
lookup

This function enables you to execute a flow within a Mule app and retrieve the resulting payload.
It works in Mule apps that are running on Mule Runtime version 4.1.4 and later.

Similar to the Flow Reference component (recommended), the lookup function enables you to execute another flow within your app and to retrieve the resulting payload. It takes the flow’s name and an input payload as parameters. For example, lookup(“anotherFlow”, payload) executes a flow named anotherFlow.

The function executes the specified flow using the current attributes, variables, and any error, but it only passes in the payload without any attributes or variables. Similarly, the called flow will only return its payload.

Note that lookup function does not support calling subflows.

43
Q

A Mule application configured with Autodiscovery implements an API.
Where is governance enforced for policies defined for this Mule application?

A

Correct answer is API manager.
API Autodiscovery

Configuring autodiscovery allows a deployed Mule runtime engine (Mule) application to connect with API Manager to download and manage policies and to generate analytics data. Additionally, with autodiscovery, you can configure your Mule applications to act as their own API proxy.

When autodiscovery is correctly configured in your Mule application, you can say that your application’s API is tracked by (green dot) or paired to API Manager. You can associate an API in a Mule setup with only one autodiscovery instance at a given time.

Prerequisites
To configure autodiscovery for your Mule application, ensure that:
The API exists in API Manager and is configured as either a basic endpoint, or a proxy endpoint.
The Mule application is configured to use Anypoint Platform credentials.

The platform credentials give your application access to the API Configuration in API Manager. You must configure these credentials before starting the Mule runtime engine that executes your application.

The autodiscovery element is configured in your Mule application.

44
Q

Which out of below is not an asset?

A

Exchange is the odd man out here. Rest all are types of an asset.
Asset Types
Both the public and private content in Exchange can consist of the following kinds of elements:
Connectors – Packaged connectivity to an endpoint developed and deployed on Anypoint Platform with third-party APIs and standard integration protocols
Use connectors within your application’s flows to send and receive data using a protocol or specific API. Anypoint Studio comes with many bundled connectors, and Exchange has many more.
Templates – Packaged integration patterns built on best practices to address common use cases
You can add your information such as user credentials to complete the template’s use case or solution, and you can customize or extend templates as needed.
Examples – Applications that are ready to run in Anypoint Studio and demonstrate a use case or solution
Policies – Configuration modules to extend the functionality of an API and enforce capabilities such as security
REST APIs – A RAML file or OAS file that specifies an API
These APIs can be referenced by an HTTP Request connector to expose metadata to Anypoint Studio.
SOAP APIs – A WSDL file that specifies an API
HTTP APIs – A placeholder for an endpoint for use by private Exchange users who want to manage the endpoint with API Manager
API Groups – A set of APIs bundled into a single asset. Instead of requesting access to multiple APIs to satisfy a use case, a developer can access the group in one step.
API Spec Fragments – A RAML document that has a version and an identifier, but is not in itself a complete RAML specification. API spec fragments are also known as RAML fragments.
Custom – A description and an optional file to explain aspects of your system, to provide instructional videos, or to describe product or organizational documentation

45
Q

A Mule project contains a DataWeave module like WebStore.dwl that defines a function named loginUser which accepts login id (String) as an argument. 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 purpose of login for the below user?
“Todd.Pal@mulesoft.com”

A
  • 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:

46
Q

Which of the below is used by Mule application to manage dependencies which make sharing the projects lightweight and easier?

A

POM.xml contains info about the project and configuration details used by Maven to build the project.

pom.xml File/pom.xml

Project Object Model file that defines settings for a Maven project describing an application. It includes all settings necessary to build the application such as build plugin configurations. Note that the pom.xml exists on a per-project basis and is distributed along with a project.

47
Q

In which of the below files, metadata stored in a Mule project?

A

Metadata is stored in application-types.xml flle located under src/main/resources.

Mule 4 applications contain an application-types.xml file, which is where metadata around your data types is stored. For example, if you create a new CSV type, that metadata will be added to this file.

This new file is easy to share, commit, and merge when conflicts arise, which enables you to do more metadata-driven development.

48
Q

What of the below is not a feature of API Notebooks?

A

Correct answer is Creates a mock service for an API
API Notebook is an open source, shareable web application for API documentation, interactive API tutorial and example generatation, and a client for your API endpoints. Using API Notebook, you can make requests and quickly transform the responses into readable format. However it cannot be used to mock service for an API.
MuleSoft Doc Ref : https://docs.mulesoft.com/api-manager/1.x/api-notebook-concept

49
Q

What asset cannot be created using Design Center?

A

API portal are created by API Exchange and cannot be created by Design Center.
About Design Center
Anypoint Design Center is a development environment that consists of two tools:
API Designer
API Designer enables you to create API specifications in several modeling languages, and to create RAML API fragments. After you create a specification or fragment, publish it to Anypoint Exchange so that anyone in your MuleSoft organization can use it.
Flow Designer
In Flow Designer, you create Mule applications to integrate systems into workflows.

50
Q

To avoid hard-coding values, a flow uses some property placeholders and the corresponding values are stored in a configuration file. Where does the configuration file‘s location need to be specified in the Mule application?

A

Correct answer is A global element
When we create a configuration file , that file needs to added as Global Configuration file in Global element. A global element is a reusable object containing parameters that any number of elements in a flow can share. You reference a global element from Anypoint Connectors or components in your Mule application.
Global Elements
A global element is a reusable object containing parameters that any number of elements in a flow can share. You reference a global element from Anypoint Connectors or components in your Mule application.
Use the global element to apply configuration details to multiple local elements in flows. Create one global element that defines parameters and configuration details, and then reference the global element from any flow element that uses this configuration. This practice enables you to ensure consistency across flow elements.

50
Q

How can you call a subflow from Dataweave?

A

This is a trick question.

You can call only flows from DataWeave using lookup function. Note that lookup function does not support calling subflows.

A subflow needs a parent context to inherit behaviors from such as exception handling, which a flow does not need

Hence correct answer is Not possible in Mule 4
lookup :

This function enables you to execute a flow within a Mule app and retrieve the resulting payload.
It works in Mule apps that are running on Mule Runtime version 4.1.4 and later.

Similar to the Flow Reference component (recommended), the lookup function enables you to execute another flow within your app and to retrieve the resulting payload. It takes the flow’s name and an input payload as parameters.

For example, lookup(“anotherFlow”, payload) executes a flow named anotherFlow.

The function executes the specified flow using the current attributes, variables, and any error, but it only passes in the payload without any attributes or variables. Similarly, the called flow will only return its payload.

Note that lookup function does not support calling subflows.

51
Q

What is the output of Dataweave Map operator?

A

Returns an array that is the result of applying a transformation function (lambda) to each of the elements.
MuleSoft Doc Ref : https://docs.mulesoft.com/mule-runtime/4.3/dataweave-cookbook-map
The map operator is a function in Dataweave which iterates over the items in an array and outputs them into a new array. It basically accepts input as a list of items in an array and manipulates the items in the array in order to form a new array as an output.
I have created below chart for your easier understanding:

52
Q

A function named toUpper needs to be defined that accepts a string named userName and returns the string in uppercase.
What is the correct DW code to define the toUpper function?

A

You can define your own DataWeave functions using the fun declaration in the header of a DataWeave script. For example, this a simple DataWeave function accepts a single String argument that outputs “HELLO”:
%dw 2.0
output application/json
fun toUpper(aString) = upper(aString)

53
Q

Refer to the exhibits. The Mule application configures and uses two HTTP Listener global configuration elements.
Mule application is run in Anypoint Studio.
If the mule application starts correctly, what URI and port numbers can receive web client requests?
If the mule applications fails to start , what is the reason for the failure?

A

In this case both the flows can start without any error and requests can be received on both ports. Flow named httpListener1 can call other flow using HTTP request without any issues.
Hence correct answer is
The mule application start successfully
Web client requests can be received at URI on port 2222 and on port 3333.
Lets check why other options are incorrect
1) The mule application fails to start. There is URL path conflict because both HTTP Listeners are configured with same path —- This is incorrect as port value is different in both listeners
2) The mule application start successfully. Web client requests can only be received at URI on port 2222 but not on port 3333 — This is incorrect as there is no reason for not receiving requests on port 3333
3) The mule application fails to start because of the port binding conflict as HTTP request also use same port i.e. 3333 — Port binding conflict will not happen in this case. It would have if both listener configurations would have been on same port . But that is not the case here.
Mule Ref Doc : HTTP Listener Reference – Mule 4 | MuleSoft Documentation

54
Q

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?

A

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
55
Q

Refer to the exhibit. The default scope in choice router recursively calls the color flow.
A web client sends a PUT request to the HTTP listener with payload Blue.
What response is returned to the web client?

A

Key thing to note here is Set Payload activity after HTTP Listener has condition Payload default “Blue”
This means that if incoming event has payload value then it would be used else if there is no payload value then it will be defaulted to Blue
Now lets understand the flow here.
Sequence can be described as follows.
* When web client sends the request , it sends payload as Blue (mentioned in question)
* In first iteration this will go to default choice , which sets payload to Red
* Via default route , flow will call itself with payload as Red
* In second iteration , as payload is Red (will not be defaulted to Blue this time) , it will go to first route in choice router which will set payload to Blk and second iteration will end returning back payload as Blk to first iteration.
* This Blk will be again set to payload and first iteration will end returning back response as Blk

56
Q

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

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
On Complete
During this phase, you can optionally configure the runtime to create a report or summary of the records it processed for the particular batch job instance. This phase exists to give system administrators and developers some insight into which records failed to address any issues that might exist with the input data.
Sample output is as below

57
Q

Refer to the exhibit. What DataWeave expression transforms the example XML input to the CSV output?

A

Correct answer is as below. Attributes in the incoming xml payload are always accessed using @.
Similarly item is required as we have multiple items in the request. Only below option satisfies both the conditions
%dw 2.0
output application/csv

payload.sale.
item map ((value, index) -> {
index: index,
sale: value.@saleId,
itemName: value.desc,
itemPrice: (value.quantity) * (value.price),
item: value.@itemId
} )

58
Q

A REST connect module is generated for a RAML specification. and then the rest connect module is imported in mule application in Anypoint Studio. For each method of the RAML specification , what does the REST connect module provide?

A

Correct answer is an operation. For each method of the RAML specification , REST connect module provide an operation.

59
Q

Refer to the exhibit. A Mule event is composed of a hierarchy of objects. Where in the hierarchy are variables stored?

A

Variables are stored under Mule event. Please refer to below image for the hierarchy .

60
Q

Refer to the exhibit. How should be the where clause written for the configured input parameters in such a way that it achieves below SQL query?
SELECT * from accounts WHERE city=attributes.queryParams.city and state=attributes.queryParams.state

A

Correct syntax to use where clause is WHERE city = :city AND state = :state
This question validates knowledge on using dynamic queries in DB select operation.
Configure Dynamic Queries in the Select Operation
When you need to parameterize not only the WHERE clause but also parts of the query itself (for example, queries that compare tables that depend on a condition, or complex queries for which the project table columns need to vary), you can configure dynamic queries.
In the following example, you configure a dynamic query by using a full expression with a string in which the table depends on a variable $(vars.table). Although some of the query text is dynamic (“SELECT * FROM $(vars.table)), the WHERE clause still defines the WHERE condition using input parameters: in this case, WHERE name = :name.
In your Studio flow, select the Select operation.
In the operation configuration screen, set the SQL Query Text field to SELECT * FROM $(vars.table) WHERE name = :name.
Set the Input Parameters field to {‘name‘ : payload}.
The following screenshot shows the configuration in Studio:

61
Q

A shopping API contains a method to look up store details by department.
To get the information for a particular store, web clients will submit requests with a query parameter named department and uri parameter named storeId
What is valid RAML snippet that supports requests from a web client to get a data for a specific storeId and department name?

A

Lets revise few concepts RAML which can help us to find the answer of this question.

URI Parameters
Lets have a look at below example.
/foos:
/{id}:
/name/{name}:

Here, the braces { } around property names define URI parameters. They represent placeholders in each URI and do not reference root-level RAML file properties as we saw above in the baseUri declaration. The added lines represent the resources /foos/{id} and /foos/name/{name}.

Query Parameters
Now we‘ll define a way to query the foos collection using query parameters. Note that query parameters are defined using the same syntax that we used above for data types:

/foos:
get:
description: List all Foos matching query criteria, if provided;
otherwise list all Foos
queryParameters:
name?: string
ownerName?: string

Based on the above information , below is the only option which defines storeid as uri parameter and department as query parameter.
/{storeId}:
get:
queryParameter:
department:

62
Q

Refer to the exhibits. In the choice router, the When expression for the domestic shipping route is set to “#[payload= “FR”]”
What is the output of logger after the execution of choice router is completed?

A

To compare, DataWeave syntax is #[payload == “FR”].
In this case only one = is used so it will give syntax error.
Hence the correct answer is A dataweave syntax error

63
Q

Refer to the below exhibit. A Mule application configures a property placeholder file named config.yaml to set some property placeholders for an HTTP connector.
What is the valid properties placeholder file to set these values?

A

Correct answer is as below as it follows the correct syntax.
http:
basepath: “api”
host : “localhost”
port : “8081”
Mule Doc Reference : https://docs.mulesoft.com/mule-runtime/4.3/mule-app-properties-to-configure
Other options are incorrect because
– “=” is used in .properties file and not in yaml configuration file
– There are no curly braces used in yaml configuration file

64
Q

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

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

65
Q

What is output of Dataweave flatten function?

A

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 ]

66
Q

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?

A

Correct answer is white.
Key thing to note here is that variables are not available to the called flow when it is invoked using HTTP request.
So the flow goes like below
1) Color variable is set to red
2) Payload is set to red
3) Child flow is called using HTTP request which means variables are not available in called flow (They would have been if flow reference activity would have been used)
4) Hence set payload activity will set payload to white as color variable is null
5) Payload returned in main flow is white.
6) So finally output of logger is white

67
Q

“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?

Library.raml
/books
get:
post:
/order:
get
patch
/members
get:

A

5

Correct answer is 5 as APIkit for REST generates a backend flow for each resource-action pairing in a RAML file.

68
Q
A