# Debugging

Starting with version 7.00.024, a debugger is also available for ELOas. The debug engine built into the Rhino Engine is used. It can be activated using a configuration parameter.

<entry key="debug">true</entry>

ELO Automation Services Debugger

Fig.: ELO Automation Services Debugger

To operate the debugger, ELOas should be run locally from the developer's computer. In addition, it should be started as a console process and not as a Windows service. Otherwise, the debugger will not work on Windows Vista or Windows 7.

If you have multiple active rulesets in use, a separate debugger window opens for each. With the Window menu entry, you can switch between these individual windows.

In the debugger, you can set breakpoints for individual functions and inspect or change variable contents. You can then resume execution in individual steps or run mode.

Apache Tomcat properties

Fig.: Apache Tomcat properties

# Syntax errors in the script

If the script contains a syntax error, JavaScript processing will not be able to start. The advantage of this kind of error is that you will them right when you start the program, shown in the ELOas status dialog box.

Syntax errors in the script

Fig.: Syntax errors in the script

The complete generated JavaScript program with all embedded modules is logged in the ELOas report on start-up to facilitate debugging. The error number listed refers to this section of the report (starting with the section "//Import the IndexServer API classes").

14:28:07,681 DEBUG (WorkingSet.java:368) - load JavaScript Templates,
        Parent GUID=(23594D10-4704-4FF9-938B-136792051D67)
14:28:07,744 DEBUG (WorkingSet.java:385) - Script file found: Base Templates
14:28:07,744 DEBUG (WorkingSet.java:385) - Script file found: Imports
14:28:07,744 DEBUG (WorkingSet.java:385) - Script file found: ELO Utils
14:28:07,759 DEBUG (WorkingSet.java:385) - Script file found: DB Access
14:28:07,759 DEBUG (WorkingSet.java:385) - Script file found: Document Export
14:28:07,759 DEBUG (WorkingSet.java:385) - Script file found: Dummy Modul mit
                                           Namenskonflikt
14:28:07,759 DEBUG (WorkingSet.java:276) - loadItems,
        Parent GUID=(9DAC7E8D-1467-4820-B53B-D27CCB5F06C0)
14:28:07,822 DEBUG (WorkingSet.java:286) - Number of Child entries: 1
14:28:07,822 DEBUG (WorkingSet.java:304) - Ruleset: MailRule1
14:28:08,025 DEBUG (WorkingSet.java:472) -
//Import the IndexServer API classes.
importPackage(Packages.de.elo.ix.client);
importPackage(Packages.java.lang);
importPackage(Packages.java.sql);
importPackage(Packages.sun.jdbc.odbc);
importPackage(Packages.java.io);
var NAME;
var ARCDATE;
var DOCDATE;
var OBJCOLOR;
var OBJDESC;
var OBJTYPE;
var ARCHIVINGMODE;
var ACL;
var EM_PARENT_ID;
var EM_PARENT_ACL;
var EM_NEW_DESTINATION = new Array();
var EM_FIND_RESULT = null;
…

Please note that this output will be repeated every restart and reload. Thus, a report file can contain multiple lists. The last list in the report is always the most current.

# Logical or runtime errors

Runtime errors are somewhat more difficult to diagnose. The only option is to isolate the location of the error using log outputs. Such a log output is unfortunately much less transparent than an interactive debugger, but it also has significant advantages in batch processing. In ELOas, the Java logger is available on the JavaScript page under the name log. For this reason, the JavaScript code can also make entries there with log.debug().

var cmd = "SELECT * FROM objekte where objid = 22"
var res = getLine(1, cmd)
log.debug(res.objshort)
log.debug(res.objidate)
log.debug(res.objguid)

The log outputs of the JavaScript code can be recognized by the lack of class name and missing line number in the report (?:?).

15:38:57,643 DEBUG (?:?) - Now init JDBC driver
15:38:57,659 DEBUG (?:?) - Get Connection
15:38:57,659 DEBUG (?:?) - Init done.
15:38:57,659 DEBUG (?:?) - createStatement
15:38:57,659 DEBUG (?:?) - executeQuery
15:38:57,659 DEBUG (?:?) - read result
15:38:57,659 DEBUG (?:?) - getLine done.
15:38:57,659 DEBUG (?:?) - Suchen geändert.
15:38:57,659 DEBUG (?:?) - 56666880
Last updated: September 26, 2023 at 7:46 AM