The PL/SQL procedure that generates a PL/SQL document must have the following standard API:
procedure <procedure name> (document_id in varchar2, display_type in varchar2, document in out nocopy varchar2, document_type in out nocopy varchar2)
The arguments for the procedure are as follows:
| document_id | A string that uniquely identifies a document. This is the same string as the value that you specify in the default value field of the Attribute property page for a "PL/SQL" document (plsql:<procedure>/<document_identifier>). <procedure> should be replaced with the PL/SQL package and procedure name in the form of package.procedure. The phrase <document_identifier> should be replaced with the PL/SQL argument string that you want to pass directly to the procedure. The argument string should identify the document. For example: plsql:po_wf.show_req/2034. If you wish to generate the PL/SQL argument string value dynamically, create another item attribute, and reference that item attribute as "&ITEM_ATTRIBUTE" in place of the PL/SQL argument string. Then before any activity that references this other item attribute gets executed, call the WF_ENGINE.SetItemAttribute API to dynamically set the PL/SQL argument string value. For example: plsql:po_wf.show_req/&POREQ_NUMBER. |
| display_type | One of three values that represents the content type used for the notification presentation, also referred to as the requested type:
|
| document | The outbound text buffer where up to 32K of document text is returned. |
| document_type | The outbound text buffer where the document content type is returned. Also referred to as the returned type. If no type is supplied, then 'text/plain' is assumed. For a document that will be attached to the notification, the value for this argument can also include a file name for the attachment. If you do not specify a file name for the attachment as part of this argument, then Oracle Workflow uses the message attribute display name as the base file name and checks its list of defined MIME types and subtypes to determine the file extension, based on the display_type argument. If the MIME type and subtype specified in the display_type argument are not defined within Oracle Workflow, then the name of the specified subtype is used as the file extension. However, note that for some subtypes the file extension differs from the subtype name. Consequently, you must explicitly specify the file name for the attachment in the document_type parameter if either of the following conditions applies:
To specify a file name as part of the document_type argument, use a semicolon (';') to separate the file name from the preceding value in the argument, and specify the file name in the format 'name=<filename>' with no spaces before or after the equal sign ('='). For example, you can set a value for the document type with the following command: document_type := 'text/html; name=filename.htm'; Note: If the file name contains a semicolon (;) or an equal sign (=), then you should include a backslash (\) as an escape character preceding the semicolon or equal sign. For example, if the file name is my;document.htm then set the document_type value as follows: document_type := 'text/html; name=my\;document.htm'; |