ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 208 - MCD - Level 1 discussion

Report
Export

Refer to the exhibits.

The Batch Job scope contains two Batch Steps scopes with different accept expression.

The input payload is passed to the Batch Job scope.

After the entire payload is processed by the batch job scope , what messages have been logged by the Logger component?

A.
1. {amount=140} 2. {amount=102} 3. {step2amount=100}
Answers
A.
1. {amount=140} 2. {amount=102} 3. {step2amount=100}
B.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=40}
Answers
B.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=40}
C.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=140}
Answers
C.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=140}
D.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=140} 5. {step2amount=102}
Answers
D.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=140} 5. {step2amount=102}
Suggested answer: D

Explanation:

This question validates you knowledge on Batch Processing. Before we analyze the question , lets revise a bit about batch filters.

Batch Filters

You can apply one or more filters as attributes to any number of batch steps.

Imagine a batch job whose first batch step checks if a Salesforce contact exists for a record, and a second batch step that updates each existing Salesforce contact with new information. You can apply a filter to the second batch step to ensure it only processes records that didn't fail during the first batch step.

By having batch steps accept only some records for processing, you streamline the batch job so the Mule runtime engine can focus only on the relevant data for a particular batch step.

A batch step uses two attributes to filter records:

acceptExpression

acceptPolicy

Each batch step can accept oneacceptExpressionand oneacceptPolicyattributes to filter records.

Use theacceptExpressionattribute to process only records that evaluate to true; if the record evaluates to false, the batch step skips the record and sends it to the next one. In other words, the records with an accept expression that resolves to false are the ones that Mule filtersout.

The example below filters out all records where the age is less than 21; the batch step does not process those records.

<batch:job jobName='batchJob'>

<batch:process-records >

<batch:step name='adultsOnlyStep' acceptExpression='#[payload.age > 21]'>

...

</batch:step>

</batch:process-records>

</batch:job>

Mule Ref Doc :Refining Batch Steps Processing | MuleSoft Documentation

As we are clear with above concepts , now lets understand this solution step by step.

1) Batch Step (Less than 50)

Accept expression for this batch step is less than 50. Hence elements which will go in this batch step are amount value 40 and 2. Hence output of logger in first batch step is

{amount=140}

{amount=102}

2) Batch Step (Greater than 20)

Accept condition for this batch step is greater than 20. Note that input amount values for this batch step are 100 , 140 and 102 (last two values have been updated in batch step less than 50)

As all values satisfy this condition out put of second logger is

{step2amount=100}

{step2amount=140}

{step2amount=102}

Hence correct answer to this question is

{amount=140}

{amount=102}

{step2amount=100}

{step2amount=140}

{step2amount=102}

2) Batch Step (Greater than 20)

Accept condition for this batch step is greater than 20. Note that input amount values for this batch step are 100 , 140 and 102 (last two values have been updated in batch step less than 50)

As all values satisfy this condition out put of second logger is

{step2amount=100}

{step2amount=140}

{step2amount=102}

Hence correct answer to this question is

{amount=140}

{amount=102}

{step2amount=100}

{step2amount=140}

{step2amount=102}

asked 18/09/2024
Ibrahim Isaaq
31 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first