WebFOCUS Online Help > Managed Reporting Developer > ReportCaster Alerts > Components of an Alert
In this section: Reference: |
The ReportCaster Alert feature requires the following components:
A ReportCaster Alert consists of the following:
An alert test procedure is required to check whether or not a set of defined test conditions (rules) is met (true or false). An alert test is either a "WebFOCUS Test" that is a simple TABLE request you create to define the condition to test for or, a "Test for File Existence" of a file that is accessible to the WebFOCUS Reporting Server to which the alert test is submitted.
If you select WebFOCUS Test, you are prompted to create the Alert test using either the Report Assistant or the Editor. The version of Report Assistant that is invoked does not have field styling, heading, footing or report options (such as OLAP and On-demand Paging) because the Alert Test determines whether a specified condition is true; it is not the report that is distributed.
The most important component of the Alert test is the condition (WHERE statement) you create. The condition determines if the alert is triggered (true). If you use the editor, be sure to keep the TABLE request simple. The TABLE request should only contain the fields to evaluate the condition (WHERE statement), and an ON TABLE HOLD statement - that is all. When you save the request, it is validated to ensure you have included the ON TABLE HOLD statement.
If the conditions are true, an alert event procedure is executed. An alert event procedure specifies the report to be distributed. You have the option of using the Report Assistant to create the report (this time with all the functionality available for styling and report options) or you can select an existing Managed Reporting report that resides in the same domain.
Once an alert is created, it is stored in the Managed Reporting Repository.
Considerations: One thing to keep in mind is the flexibility of editing the request for the report to be distributed. If you choose to create the alert event procedure using Report Assistant from within the Alert Wizard you have to go back through the Alert Wizard and select the New WebFOCUS Report option again to edit the request. This is because the Alert test and the report to distribute are contained within a single Standard Report. Therefore, it is recommended that you select an existing Standard Report as it is easier to access Report Assistant to make changes and it is also available to run interactively or schedule independently of the Alert.
In the sample code that follows, an Alert test is created with the Editor and a report to be distributed is created with Report Assistant. To keep the sample code simple, styling and report options such as report headings and conditional styling are not included in this request. The Alert tests for products that have an inventory quantity greater than 20000.
Notice after the first TABLE request there is an –IF statement that checks if the number of lines in the report is greater than zero (–IF &LINES GT 0). This checks to see if the Alert should be triggered (true). If the number of lines is greater than 0, then there are records that satisfy the condition and the report is distributed. If the number of lines is 0, then there are no records that satisfy the condition and the second TABLE request (the distributed report), does not run.
The following is the Alert test sample code:
-* Created by Alert Wizard -* version 1.0 -* start of the test report SUM CENTINV.INVINFO.QTY_IN_STOCK BY CENTINV.INVINFO.PRODCAT BY CENTINV.INVINFO.PRODTYPE BY CENTINV.INVINFO.PRODNAME BY CENTINV.INVINFO.PROD_NUM WHERE (CENTINV.INVINFO.QTY_IN_STOCK GT 20000); ON TABLE HOLD END -* end of the test report -* start of the test -RUN -IF &LINES EQ 0 GOTO ALERTEXIT; -* end of the test -* start of the output report created by Report Assistant -* FF Line do not change this line! Field Name -* FF Line do not change this line! Alias -* FF Line do not change this line! Format -* FF Line do not change this line! Segment -* FF Line do not change this line! displayTree=0TABLE FILE CENTINV SUM CENTINV.INVINFO.QTY_IN_STOCK BY CENTINV.INVINFO.PRODCAT BY CENTINV.INVINFO.PRODTYPE BY CENTINV.INVINFO.PRODNAME BY CENTINV.INVINFO.PROD_NUM WHERE (CENTINV.INVINFO.QTY_IN_STOCK GT 20000); ON TABLE SET HTMLCSS ON ON TABLE NOTOTAL END -* End Report Assistant output -* start of the options -* TWO_WAY_EMAIL= -* TWO_WAY_EMAILDOMAIN= -* TWO_WAY_EMAILDESCRIPTION= -* TWO_WAY_EMAILFOLDER= -* end of the options -ALERTEXIT -* End Alert Wizard
The following sample code shows an Alert test created with Report Assistant that uses an existing Standard Report to distribute. Note the –INCLUDE of the existing Standard Report. This Standard Report can be edited without going through the Alert Wizard.
-* Created by Alert Wizard -* version 1.0 -* start of the test report -* Created by Report Assistant -* FF Line do not change this line! Field Name -* FF Line do not change this line! Alias -* FF Line do not change this line! Format -* FF Line do not change this line! Segment -* FF Line do not change this line! displayTree=0 TABLE FILE CENTINV SUM CENTINV.INVINFO.QTY_IN_STOCK BY CENTINV.INVINFO.PRODCAT BY CENTINV.INVINFO.PRODTYPE BY CENTINV.INVINFO.PRODNAME BY CENTINV.INVINFO.PROD_NUM WHERE (CENTINV.INVINFO.QTY_IN_STOCK GT 20000); ON TABLE HOLD ON TABLE SET HTMLCSS ON ON TABLE NOTOTAL END -* End Report Assistant -* end of the test report -* start of the test -RUN -IF &LINES EQ 0 GOTO ALERTEXIT; -* end of the test -* start of the output report -* Description at creation time -**Inventory Quantity Exception Report -INCLUDE app/inventor.fex -* end of the output report -* start of the options -* TWO_WAY_EMAIL= -* TWO_WAY_EMAILDOMAIN= -* TWO_WAY_EMAILDESCRIPTION= -* TWO_WAY_EMAILFOLDER= -* end of the options -ALERTEXIT -* End Alert Wizard
The following image diagrams how ReportCaster Alert processing works.
You can specify a description, run interval, and start time on the ReportCaster Scheduling tab.
You can schedule the following alert schedule options:
Note that a Two-Way Email template can be attached to provide alert response capability.
As you complete the creation of the schedule remember to consider the burst option to distribute specific report values instead of the entire report. When a report is burst the distribution information must be provided in a distribution list, distribution file, or dynamic list for Email distribution and an access list for Library distribution. The Email and Library distribution options are the most effective for Alert reports because of the push vs. pull notification via e-mail. For more information on using the burst option in ReportCaster, see your ReportCaster documentation.
WebFOCUS |