Event
An event is very similar to a trigger, where an event is fired automatically when a change is made to a table.
Creating an Event
To create an event:
Bring up the Actions and Events (Other > Actions/Events)
Click on Add Action/Event
Entry Information:
Entry Type - Change to Event.
Entry Subtype - defines when the event is run or triggered (when a row changes). Choices are Pre-Insert, Post-Insert, Pre-Update, Post-Update, Pre-Delete or Post-Delete.
Event Name - Unique name assigned to event.
Active - Provides ability to turn off event without removing it.
Description - A detailed description of the event.
Event Scope:
Source Application - Lets the user limit when the event is to run to a specific application.
Source Operation - Lets the user limit when the event is to run to a specific operation.
Table That Triggers Event:
You need to identify which table (when changed) triggers the event.
Source Connection - Defines which connection is used to change the table. Choose between any of the existing connections. Connection choice “** INTERNAL CONNECTION **” refers to the metadata connection used by WOW. This connection should only be used when utilizing a built-in WOW class such as planetj.wow.repository.SaveSnapshotOfWowObjectAction.
Source Table - Identifies the table to attach the event or trigger to.
Action/Event Execution Information:
This defines what gets run by the event. You need to specify either an operation or a Java class.
Operation - Select an operation to be called. If the operation is an association operation, then the current Row is passed as the associated Row (for parameter substitution).
Java Class - Specifies a Java class file that is a subclass of planetj.wow.action.AbstractAction and implements the handleAction method:
Java Classes Provided by WOW:
planetj.wow.repository.SaveSnapshotOfWowObjectAction - Used to save a snapshot of WOW objects (Operations, Field Descriptors) when an operation or field descrptor is changed.
planetj.dataengine.email.SendEmailForLogEntryEvent - Used to send an email automatically when a table is changed. A user configures an email log entry and specifies the entry ID as a class parameter. e.g. planetj.dataengine.email.SendEmailForLogEntryEvent,id=1 .
Parameters supported:
id - log ID from EMAILLOG.
mlib - optional WOW email library.
NOTE: This class is only available with the WOW Mail add-on. More details available with WOW Email documentation.
NOTE: Class files written as a subclass of AbstractAction are compatible for both Actions and events.