Debugger (Event handling)

The debugger can be used to pause and analyze event handlings, client workflows, and form behaviours/actions at dedicated breakpoints.
For this purpose, the current input object, the current state of all variables and the associated log can be viewed.
Tip: Stops at breakpoints even in the test mode of an event handling.


The debugger can be reached via the main menu and is structured as follows:

images/download/attachments/78263619/image2021-9-22_9-41-25-version-1-modificationdate-1632303263453-api-v2.png

1

Starts/pauses the debugger.
If the debugger is started, the possibility to add breakpoints in blocks of event handling is activated automatically.
Breakpoints can be activated in blocks via right-click or the '...' menu. Blocks with breakpoints are highlighted graphically.
Behaviour and actions can set a breakpoint via the images/download/attachments/78263619/image2021-9-22_11-44-51-version-1-modificationdate-1632303892627-api-v2.png symbol.

If the block with the breakpoint is executed next, the debugger pauses the execution for analysis purposes.
The debugger automatically moves to the foreground in the process.

If the debugger is paused, it will no longer stop at any breakpoint, though these will remain untouched.

2

Lists all active breakpoints.
The names of the breakpoints consist of an abbreviated type name (e.g. AEHC for event handling), the ID of the containing configuration and a consecutive counter (for the behaviour of the behaviour name).

3

Stops the debugger and discards all breakpoints in the process.

►NOTE◄ As long as the debugger is not explicitly stopped, all breakpoints are retained, even if the client is reloaded. Only an explicit logout from the client stops the debugger automatically.

4

Restricts pausing at breakpoints to selected sessions.

  • Restrict to own session (default) - it will be paused only if the breakpoint is reached within the users' own session.

  • Restrict to user (only applies to event handling).

    images/download/attachments/78263619/image2021-9-22_9-30-39-version-1-modificationdate-1632303263455-api-v2.png



    It will be paused only if the breakpoint is reached within the session of one of the specified users. Thereby the user's own session can be additionally excluded if debugged with one of the mentioned users.

5

Shows all breakpoints that are currently paused. The name of an entry consists of the abbreviated type name (e.g. AEHC for event handling), the ID of the containing configuration and a consecutive counter, as well as the user name of the session and a source (for the behaviour of the behaviour name).
By selecting another session entry the debugger dialog shows the corresponding states (7) of this breakpoint.

6

These functions can be used to decide in a granular way whether and how to continue at a paused point.

  • Resume – Cancels the pause and stops again only when the next breakpoint is reached.

  • Step – Continues execution until the next block at the same level.

  • Micro step – Jumps into the paused block and pauses at the next subordinate block.

  • Resume all – Similar to 'Resume', with respect to all currently paused breakpoints (5).

7

Shows the state of the input data (result), all variables and the current log messages.

►NOTE◄ For behaviour, the 'Variables' tab shows no entries and the 'Log' tab shows only the element ID of the triggering element and the type of interaction (e.g. MANUAL_CHANGED if the user triggered their own behaviour).

►CAUTION◄ While a breakpoint is active in an event handling, a server thread and a database transaction (usually) is completely blocked. Therefore, longer debugging should be done on live systems only in emergencies. This does not apply to client workflows and behaviour.

Set breakpoints

In modules of event handlings and client workflows:

Right click or '...' Module menu (rule or action).

images/download/attachments/78263619/image2021-9-22_11-50-47-version-1-modificationdate-1632304249448-api-v2.png

In behaviour and actions

images/download/attachments/78263619/image2021-9-22_11-52-48-version-1-modificationdate-1632304370240-api-v2.png

Use case

A portal passes a numeric value as variable 'n' to the event handling of a custom action event called 'Iterate'.

images/download/attachments/78263619/image2021-9-22_10-1-33-version-1-modificationdate-1632303263450-api-v2.png

Clicking the Iterate button triggers the custom action event 'Iterate' and additionally the value of the numeric text field is passed as parameter 'n'.

