From 6da304eaffd32bfdb7068abe74a2d17349e487e6 Mon Sep 17 00:00:00 2001 From: Cristian Date: Fri, 24 Apr 2026 16:43:33 -0300 Subject: [PATCH 1/2] W-21953173-Address-Jack-feedback-CP --- modules/ROOT/pages/int-debug-mule-apps.adoc | 70 +++++++++++++++++++-- modules/ROOT/pages/int-test-munit.adoc | 2 +- 2 files changed, 67 insertions(+), 5 deletions(-) diff --git a/modules/ROOT/pages/int-debug-mule-apps.adoc b/modules/ROOT/pages/int-debug-mule-apps.adoc index 1e8b1e017..58bb03349 100644 --- a/modules/ROOT/pages/int-debug-mule-apps.adoc +++ b/modules/ROOT/pages/int-debug-mule-apps.adoc @@ -31,7 +31,8 @@ For example, trigger an HTTP Listener or configure a Scheduler component. * xref:start-acb.adoc[Set up and access the web or desktop IDE]. * xref:int-create-integrations.adoc[Create an integration]. -== Debug Console Overview +[[debugger-view-overview]] +== Debugger View Overview image::debugger-view.png["Elements of the debugger view"] @@ -46,13 +47,15 @@ The Mule event includes message payload and attribute details, as well as Mule v . *Run and Debug* (MuleSoft) icon: Opens the *Run and Debug* panel, where you can click *Start Debugging (F5)* and find debugging information. + Keyboard shortcut: Cmd+Shift+d (Mac) or Ctrl+Shift+d (Windows) -. *Watch* panel: Helps you evaluate variables and expressions. +. *Watch* panel: Pin <> that re-evaluate whenever execution pauses. . *Call Stack* panel: Identifies the functions or procedures that are currently in the stack. -. *Breakpoints* panel: Lists all breakpoints in your Mule application. +. *Breakpoints* panel: Lists breakpoints by file and line, and includes <> to stop when any exception is thrown. . *Terminal* console: Displays the output of the Maven build process and the results of the deployment to the embedded Mule Runtime engine. . *Breakpoint* icon: Identifies a line in the configuration XML to pause execution of the flow so that you can check for and fix any issues. . *Breakpoint* icon: Identifies a component that contains one or more breakpoints. +Open the *Debug Console* tab in the panel area to <> while execution is paused. See <>. + [[add-breakpoint]] == Add a Breakpoint @@ -116,7 +119,33 @@ A breakpoint icon appears on the component and in the configuration XML for that + When execution reaches the breakpoint, processing pauses so you can inspect variables, payloads, and the execution state in the Debug panel. -NOTE: Batch execution is concurrent. Multiple record blocks can be processed in parallel, so breakpoints can trigger on different threads. The Debug panel displays each thread context separately so you can inspect each execution path. +NOTE: Batch execution is concurrent. Multiple record blocks can be processed in parallel, so breakpoints can trigger on different threads. The Debug panel displays each thread context so you can inspect each execution path. + +[[conditional-breakpoint]] +== Set a Conditional Breakpoint + +A conditional breakpoint uses a DataWeave expression so execution pauses at that line only when the expression evaluates to `true`. + +To set or change a breakpoint condition: + +. Add a breakpoint in the configuration XML. See <>. +. Right-click the breakpoint indicator in the gutter for that line. +. Select *Edit Breakpoint*. +. In the breakpoint editor, enter a DataWeave expression that uses the current Mule event. + +The gutter context menu for a breakpoint also includes *Remove Breakpoint*, *Disable Breakpoint*, and *Run to Line*. + +To review a condition later, hover the breakpoint in the gutter. A tooltip shows the configured expression in the form `Condition:` followed by your DataWeave expression. + +[[exception-breakpoints]] +== Stop When an Exception Is Thrown + +You can configure the debugger to pause whenever any exception is thrown, which helps you inspect failures without adding breakpoints to every path. + +. Open *Run and Debug*. +. In the *BREAKPOINTS* section, enable *All Exceptions*. ++ +If you enable *All Exceptions*, the debugger pauses as soon as an exception is thrown during a debug session. [[run-debug-mode]] == Run Your Application in Debug Mode @@ -211,6 +240,34 @@ Stop and restart the application without packaging new dependencies, such as new + Stop execution of the application. The next debugging session that you start packages the application with any new dependencies. +[[evaluate-dw-while-debugging]] +== Evaluate DataWeave While Debugging + +While execution is paused, you can run DataWeave against the current Mule event from the *Debug Console* or from pinned entries in the *Watch* panel. For the variables available in those expressions, see xref:dataweave::dataweave-variables-context.adoc[Predefined Mule event variables]. + +[[evaluate-dw-debug-console]] +=== Use the Debug Console + +. Start a debug session and pause execution at a breakpoint or after a step. See <> and <>. +. Open the *Debug Console* tab, or choose *View* > *Debug Console*. +. Ensure the input is set to *Expression*. Type a DataWeave expression and press Enter to evaluate it against the current message, attributes, variables, and other values visible to the debugger at the pause. ++ +The console shows each expression you run and its evaluated result for the current pause. + +The *Debug Console* is suited to check if needed as you step through a flow. + +[[evaluate-dw-watch]] +=== Use the Watch Panel + +. Open the *Watch* panel in the *Run and Debug* sidebar. +. Add an entry with *+* and enter a DataWeave expression. ++ +Whenever execution pauses, the debugger re-evaluates each watch expression and shows the result next to the expression, similar to the *Debug Console*. ++ +Watch expressions typically persist for later debug sessions in the same workspace, so you can keep inspecting the same values across runs. + +The *Watch* panel is suited to values you want to track on every pause without retyping them. + [[hot-deploy]] == Perform a Hot Deploy When Debugging @@ -232,3 +289,8 @@ image::deb-hot-deploy.png["Hot-deploy (lightning) icon in a running Mule applica To stop your debug session, in the *Run and Debug* panel, click the image:icon-stop.png["",15,15] (*Stop*) icon. The status bar no longer indicates that the application is running. + +== See Also + +* xref:dataweave::dataweave-variables-context.adoc[] +* xref:int-configure-dw-expressions.adoc[] diff --git a/modules/ROOT/pages/int-test-munit.adoc b/modules/ROOT/pages/int-test-munit.adoc index 513527593..397e8b4f9 100644 --- a/modules/ROOT/pages/int-test-munit.adoc +++ b/modules/ROOT/pages/int-test-munit.adoc @@ -451,7 +451,7 @@ Run your test in debug mode after adding breakpoints to the XML for your tests o . {open-project} . Add breakpoints to the XML for the Mule application or test suites. + -For guidance with breakpoints and the Mule event, see xref:int-debug-mule-apps.adoc[]. +For guidance with breakpoints, the Mule event, DataWeave in the *Watch* panel and *Debug Console*, conditional breakpoints, and exception breakpoints, see xref:int-debug-mule-apps.adoc[]. . Run your test with a debugging command using one of the following options: * From the *Testing* panel, click image:anypoint-code-builder::icon-munit-run-debug.png["",18,18] (*Debug test*) at any level (all tests, all tests in a suite, or a single test). From cc944b8e36b7e6e51b8ebb229565b70532a27425 Mon Sep 17 00:00:00 2001 From: Cristian Pose <101070178+Crispy-Salesforce@users.noreply.github.com> Date: Mon, 27 Apr 2026 11:09:24 -0300 Subject: [PATCH 2/2] Apply suggestions from Tasha Apply suggestions from Tasha Co-authored-by: Tasha Moore <93338373+tasmoore@users.noreply.github.com> --- modules/ROOT/pages/int-debug-mule-apps.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ROOT/pages/int-debug-mule-apps.adoc b/modules/ROOT/pages/int-debug-mule-apps.adoc index 58bb03349..84d33f32f 100644 --- a/modules/ROOT/pages/int-debug-mule-apps.adoc +++ b/modules/ROOT/pages/int-debug-mule-apps.adoc @@ -124,7 +124,7 @@ NOTE: Batch execution is concurrent. Multiple record blocks can be processed in [[conditional-breakpoint]] == Set a Conditional Breakpoint -A conditional breakpoint uses a DataWeave expression so execution pauses at that line only when the expression evaluates to `true`. +A conditional breakpoint uses a DataWeave expression, so execution pauses at that line only when the expression evaluates to `true`. To set or change a breakpoint condition: @@ -135,7 +135,7 @@ To set or change a breakpoint condition: The gutter context menu for a breakpoint also includes *Remove Breakpoint*, *Disable Breakpoint*, and *Run to Line*. -To review a condition later, hover the breakpoint in the gutter. A tooltip shows the configured expression in the form `Condition:` followed by your DataWeave expression. +To review a condition later, hover over the breakpoint in the gutter. A tooltip shows the configured expression in the form `Condition:` followed by your DataWeave expression. [[exception-breakpoints]] == Stop When an Exception Is Thrown @@ -262,7 +262,7 @@ The *Debug Console* is suited to check if needed as you step through a flow. . Open the *Watch* panel in the *Run and Debug* sidebar. . Add an entry with *+* and enter a DataWeave expression. + -Whenever execution pauses, the debugger re-evaluates each watch expression and shows the result next to the expression, similar to the *Debug Console*. +Whenever execution pauses, the debugger reevaluates each watch expression and shows the result next to the expression, similar to the *Debug Console*. + Watch expressions typically persist for later debug sessions in the same workspace, so you can keep inspecting the same values across runs.