How to develop and debug a Custom Task Template for BI Automation Framework
This blog is written to demonstrate how to debug a Custom Task Template you have created using the tutorial How to create a Custom Task Template for BI Automation Framework.
Troubleshooting a problem in the Java code of your Task Template is not an easy task. But debugging helps and can even simplify the implementation and usage of other SDKs.
Here are the steps to enable and use Remote Debugging in BI Automation Framework.
BI Agent
- Open Central Configuration Manager (CCM)
- Stop the BI Agent in the CCM
- Modify JMV options in file AgentReg.BAT
browse to the location of the file on your server: ‘..AdminConsole\Agent\’
edit the file and add the following options to enable remote debugging on port 5005: ;-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
your line should look like:
set PR_JVMOPTIONS=-Duser.language=DE;-Duser.region=de;-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 - Save the file
- Update the agent registration using the new version of AgentReg.bat
run AgentDereg.bat (remove the BI Agent from the list in CCM)
run AgentReg.bat (add the BI Agent to the list in CCM) - Start the BI Agent in the CCM
In your Eclipse IDE
- Add breakpoint in Java code
- Create a Debug Configuration for your custom task template
host: localhost
port: 5005 (same as specified for BI Agent)
- Start the Debug mode
on the previous dialog or from the toolbar
BI Automation Framework
- Define a scenario with the custom task template
- Run the scenario
In your Eclipse IDE
- The execution will stop on your breakpoint
- Debug in Eclipse
Additional Information
If you change the Java code of your custom task template, you have to Export and Deploy the Custom Task Template Plug-in to the Agent before you can debug (see export and deploy on blog How to create a Custom Task Template for BI Automation Framework).
The plug-in Java code and the plug-in active in BI Agent must be in synch.