MCD - Level 1 Exam QuestionsBrowse all questions from this exam

MCD - Level 1 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

10 comments
Sign in to comment
DarisOption: C
Jan 11, 2023

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

aiden_03Option: C
Mar 7, 2023

Answer is C - Variables are not accessible through HTTP request

[Removed]Option: D
May 23, 2023

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

Neo_0000Option: C
Sep 22, 2023

C is the correct answer.

n0maeOption: C
Oct 10, 2023

I tried. Answer is C.

RanjansinghOption: A
Feb 8, 2023

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

ExamDevOption: C
Jan 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
Jan 26, 2024

Answer is C

AlandtOption: B
Feb 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
Jun 11, 2024

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

aook002Option: C
Apr 9, 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
Jun 11, 2024

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