Accessing and Modifying Mule Events10% of the exam

Enriching events with target and target value

How the Target and Target Value parameters on operations and Flow Reference store a result in a variable while the payload and attributes pass through unchanged, what the variable holds by default versus with `#[message]`, `#[attributes...]` or a selection, and how to read it later in DataWeave and in input parameters.

Official exam objective
Apply correct processors/DataWeave expressions to enrich Mule events using Mule 4 connector targets, and predict outcomes.

~7 min read · 7 practice questions ·

What the exam expects

  • Identify which processors accept a Target (non-void operations such as HTTP Request, File Read and Database Select, and Flow Reference) and which do not (Logger, Set Payload, Remove Variable).
  • Predict the payload, the attributes and the target variable after an operation or Flow Reference with a target.
  • Choose a Target Value: the default payload, #[message], #[attributes.statusCode] or a selection such as #[payload[0].name], and write a valid target name.
  • Read a target variable later: vars.name, vars.name.payload for a stored message, in a Transform Message or an operation's input parameters.
  • Key terms: Target (target, name of the variable that stores the result); Target Value (targetValue, what to store, default payload); enrichment (adding data to the event without replacing the payload); non-void operation (an operation that returns a message).

Key facts

Effect on the message
Detail
The next component receives the same message the operation received
Target Value default
Detail
payload (the operation's result payload)
Target Value keywords
Detail
payload, attributes, message allowed; vars not allowed
Target names
Detail
Numbers, characters and underscores only; no hyphens
Stored message
Detail
targetValue="#[message]"; read vars.x.payload and vars.x.attributes
Other variables
Detail
Variables the operation changed revert after it finishes
On error
Detail
Target variables are not set
Flow Reference target
Detail
Target Value evaluates against the referenced flow's output; caller's message unchanged
Flow Reference, no target
Detail
Payload and variable changes in the referenced flow persist
++ on objects
Detail
Combines the key-value pairs of both objects into one
Sources for this section (3)
  • Why does a Database Bulk Insert with target="bulkInsertResult" leave the records as the payload?
  • Why do a referenced flow's variable changes disappear when the Flow Reference has a target?
  • What happens to changes a referenced flow makes to the payload or variables when the Flow Reference has no target?
  • When are target variables not set?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the MuleSoft Developer pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 40 lessons of the MuleSoft Developer guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Practice exams purchase adds inline bank questions and topic practice (7 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the MuleSoft Developer exam