Formatting Summary Message Actions
Oracle Alert can perform a summary message action on a combination of the exceptions found during an alert check, rather than on each exception found. You determine the combination of exceptions, and define the summary message action you want Oracle Alert to perform for each combination. You can take advantage of sophisticated formatting options in summary message actions and create alert messages that look exactly how you want them to look.
You have complete control over the layout of your summary message. When you create your alert you may need a particular message format; for example, you may want to recreate the layout of a purchase order in your alert message. You can define your summary message action so that Oracle Alert sends a separate summary message for each purchase order found during an alert check.
You specify the format of a summary message in two Oracle Alert windows:
- In the Outputs alternative region of the Alert Details window in the Alerts form
- In the Action Details block of the Actions window in the Alerts form
To format summary message actions:
1. Display the alert that you want to format summary actions for in the Alerts form.
3. In the Outputs alternative region, specify the maximum number of characters that you want Oracle Alert to display for each output used in your alert. You indicate how many characters of data you want Oracle Alert to display for each output in detail actions, and how many characters you want Oracle Alert to display in summary actions.
5. Choose Actions in the Alerts form.
6. Select the summary message action you want to format.
7. Choose Action Details in the Actions window.
8. Enter a value in the Max Width field to specify the maximum width of your message. Select 80 for portrait format, 132 for landscape format, and 180 for compressed landscape format. The default is 80.
9. Choose Truncate or Wrap in the Column Overflow field to specify whether you want Oracle Alert to wrap exception data that exceeds your defined column widths.
A "column" in a message action is the space you allot for Oracle Alert to display the data it substitutes for an output. Use column wrap so that you can display large amounts of data within your summary message.
When Oracle Alert constructs a message, each column starts at the ampersand (&) of the output name and ends two characters before the next output. Oracle Alert always leaves one blank space between columns.
Oracle Alert considers the rightmost column in an alert message to start with the ampersand of the output name and end with the last character allowed by the defined message width. If the last column contains numeric data, the width of that column can be a maximum of 15 characters. If you want a numeric column to be wider than 15 characters, place the column in a location other than the last column of the message.
Note: Oracle Alert does not wrap numeric data within a column. If the number cannot fit within the column, Oracle Alert displays "###" across the width of the column. You should expand the width of this column within the message definition.
Oracle Alert ignores any columns that you place outside the defined message width. For example, if you define a message width of 132 characters, then place an output beginning in column 140, Oracle Alert ignores it and does not include that information in the message.
Suppose you have an output with a defined maximum length of 60, and you place the output in the Summary Message Template. You format your summary message such that there are 21 characters between the first character of the output and first character of the next output, keeping in mind that Oracle Alert always leaves one blank space between columns. During an alert check, the exception data that Oracle Alert substitutes for the output is more than 60 characters long. Because you have turned column wrap on, Oracle Alert displays 60 characters of the data on three lines of 20 characters each. Oracle Alert "wraps" the data so that 60 characters of it is displayed in your summary message.
Example
Suppose that you are creating an alert that sends a message to the responsible purchasing agent informing that agent of unapproved purchase orders. You have several possible message formats you can define.
The Select Statement
Your alert Select statement looks like this:
SELECT h.po_number,
v.vendor,
h.description,
a.email_address,
l.line_number,
l.item,
l.quantity,
l.price
INTO &PO,
&VENDOR,
&DESC,
&AGENT,
&LINE,
&ITEM,
&QTY,
&PRICE
FROM po_headers h,
po_lines l,
po_vendors v,
po_agents a
WHERE h.header_id = l.header_id,
h.agent_id = a.agent_id,
h.vendor_id = v.vendor_id,
h.approved_flag = 'N'
Your Summary Message Format
You can define your summary message to include all of a purchasing agent's purchase orders into one summary message, or you can send a separate summary message for each purchase order.
For a single summary message per purchasing agent, you can define your summary message action as shown below. Notice the use of constant text within the summary message template.
To: &AGENT
Cc:
Bcc:
Subject: Your unapproved purchase orders
=**= Enter summary template below this line =**=
** PO Number: &PO Vendor: &VENDOR
Description: &DESC
Line: &LINE Item: &ITEM
Quantity: &QTY Price: $&PRICE
=**= Enter summary template above this line =**=
Using this definition, Oracle Alert will send one message to each purchasing agent that lists that agent's unapproved purchase orders. Each exception that Oracle Alert lists in the message will be an individual purchase order line from an unapproved purchase order.
If you want to send a separate summary message to the purchasing agent for each unapproved purchase order, you can define your summary message action like this:
To: &AGENT
Cc:
Bcc:
Subject: Unapproved purchase order &PO
PO Number: &PO Vendor: &VENDOR
Description: &DESC
Line Item Description Quantity Price
---- ---------------- -------- -----
=**= Enter summary template below this line =**=
** &LINE &ITEM &QTY $&PRICE
=**= Enter summary template above this line =**=
In this example, Oracle Alert constructs a distinct message for each unapproved purchase order. That is, Oracle Alert constructs a separate message for each unique combination of exceptions substituted for the outputs you place outside the summary message template. You can change the construction of the message simply by moving an output inside or outside the summary message template.
See Also
Creating a Periodic Alert
Creating an Event Alert
Creating Alert Actions