Skip Headers
Oracle Workflow Developer's Guide
Release 2.6.3.5
Part Number B12161-02
|
|
|
|
|
|
|
|
|
Previous |
Next |
|
Contents |
Index |
Glossary |
To Define a Document Attribute
You can identify the following types of document for a document attribute:
- An Oracle Applications Framework region (Oracle Applications only)
2. A PL/SQL document represents data from the database as a character string, generated from a PL/SQL procedure. Specify the default value of a PL/SQL document as
plsql:<procedure>/<document_identifier>
Replace <procedure> with the PL/SQL package and procedure name, separated by a period. Replace <document_identifier> with the PL/SQL argument string that you want to pass directly to the procedure. The argument string should identify the document.
Note: The PL/SQL procedure must follow a standard API format. See: Standard APIs for "PL/SQL" Documents.
For example, the following string represents the PL/SQL document, po_req:2034, generated by the procedure po_wf.show_req.
plsql:po_wf.show_req/po_req:2034
Note: The maximum length of the data that a PL/SQL document can contain is 32 kilobytes. If you expect your document to exceed 32 Kb, you should use a PL/SQL CLOB document to hold the data instead.
A PL/SQL document can either be displayed in the message body of a notification or included as an attachment to the notification.
3. A PL/SQL CLOB document represents data from the database as a character large object (CLOB), generated from a PL/SQL procedure. Specify the default value of a PL/SQL CLOB document as
plsqlclob:<procedure>/<document_identifier>
Replace <procedure> with the PL/SQL package and procedure name, separated by a period. Replace <document_identifier> with the PL/SQL argument string that you want to pass directly to the procedure. The argument string should identify the document.
Note: The PL/SQL procedure must follow a standard API format. See: Standard APIs for "PL/SQL" and "PL/SQL CLOB" Documents.
For example, the following string represents the PL/SQL CLOB document, po_req:2036, generated by the procedure po_wf.show_req_clob.
plsqlclob:po_wf.show_req_clob/po_req:2036
A PL/SQL CLOB document that contains text or HTML can either be displayed in the message body of a notification or included as an attachment to the notification.
PL/SQL CLOB documents do not support further substitution of message attribute tokens. The text or HTML contents of the CLOB are printed in a message body just as they are generated by the PL/SQL procedure.
- Do not use tokens within the CLOB.
- Ensure that the PL/SQL procedure performs any formatting you require.
A PL/SQL CLOB document that you include as an attachment to a notification can also contain a PDF or RTF document or, if your database version is Oracle9i Database or higher, other binary data encoded to base64. You should first store the document in the database as a binary large object (BLOB) and then convert the document into a CLOB as part of the PL/SQL procedure you use to produce the CLOB. See: Standard APIs for "PL/SQL" Documents.
You can use the UTL_RAW.Cast_To_VARCHAR2 function to convert PDF or RTF data from the BLOB into VARCHAR2 data that you write to a CLOB. If your database version is Oracle9i Database or higher, you can optionally use the WF_MAIL_UTIL.EncodeBLOB procedure to encode the binary data to base64. See: UTL_RAW, Oracle Supplied PL/SQL Packages and Types Reference and EncodeBLOB, Oracle Workflow API Reference.
Note: Oracle8i Database does not support base64 encoding, so if you are using Oracle8i Database, the WF_MAIL_UTIL.EncodeBLOB procedure is not available, and you cannot store binary data other than PDF or RTF documents in a PL/SQL CLOB document. This feature is available only if you are using Oracle9i Database and higher.
However, both Oracle8i Database and Oracle9i Database and higher support the UTL_RAW.Cast_To_VARCHAR2 function, so you can store PDF and RTF documents in an attached PL/SQL CLOB document on any of these database versions.
4. A PL/SQL BLOB document represents data from the database as a binary large object (BLOB), generated from a PL/SQL procedure. Specify the default value of a PL/SQL BLOB document as
plsqlblob:<procedure>/<document_identifier>
Replace <procedure> with the PL/SQL package and procedure name, separated by a period. Replace <document_identifier> with the PL/SQL argument string that you want to pass directly to the procedure. The argument string should identify the document.
Note: The PL/SQL procedure must follow a standard API format. See: Standard APIs for "PL/SQL" Documents.
For example, the following string represents the PL/SQL BLOB document, po_req:2038, generated by the procedure po_wf.show_req_blob.
plsqlblob:po_wf.show_req_blob/po_req:2038
PL/SQL BLOB documents do not support further substitution of message attribute tokens.
A PL/SQL BLOB document can contain an image or an application file stored as binary data, such as a PDF or RTF document or other types of files. You can include a PL/SQL BLOB document as an attachment to a notfication. However, this type of document cannot be displayed in the message body of a notification.
5. If you wish to generate the document identifier for a PL/SQL, PL/SQL CLOB, or PL/SQL BLOB document dynamically, you can token substitute the document identifier with other item type attributes. The item attribute names must be in uppercase and must be separated by a colon. See: To Token Substitute an Attribute.
plsql:po_wf.show_req/&ITEM_ATTR1:&ITEM_ATTR2
Note: If you are defining a message attribute of type Document, you can also include a special token in your argument string called &#NID which Oracle Workflow substitutes with the notification ID of the runtime notification.
6. You can also use an attribute of type document to reference an Oracle Applications Framework region that you want to embed in a notification message. Specify the JSP call to reference the region as the default value for the attribute. See: Embedding Oracle Applications Framework Regions in Messages.
An Oracle Applications Framework region can only be displayed within the message body of a notification. It cannot be included as an attachment to the notification.
7. Choose OK when you are done.
Copyright © 2003, 2004, Oracle. All rights reserved.