|
|
EventHandler OverviewEventHandlers 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 EventHandlerIn 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 ObjectThe 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 FlowEach 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. PrologIn 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 MapIn 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. ConditionsIf 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 ActionsEach action in the action list could be any one of these:
Attribute/Property NamesIf 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. EpilogThis section is executed after the action map has been completed.
|
|
|