*
Metamerge logo
Search

Advanced Search
*
*
*
* HOME DOCUMENTS & RESOURCES DOWNLOADS EARLY TECH ACCESS SUPPORT FAQ KNOWN ISSUES OLD VERSIONS
*

EventHandler Overview

EventHandlers are meant to simplify the task of event enabling the Metamerge server. With the EventHandlers you can configure actions to be taken using a point & click metaphor. Of course, you can also script the new EventHandlers but a few functions has been  predefined to make life easier in the event lane.

Starting the EventHandler

In the admin-tool, under the Configuration tab, there is an EventHandler tab.  If an EventHandler has the auto-start check-box set, it will start up whenever the Server is started with that configuration file. (You can disable it by the -D switch as seen under Command Line Options)

While working with the Admin-tool, you will typically start the server (and thus all your auto-started EventHandlers) simply by selecting  File|Start Server . If you want to start just one EventHandler, press the EventHandler Object tab, select the EventHandler you want to run, and press the Run Button. Some (new) EventHandlers even have their own Run button you can press while configuring the EventHandler. 

The Event Object

The key object in the EventHandlers is the event object. This object is an instance of the familiar entry object you find in AssemblyLines.

Configuration & Data Flow

Each EventHandler consists of a configuration section and a data flow section.

The configuration section contains the parameters that govern each specific EventHandler.

The data flow consists of a prolog, action map and an epilog. The prolog and epilog are executed before and after the action map. The action map contains a number of actions and dependencies for the actions. This enables you to perform simple tests and start AssemblyLines without typing a single line of script code.

Prolog

In this section you can execute script code before the action map is executed. You have access to the event object and global functions (e.g. system, main etc.) as usual.

Event Handler Action Map

In this section you add action items. Each action item has an associated list of conditions and actions. If the list of conditions is true, the actions under the On Success tab is executed, otherwise the On Fail actions are executed. If the Consume event option is set, and actions are executed, the rest of the action map is skipped. It is also possible to temporarily Disable an action item.

Conditions

If Match any condtion is set, the list of conditions evaluates to true when at least one condition is true, otherwise all conditions must be true for the list to evaluate to true. An empty list of conditions is true. Each condition can be a small script, or a test based on properties or attributes of the event object. See Attribute/Property Names

Actions

Each action in the action list could be any one of these:

  • Apply Parser - In Read Mode you set the Parser Input, and the result is put into the event object. In Write Mode you set the Parser Output, and the event object is written, unless you have specified another Entry object as the Parser Input, in which case that object is written.
  • Run AssemblyLine - Runs a named AssemblyLine. You may send the event object to the AssemblyLine as the initial work entry, by setting "Provide event object". You may even specify a connector to send to the AssemblyLine,see (runtime provided) Connector. If you set the "Wait for completion" flag, the action list waits for the AssemblyLine to finish, and sets the properties assemblyline.result, assemblyline.error and assemblyline.stats. Some of the properties may not be set, depending on what happens in the AssemblyLine.
  • Custom Script - The script may refer to the event and task objects.
  • Dump Event Object - writes the event object to the Event Handler's log file.
  • Set Property/Attribute - See Attribute/Property Names
  • Remove Property/Attribute - See Attribute/Property Names
  • Terminate Handler - terminates the Event Handler with a specified message.
Attribute/Property Names

If the name begins with 'entry.', it is assumed to be an attribute of the event object, otherwise it is a property of the event object. The same rule applies to values in a condition or "Set Property/Attribute", but strings surrounded  by quotes (") are constants.

Epilog

This section is executed after the action map has been completed.

 
*
  Metamerge Integrator version 4.5 ©Copyright Metamerge AS 2000-2002 Last edited 2002-04-30 contact us