Modifying Workflow Process to include document attribute [message #130986] |
Wed, 03 August 2005 14:00 |
nvillare
Messages: 11 Registered: July 2005
|
Junior Member |
|
|
I am trying to modify a standard Oracle Workflow Process, AP Invoice, to include the Approval History through a document attribute. I am having much trouble doing this. I did the training, but the book really hasn't helped at all. I'm stuck. Does anyone know how to create document attributes in the process and call it from the package/procedure?
Any help is greatly appreciated.
Thanks,
|
|
|
Re: Modifying Workflow Process to include document attribute [message #131069 is a reply to message #130986] |
Thu, 04 August 2005 03:47 |
adragnes
Messages: 241 Registered: February 2005 Location: Oslo, Norway
|
Senior Member |
|
|
Maybe an example will help. In Workflow Builder add an attribute to the message you want to use the PL/SQL-document in as follows:
- Internal Name: APPROVAL_HISTORY
- Display Name: Approval History
- Description: Approval History
- Type: Document
- Source: Send
- Frame Target: Full Window
- Default Type: Constant
- Default Value: plsql:xx_wf_apinv.get_aprvl_hist_doc/&INVOICE_ID
INVOICE_ID is the internal name of another message attribute containing the INVOICE_ID of the invoice in question.
Then you have to define a procedure to return the document. Package specification:
CREATE OR REPLACE PACKAGE xx_wf_apinv
/**
* Custom queries and commands for use in the AP Invoice Approval
* workflow (APINV).</p>
*/
AS
/**
* PL/SQL document to workflow...
*
* <p><strong>Preconditions:</strong>
* <ul>
* <li>document_id is not null.</li>
* <li>display_type is not null and either 'text/html' or ''.</li>
* <li>document_id is a NUMBER</li>
* <li>There exists an invoice in AP_INVOICES_ALL with INVOICE_ID = document_id.</li>
* </ul></p>
*
* <p><strong>Postconditions:</strong>
* <ul>
* <li>document_type = display_type</li>
* <li>document is not null.</li>
* <li>document contains...</li>
* </ul>
* <br />
*
* @param document_id String that uniquely identifying document. Sould be invoice_id of
* an invoice in AP_INVOICES_ALL.
* @param display_type Content type used for notification presentation, either
* 'text/html' for inline html or '' for attached html. Currently no
* support for 'text/plain'.
* @param document The outbound text buffer where up to 32K of document text
* is returned.
* @param document_type Outbound text buffer where document content type
* returned.
*/
PROCEDURE get_aprvl_hist_doc(
document_id IN VARCHAR2
, display_type IN VARCHAR2
, document IN OUT VARCHAR2
, document_type IN OUT VARCHAR2
);
END xx_wf_apinv;
Package body
CREATE OR REPLACE PACKAGE BODY xx_wf_apinv
/**
* Custom queries and commands for use in the AP Invoice Approval workflow
* (APINV). See package specification for details.
*/
AS
c_pkg CONSTANT VARCHAR2(30) := 'xx_wf_apinv';
PROCEDURE get_aprvl_hist_doc(
document_id IN VARCHAR2
, display_type IN VARCHAR2
, document IN OUT VARCHAR2
, document_type IN OUT VARCHAR2
)
IS
c_mtd CONSTANT VARCHAR2(30) := 'get_aprvl_hist_doc';
l_invoice_id ap_invoices_all.invoice_id%TYPE := TO_NUMBER(document_id);
BEGIN
document := '...';
document_type := display_type;
EXCEPTION
WHEN OTHERS THEN
wf_core.context( c_pkg
, c_mtd
, document_id
, display_type
);
RAISE;
END get_aprvl_hist_doc;
END xx_wf_apinv;
--
Aleksander Dragnes
|
|
|