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:

arrow icon   To format summary message actions:

  1. Display the alert that you want to format summary actions for in the Alerts form.

  2. Choose Alert Details.

  3. In the Outputs tabbed 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.

  4. Save your changes.

  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 Wrap or Truncate 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.

    If you choose Wrap, Oracle Alert uses as many lines as necessary to display the output value. If you choose Truncate, Oracle Alert truncates a column at the start of the next column, or at the page width (right margin), if it is the last column.

    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.

    If you choose column wrap, Oracle Alert appends a hyphen to the end of each line that ends in the middle of a word, to indicate that the word continues on the next line. If a line ends on a space or on the last letter of a word before a space, Oracle Alert does not add a hyphen, but simply wraps the remaining words onto the next line. For example, an output value might appear in a column as follows:

     Mai-
    		ling
    		list
    		for 
    		ale-
    		rts
    

    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 22 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 and appends a hyphen to the end of a line when the line break occurs in the middle of a word. 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.

  10. Constant text is any non-output text that you include in the summary message. You can place constant text within the summary message template instead of, or in addition to, any column headings you include outside the summary template. For example, you may want to precede a money column with "$," or you may want to label a column "Purchase order line:".

  11. Oracle Alert automatically prints your summary messages in an appropriate format. If a message is narrower than 80 characters, Oracle Alert prints it in a standard portrait orientation. If a message is between 81 and 132 characters wide, Oracle Alert prints it in landscape orientation, with the 132 columns along the long edge of the paper. If a message is between 133 and 180 characters wide, Oracle Alert also prints it in a landscape orientation, but compresses the font or character size. You never need to worry about not being able to see the information in your messages.

  12. Save your changes.

    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.

arrow icon   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'  

arrow icon   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.

Related Topics