|Oracle Fusion Middleware Data Modeling Guide for Oracle Business Intelligence Publisher (Oracle Fusion Applications Edition)|
Release 11g (11.1.1)
Part Number E21074-01
This chapter covers the following topics:
An event trigger checks for an event and when the event occurs, it runs the code associated with the trigger. The BI Publisher data model supports triggers that execute a PL/SQL function stored in a PL/SQL package in your Oracle Database. A trigger must explicitly return TRUE or FALSE.
The BI Publisher data model supports the following types of triggers:
Before Data - fires before the data set is executed.
After Data - fires after the data engine executes all data sets and generates the XML.
Important: The return data type for a PL/SQL function inside the package must be a Boolean type.
From the data model Properties pane, enter the Oracle DB Default Package that contains the PL/SQL function signature to execute when the trigger fires. See Setting Data Model Properties.
From the task pane, click Event Triggers.
From the Event Triggers pane, click the Create New icon.
Enter the following for the trigger:
Type - select Before Data or After Data.
Language - select PL/SQL.
The lower pane will display the available functions in the Oracle DB Default Package you entered in the data model Properties in Step 1.
The following figure shows an event trigger:
Select the package from the Available Functions box and click the arrow to move a function to the Event Trigger box. The name will appear as PL/SQL <package name>.<function name>.
Important: If you define a default package then you must define all parameters as a global PL/SQL variable in the PL/SQL package. You can then explicitly pass parameters to your PL/SQL function trigger or all parameters will be available as a global PL/SQL variable.
If you define multiple triggers of the same type, they will fire in the order that they appear in the table (from top to bottom). To change the order of execution, use the Reorder arrows to place the triggers in the correct order.
Copyright © 2010, 2011, Oracle and/or its affiliates. All rights reserved.