Oracle Workflow Guide
Release 2.6.2

Part Number A95265-03
  Go to previous page Go to next page       Go To Table Of Contents Go To Index Go To Table Of Contents

                     Contents  Index  Glossary Master Index Feedback

Example for Using Abstract Datatypes

The following example shows some ways to use abstract datatype methods in a SQL script, including:

Attention: You must call the Initialize method before you can perform any further manipulation on a new WF_EVENT_T object.

The example code is from the script wfevtenq.sql, which enqueues an event message on a queue using an override agent. See: Wfevtenq.sql.

l_overrideagent varchar2(30) := '&overrideagent';
l_overridesystem varchar2(30) := '&overridesystem';
l_fromagent varchar2(30) := '&fromagent';
l_fromsystem varchar2(30) := '&fromsystem';
l_toagent varchar2(30) := '&toagent';
l_tosystem varchar2(30) := '&tosystem';
l_eventname varchar2(100) := '&eventname';
l_eventkey varchar2(100) := '&eventkey';
l_msg varchar2(200) := '&message';
l_clob clob;
l_overrideagent_t wf_agent_t;
l_toagent_t wf_agent_t;
l_fromagent_t wf_agent_t;
l_event_t wf_event_t;

/*You must call wf_event_t.initialize before you can manipulate
a new wf_event_t object.*/
 l_overrideagent_t := wf_agent_t(l_overrideagent,
l_toagent_t := wf_agent_t(l_toagent, l_tosystem);
l_fromagent_t := wf_agent_t(l_fromagent, l_fromsystem);
 if l_msg is null then
l_event_t.Content(l_eventname, l_eventkey, null);
dbms_lob.createtemporary(l_clob, FALSE, DBMS_LOB.CALL);
dbms_lob.write(l_clob, length(l_msg), 1, l_msg);
l_event_t.Content(l_eventname, l_eventkey, l_clob);
end if;
 l_event_t.Address(l_fromagent_t, l_toagent_t, 50, sysdate);
 wf_event.enqueue(l_event_t, l_overrideagent_t);

         Previous  Next          Contents  Index  Glossary

Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.