Debugging is a step in script development when the script is checked for errors and these errors are fixed. Script errors can be syntax or semantic. Syntax errors include:
incorrect title of a function or variable when referring to a function;
wrong number of arguments;
wrong type of the passed arguments;
wrong type of the returned value.
ELMA automatically checks for these errors before publishing a process or a script module. If a syntax error is found, the publishing of the process stops. As a result, if a script has syntax errors, ELMA will not publish it.
With a semantic error, the process runs but it does not work as you expected. To track down the error, you need to:
Published and outdated versions are debugged on the Scripts tab of ELMA Designer. There, you can debug the process step by step and examine the current variable values.
Attention!
Script debugging should be performed on a test server, since the server is stopped during step-by-step debugging. During debugging, the server executes the script steps, stopping the work to get a response from the debugger. If you start debugging on the production server, ELMA users will not be able to interact with the system until the script debugging is completed. Moreover, during the debugging changes are made to the database, which are undesirable on a production server.
To move the debugged process from the production server to the test server and back use the configuration export/import feature.
Step-by-step debugging in done in SharpDevelop or Microsoft Visual Studio. Note, that the possibility to debug in Visual Studio is available only if you have Microsoft Visual StudioCommunity/Enterprise 2010-2015 installed.
To start a script debugging, click Debugging or Debugging in VisualStudio in the toolbar.
The Connecting to a process for debugging window will open, in which you need to select the ELMA web server (fig. 1).
EleWise ELMA.WebServer.Service.exe – process name for the Cassini web server, provided with the ELMA distribution and used as the web server by default.
W3wp.exe – process name for the Internet Information Services (IIS) web server. This is a standard web server for Microsoft Windows Server operating systems.
Select a web server process, used for the ELMA server and click OK.
Fig. 1. Dialog box for selecting a process
After connecting to the web server, the scripts module will open for debugging in the selected environment. In ELMA Designer, the scripts module will not be available for editing.