Mule 4 Exam QuestionsBrowse all questions from this exam

Mule 4 Exam - Question 142


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

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

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

Show Answer
Correct Answer: C

In the color flow, the variable named 'color' and the payload are both set to 'red'. However, when an HTTP POST request is sent to the decideColor flow's HTTP Listener, it operates independently and does not have access to the variables of the parent flow due to the scope of variables being limited to the flow in which they are defined, and not passed via HTTP request. In the decideColor flow, since the color variable is not passed and thus considered null, the payload is set to 'white' based on the condition in the decideColor flow. Therefore, the payload value at the Logger component after the HTTP Request completes is 'white'.

Discussion

11 comments
Sign in to comment
Daris
Jul 11, 2023

Answer is C - White. Variable scope is within Parent flow only except when using a flow reference.

aiden_03
Sep 7, 2023

Answer is C - Variables are not accessible through HTTP request

[Removed]
Nov 23, 2023

Wouldnt an error be thrown since its trying to access a variable that it cant?

Neo_0000
Mar 22, 2024

C is the correct answer.

n0mae
Apr 10, 2024

I tried. Answer is C.

RanjansinghOption: A
Aug 8, 2023

A - red, the child flow is the http request and in parent flow payload remain same

[Removed]Option: C
Jul 24, 2024

Agree with Daris. Correct answer is C - White. Variable scope is within Parent flow only except when using a flow reference.

marcop1Option: C
Jul 26, 2024

Answer is C

AlandtOption: B
Aug 8, 2024

- In the "color" flow, both the variable named "color" and the payload are set to "red". - When the HTTP POST request is made to the "decideColor" flow, the "color" variable is not null (it's set to "red"). Thus, the payload value set in the "decideColor" flow will be "blue". So, the payload value at the Logger component after the HTTP Request completes will be: B. “blue”

Alandt
Dec 11, 2024

My answer is wrong above. Ignore it. Correct answer is C

aook002Option: C
Oct 10, 2024

- Vars.color is set to ‘Red’ in color flow. - decideColor flow is called using HTTP Post (Be aware of variable scope - note not a Flow Reference) - This means vars are not passed from color flow to decideColor flow. - When decideColor flow is run, it has no idea of the value of the color variable. - Therefore, as color variable is null. Payload response set to ‘White’. For Alandt's answer, if it were a Flow Reference the answer would be B as the variable scope of color would be visible to child flow. But is incorrect as it is a HTTP POST request.

Alandt
Dec 11, 2024

You are totally correct. Thanks for mentioning. Ignore my other comment guys.

1919730Option: D
Feb 12, 2025

2 listener configurations can not have the same host and port number, here localhost and 8081 2 times. The parent flow, child flow, and request opertation should use the same configuration in that case. Tested in studio, it generates an error : Could not create server: A server in port(8081) already exists for host(0.0.0.0) or one overlapping it (0.0.0.0)