Skip to content

Settings Menu: Event Handlers

Use the Technology tab in the Event Handler Settings dialog box to determine which language you want to use for event handlers. Each model can support event handlers written in either Java or .NET technology.

  • Java
  • .NET with C#
  • Default all models to the selected technology - All models created within the Design Tool will use the selected technology as the default.

Editing

Use the Editing tab in the Event Handler Settings dialog box to configure the source code editor you want to use for creating or modifying event handlers.

This setting is stored in the Windows registry as a per-user setting.

Note

Other properties for event handling can be stored in properties files.

Available Editors Description
Source Code Specify the command to launch the editor whenever you choose to edit source code for a script. Host Integrator searches for the presence of common Java editors and selects it as the source code editor if one is found. Otherwise, a text editor is selected as the default.
Java With Java as the selected technology, if a Java editor is found on your machine it is displayed here. This option is the default.
C# With .NET with C# as the selected technology, if a C# editor is found on your machine it is displayed here. This option is the default.
Text This is the default if no Java editor is found on your machine. Notepad is the default.
Other You can specify another editor. Click Browse to locate it, or use the command syntax below. The %p is automatically appended to the string when you locate the editor by clicking Browse. This example uses an alternate editor: "C:\Program Files\TextPad 4\TextPad.exe" "%p"

Note

If you're having trouble opening source code when you click the Edit button (), a quick workaround is to change your editor selection to a text editor such as Notepad. You may need to specify a custom string for the Other editor option to use the editor of your choice.

Command Syntax

The name of any external command should use Windows conventions:

  • Either UNC syntax or drive:path syntax.
  • Spaces in command or path names require that the entire command be in quotes.

The parameters used with commands support the following escape codes to further specify file and directory information for editing and compiling scripts:

  • %f—source file name (no directory)
  • %p—source file name as fully qualified path name
  • %d—source file directory containing the file
  • %s—root of the model source file directory
  • %l—root of the model lib directory
  • %%—literal "%" character

Building

Use the Building tab in the Event Handler Settings dialog box to determine what happens when you rebuild event handlers. Other properties for event handling can be stored in properties files.

  • When event handler libraries change

    Choose to automatically reload event handlers each time you make a change, or to reload only when a rebuild or reload command is executed.

    This setting is stored in the model file and can be saved to a settings file (.dtool) with other configuration information.

  • Event handler classpath

    In Java, this is the non-event handler libraries classpath to be searched to satisfy external class references in the event handlers, both when compiling and at run time. The classpath is stored in a properties file; the path cannot be changed here.

Note

In .NET, event handler implementation does not include classpath support.

Debugging

Use the Debugging tab in the Event Handler Settings dialog box to configure your debugging options. These settings are stored in the Windows registry as per-user settings. For Java, Event Handler debugging allows a third-party Java IDE debugger to connect to the Host Integrator script server. Each Design Tool instance starts its own script server instance.

Java Debug Port

  • Disable debug port

    This option disables listening on the debug port. It is enabled by default.

  • First port to try

    Design Tool starts searching for an available remote debugging port at the port selected here. The default value is 5006. This value is saved as a per-user setting. If another Script Server instance is already running at the setting specified here, the next available port is used.

  • Debug port assigned

    This is the JVM remote debug port that is currently in use. This is a read-only setting. You may need to configure your Java IDE if the Debug port assigned is other than the default 5006 or if you will be doing remote debugging with the Java IDE running on a separate system instead of localhost. A value of zero indicates that the event handler has the debug port disabled.

Event handler console (Java and .NET)

Select Show when Design Tool starts to open the event handler console automatically when the Design Tool opens. You can open the console manually from the Debug menu or from the Event Handler toolbar. These debugging settings apply to script server instances started by Design Tool. The Host Integrator Session Server runs its own separate script server instance, but you must restart the server in order to change event handler debug settings.

Environment

Use the Environment tab in the Event Handler Settings dialog box to configure your event handler development environment.

Default event handler timeout

This is the event handler timeout used when a timeout is not specified for a particular event. The default is 10 seconds. If the event handler exceeds this timeout when processing an event, a timeout error is generated. This setting requires that event timeout be enabled. This setting is saved as part of the model.

Client application credentials

These options specify client application credentials sent to an event handler when a client connection event is simulated by the Design Tool. They are stored in the model file, but they cannot be saved as part of a settings file (.dtool).

The test parameters for User name and Password are used to supply the credentials for an Authenticate user event in a life cycle event handler. When using the Session Server, credentials are supplied by a client connection as the "userid" and "password" parameters to a Connect method.