One of the oldest questions as a developer, I think is: "Why does this code not work as expected?"
And one of the first things we all do is to set a breakpoint and check what's happening đ§
Of course, you can also write Java code for your processes in Axon Ivy and sometimes you would like to see what is going on. So let's see how you can do so:
Log output đ
One of the simplest and fastest ways to achieve something like it is to add a log entry to your code and check the Runtime Log
view for this entry:
ivy.log.info(">> test log: " + myVariable);
Start debug session đ
You can also start a debug session where you can set breakpoints to your Java code, but as we don't support this out of the box you need to do this with a little "trick".
First, you need to add the following JVM argument to the AxonIvyDesigner.ini
file:
-agentlib:jdwp=transport=dt_socket,server=y,address=8001,suspend=n
This line permits a remote debugger to connect with the JVM on port 8001
.
Now please restart your Designer
At last, you need to add a new Remote Java Application
debug configuration, by:
Open the Run
menu and then click on Debug Configurations
Create a new Remote Java Application
configuration
Select the project you want to debug
Select the host and the port (localhost and 8001)
Start the debug session by a click on the Debug
button (or over the Run
menu)

âšī¸ Tip: If you don't see any Debug Configurations
entry in the Run
menu, you can also find it over the Quick Search (via the magnifying glass at the top right or with the key combination Ctrl+3).
Write a JUnit test đ¤
Last but not least, you always have the possibility to write a simple JUnit test for your Java code. Especially if you have complex logic, it may be worth testing it properly. If you start a JUnit test, you can always set breakpoints and debug your code.
For more, check out our Testing documentation.