An associated event handling first checks whether the parameter 'n' is >= 0 and if so, a loop is run 'n' times, adding the index of the run to an 'entries' list.

images/download/attachments/78263619/image2021-9-22_10-18-59-version-1-modificationdate-1632303263448-api-v2.png

This is now checked step-by-step with the debugger.

Example 1

The debugger is opened and started.
After that a breakpoint is set in the checking rule:

images/download/attachments/78263619/image2021-9-22_10-23-11-version-1-modificationdate-1632303263446-api-v2.png

The block is then visually highlighted accordingly.

images/download/attachments/78263619/image2021-9-22_10-24-3-version-1-modificationdate-1632303263443-api-v2.png

Next, open the portal, enter the value '5' in the text box, and then press the Iterate button.

images/download/attachments/78263619/image2021-9-22_10-29-29-version-1-modificationdate-1632303263442-api-v2.png

The debugger now automatically moves to the foreground and shows the state of event handling at the time BEFORE the rule was executed.

In the Variables tab, all variables valid at the current time can now be viewed.

images/download/attachments/78263619/image2021-9-22_10-33-43-version-1-modificationdate-1632303263439-api-v2.png

Here you can clearly see the parameter 'n' as a variable with the value 5.

With a 'Step' in the debugger (6) the further logic can now be 'stepped through' module by module.
images/download/attachments/78263619/image2021-9-22_10-53-19-version-1-modificationdate-1632303263435-api-v2.png

The currently visited module is also visually highlighted accordingly.

Example 2

The individual iterations of the loop are analyzed. Therefore, a breakpoint is set in the 'Modify list' module.
images/download/attachments/78263619/image2021-9-22_10-56-42-version-1-modificationdate-1632303263433-api-v2.png

Starting from the last state from example 1, the individual loop passes can now be analyzed with the 'Resume' function in the debugger (6).

A look at the state of the variables shows that the loop variables are now also available:

images/download/attachments/78263619/image2021-9-22_10-59-27-version-1-modificationdate-1632303263415-api-v2.png

By repeatedly pressing the Resume button it is possible to observe how the variable '$index' is incremented and entries are added to the 'entries' list.
Below table shows the state of the two variables for each paused breakpoint.

Cycle

entries

$index

0

<key xsi:type="xsd:string">entries</key>
<value xsi:type="list"></value>
<key xsi:type="xsd:string">$index</key>
<value xsi:type="xsd:int">0</value>

1

<key xsi:type="xsd:string">entries</key>
<value xsi:type="list">
<entry xsi:type="xsd:int">0</entry>
</value>


<key xsi:type="xsd:string">$index</key>
<value xsi:type="xsd:int">1</value>

2

<key xsi:type="xsd:string">entries</key>
<value xsi:type="list">
<entry xsi:type="xsd:int">0</entry>
<entry xsi:type="xsd:int">1</entry>
</value>
<key xsi:type="xsd:string">$index</key>
<value xsi:type="xsd:int">2</value>

3

<key xsi:type="xsd:string">entries</key>
<value xsi:type="list">
<entry xsi:type="xsd:int">0</entry>
<entry xsi:type="xsd:int">1</entry>
<entry xsi:type="xsd:int">2</entry>
</value>
<key xsi:type="xsd:string">$index</key>
<value xsi:type="xsd:int">3</value>

4

<key xsi:type="xsd:string">entries</key>
<value xsi:type="list">
<entry xsi:type="xsd:int">0</entry>
<entry xsi:type="xsd:int">1</entry>
<entry xsi:type="xsd:int">2</entry>
<entry xsi:type="xsd:int">3</entry>
</value>
<key xsi:type="xsd:string">$index</key>
<value xsi:type="xsd:int">4</value>

This simplified example shows that, especially with regard to loops, the use of the debugger can greatly simplify the debugging or algorithm analysis.