This chapter contains the following topics:
This chapter provides an overview of table event rules and discusses how to work with table event rules.
Use table event rules to attach database triggers (or programs) that automatically run whenever an action occurs against the table. An action against a table is called an event. When you create a database trigger in Oracle's JD Edwards EnterpriseOne, you must first determine which event activates the trigger and then use Event Rules Design to create the database trigger.
Table event rules provide embedded logic at the table level. Table event rules have their own location, events, and system functions. When you use table event rules, neither the calling application nor the user is notified of changes or events to the table. No form or report interconnect is available with table event rules.
You can use table event rules for data integrity. For example, when you delete a record in Oracle's JD Edwards EnterpriseOne Address Book, you might want to delete all associated records, such as phone and category codes. You can also use table event rules for currency. The Currency Conversion is On event rule handles currency information in table event rules.
You can attach event rules on a table-by-table basis to these events:
After Record is Deleted
After Record is Fetched
After Record is Inserted
After Record is Updated
Before Record is Deleted
Before Record is Inserted
Before Record is Updated
Currency Conversion is On
This table describes the functions that you can use in table event rules:
You do not need to create and associate data structures to table event rule functions. The table itself is the data structure that is passed to the table event rule function.
This section provides an overview of table event rule triggers and discusses how to add table event rules to table conversions.
To create table event rules, you must:
Create the table trigger in Event Rules Design.
Generate the JD Edwards EnterpriseOne table trigger as C code.
Build the table trigger.
When you build table triggers, the system performs these actions:
Converts the event rule to C source code, which creates the files OBNM.c and OBNM.hxx (OBNM = Object Name).
The source file contains one function per table event rule event.
Creates a make file to compile the generated code.
Runs the make file to compile the new functions and to add them into JDBTRIG.DLL.
This consolidated DLL contains table event rule functions.
Access the Object Management Workbench form.
Check out the table to which you want to attach event rules and click Design.
On the Table Design form, select the Design Tools tab and click Start Table Trigger Design Aid.
Select an event from the Events list.
On Event Rules Design, click one of the event rule buttons and complete the event rules.
Click Save to save the event rule specifications and then click Close.
If you are creating a new table in Oracle's JD Edwards EnterpriseOne Table Design Aid, select the Table Operations tab and click Generate Table.
Important:
Never perform this step on an existing table because it clears all data.On the Generate Table form, complete these fields and click OK:
Data Source
Password
On the Table Design form, select the Design Tools tab and click Build Table Triggers.
To review a log of the build, select Generate Header File, and then open the file that the system created.
The creation of the table event rules is complete. The newly created or modified table event rule is called from the JD Edwards EnterpriseOne database middleware whenever the corresponding event occurs against the table.