34: --Get the directory where the output file is to be generated
35: select value
36: into utl_dir
37: from v$parameter
38: where name = 'utl_file_dir';
39:
40: --The value can be a comma separeated list, So take the first location and
41: --use that as the output directory.
42: if(instr(utl_dir, ',') <> 0) then
72: -- procedures
73: --
74: Procedure StaticQH(p_agent_names in varchar_array) AS
75:
76: fh utl_file.file_type;
77: l_generated boolean := FALSE;
78: l_atleast_one boolean;
79: l_first boolean;
80:
102: from dual;
103:
104: l_filename := 'WFAGTDFNB'||l_timestamp||'.pls';
105:
106: fh := utl_file.fopen(utl_dir, l_filename, 'w', 32767);
107:
108: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
109: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
110: utl_file.put_line(fh, '/*=======================================================================*');
104: l_filename := 'WFAGTDFNB'||l_timestamp||'.pls';
105:
106: fh := utl_file.fopen(utl_dir, l_filename, 'w', 32767);
107:
108: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
109: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
110: utl_file.put_line(fh, '/*=======================================================================*');
111: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
112: utl_file.put_line(fh, '+========================================================================+');
105:
106: fh := utl_file.fopen(utl_dir, l_filename, 'w', 32767);
107:
108: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
109: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
110: utl_file.put_line(fh, '/*=======================================================================*');
111: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
112: utl_file.put_line(fh, '+========================================================================+');
113: utl_file.put_line(fh, '| NAME |');
106: fh := utl_file.fopen(utl_dir, l_filename, 'w', 32767);
107:
108: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
109: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
110: utl_file.put_line(fh, '/*=======================================================================*');
111: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
112: utl_file.put_line(fh, '+========================================================================+');
113: utl_file.put_line(fh, '| NAME |');
114: utl_file.put_line(fh, '| WFAGTDFNB'||l_timestamp||'.pls |');
107:
108: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
109: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
110: utl_file.put_line(fh, '/*=======================================================================*');
111: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
112: utl_file.put_line(fh, '+========================================================================+');
113: utl_file.put_line(fh, '| NAME |');
114: utl_file.put_line(fh, '| WFAGTDFNB'||l_timestamp||'.pls |');
115: utl_file.put_line(fh, '| |');
108: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
109: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
110: utl_file.put_line(fh, '/*=======================================================================*');
111: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
112: utl_file.put_line(fh, '+========================================================================+');
113: utl_file.put_line(fh, '| NAME |');
114: utl_file.put_line(fh, '| WFAGTDFNB'||l_timestamp||'.pls |');
115: utl_file.put_line(fh, '| |');
116: utl_file.put_line(fh, '| DESCRIPTION |');
109: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
110: utl_file.put_line(fh, '/*=======================================================================*');
111: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
112: utl_file.put_line(fh, '+========================================================================+');
113: utl_file.put_line(fh, '| NAME |');
114: utl_file.put_line(fh, '| WFAGTDFNB'||l_timestamp||'.pls |');
115: utl_file.put_line(fh, '| |');
116: utl_file.put_line(fh, '| DESCRIPTION |');
117: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
110: utl_file.put_line(fh, '/*=======================================================================*');
111: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
112: utl_file.put_line(fh, '+========================================================================+');
113: utl_file.put_line(fh, '| NAME |');
114: utl_file.put_line(fh, '| WFAGTDFNB'||l_timestamp||'.pls |');
115: utl_file.put_line(fh, '| |');
116: utl_file.put_line(fh, '| DESCRIPTION |');
117: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
118: utl_file.put_line(fh, '| Enqueue/Dequeue functions. |');
111: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
112: utl_file.put_line(fh, '+========================================================================+');
113: utl_file.put_line(fh, '| NAME |');
114: utl_file.put_line(fh, '| WFAGTDFNB'||l_timestamp||'.pls |');
115: utl_file.put_line(fh, '| |');
116: utl_file.put_line(fh, '| DESCRIPTION |');
117: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
118: utl_file.put_line(fh, '| Enqueue/Dequeue functions. |');
119: utl_file.put_line(fh, '| |');
112: utl_file.put_line(fh, '+========================================================================+');
113: utl_file.put_line(fh, '| NAME |');
114: utl_file.put_line(fh, '| WFAGTDFNB'||l_timestamp||'.pls |');
115: utl_file.put_line(fh, '| |');
116: utl_file.put_line(fh, '| DESCRIPTION |');
117: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
118: utl_file.put_line(fh, '| Enqueue/Dequeue functions. |');
119: utl_file.put_line(fh, '| |');
120: utl_file.put_line(fh, '*========================================================================*/ ');
113: utl_file.put_line(fh, '| NAME |');
114: utl_file.put_line(fh, '| WFAGTDFNB'||l_timestamp||'.pls |');
115: utl_file.put_line(fh, '| |');
116: utl_file.put_line(fh, '| DESCRIPTION |');
117: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
118: utl_file.put_line(fh, '| Enqueue/Dequeue functions. |');
119: utl_file.put_line(fh, '| |');
120: utl_file.put_line(fh, '*========================================================================*/ ');
121: utl_file.put_line(fh,'SET VERIFY OFF;');
114: utl_file.put_line(fh, '| WFAGTDFNB'||l_timestamp||'.pls |');
115: utl_file.put_line(fh, '| |');
116: utl_file.put_line(fh, '| DESCRIPTION |');
117: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
118: utl_file.put_line(fh, '| Enqueue/Dequeue functions. |');
119: utl_file.put_line(fh, '| |');
120: utl_file.put_line(fh, '*========================================================================*/ ');
121: utl_file.put_line(fh,'SET VERIFY OFF;');
122: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
115: utl_file.put_line(fh, '| |');
116: utl_file.put_line(fh, '| DESCRIPTION |');
117: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
118: utl_file.put_line(fh, '| Enqueue/Dequeue functions. |');
119: utl_file.put_line(fh, '| |');
120: utl_file.put_line(fh, '*========================================================================*/ ');
121: utl_file.put_line(fh,'SET VERIFY OFF;');
122: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
123: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
116: utl_file.put_line(fh, '| DESCRIPTION |');
117: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
118: utl_file.put_line(fh, '| Enqueue/Dequeue functions. |');
119: utl_file.put_line(fh, '| |');
120: utl_file.put_line(fh, '*========================================================================*/ ');
121: utl_file.put_line(fh,'SET VERIFY OFF;');
122: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
123: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
124:
117: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
118: utl_file.put_line(fh, '| Enqueue/Dequeue functions. |');
119: utl_file.put_line(fh, '| |');
120: utl_file.put_line(fh, '*========================================================================*/ ');
121: utl_file.put_line(fh,'SET VERIFY OFF;');
122: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
123: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
124:
125: utl_file.put_line(fh,'create or replace package body WF_AGT_DYN_FUNCS as');
118: utl_file.put_line(fh, '| Enqueue/Dequeue functions. |');
119: utl_file.put_line(fh, '| |');
120: utl_file.put_line(fh, '*========================================================================*/ ');
121: utl_file.put_line(fh,'SET VERIFY OFF;');
122: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
123: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
124:
125: utl_file.put_line(fh,'create or replace package body WF_AGT_DYN_FUNCS as');
126:
119: utl_file.put_line(fh, '| |');
120: utl_file.put_line(fh, '*========================================================================*/ ');
121: utl_file.put_line(fh,'SET VERIFY OFF;');
122: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
123: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
124:
125: utl_file.put_line(fh,'create or replace package body WF_AGT_DYN_FUNCS as');
126:
127: utl_file.put_line(fh,'');
121: utl_file.put_line(fh,'SET VERIFY OFF;');
122: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
123: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
124:
125: utl_file.put_line(fh,'create or replace package body WF_AGT_DYN_FUNCS as');
126:
127: utl_file.put_line(fh,'');
128: utl_file.put_line(fh,'--');
129: utl_file.put_line(fh,'-- Static enqueue procedure calls ');
123: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
124:
125: utl_file.put_line(fh,'create or replace package body WF_AGT_DYN_FUNCS as');
126:
127: utl_file.put_line(fh,'');
128: utl_file.put_line(fh,'--');
129: utl_file.put_line(fh,'-- Static enqueue procedure calls ');
130: utl_file.put_line(fh,'--');
131: utl_file.put_line(fh,'PROCEDURE StaticEnqueue(p_qh_name in varchar2,');
124:
125: utl_file.put_line(fh,'create or replace package body WF_AGT_DYN_FUNCS as');
126:
127: utl_file.put_line(fh,'');
128: utl_file.put_line(fh,'--');
129: utl_file.put_line(fh,'-- Static enqueue procedure calls ');
130: utl_file.put_line(fh,'--');
131: utl_file.put_line(fh,'PROCEDURE StaticEnqueue(p_qh_name in varchar2,');
132: utl_file.put_line(fh,' p_event in wf_event_t,');
125: utl_file.put_line(fh,'create or replace package body WF_AGT_DYN_FUNCS as');
126:
127: utl_file.put_line(fh,'');
128: utl_file.put_line(fh,'--');
129: utl_file.put_line(fh,'-- Static enqueue procedure calls ');
130: utl_file.put_line(fh,'--');
131: utl_file.put_line(fh,'PROCEDURE StaticEnqueue(p_qh_name in varchar2,');
132: utl_file.put_line(fh,' p_event in wf_event_t,');
133: utl_file.put_line(fh,' p_out_agent_override in wf_agent_t,');
126:
127: utl_file.put_line(fh,'');
128: utl_file.put_line(fh,'--');
129: utl_file.put_line(fh,'-- Static enqueue procedure calls ');
130: utl_file.put_line(fh,'--');
131: utl_file.put_line(fh,'PROCEDURE StaticEnqueue(p_qh_name in varchar2,');
132: utl_file.put_line(fh,' p_event in wf_event_t,');
133: utl_file.put_line(fh,' p_out_agent_override in wf_agent_t,');
134: utl_file.put_line(fh,' p_executed out nocopy boolean)');
127: utl_file.put_line(fh,'');
128: utl_file.put_line(fh,'--');
129: utl_file.put_line(fh,'-- Static enqueue procedure calls ');
130: utl_file.put_line(fh,'--');
131: utl_file.put_line(fh,'PROCEDURE StaticEnqueue(p_qh_name in varchar2,');
132: utl_file.put_line(fh,' p_event in wf_event_t,');
133: utl_file.put_line(fh,' p_out_agent_override in wf_agent_t,');
134: utl_file.put_line(fh,' p_executed out nocopy boolean)');
135: utl_file.put_line(fh,'as');
128: utl_file.put_line(fh,'--');
129: utl_file.put_line(fh,'-- Static enqueue procedure calls ');
130: utl_file.put_line(fh,'--');
131: utl_file.put_line(fh,'PROCEDURE StaticEnqueue(p_qh_name in varchar2,');
132: utl_file.put_line(fh,' p_event in wf_event_t,');
133: utl_file.put_line(fh,' p_out_agent_override in wf_agent_t,');
134: utl_file.put_line(fh,' p_executed out nocopy boolean)');
135: utl_file.put_line(fh,'as');
136: utl_file.put_line(fh,' l_qh_name varchar2(240);');
129: utl_file.put_line(fh,'-- Static enqueue procedure calls ');
130: utl_file.put_line(fh,'--');
131: utl_file.put_line(fh,'PROCEDURE StaticEnqueue(p_qh_name in varchar2,');
132: utl_file.put_line(fh,' p_event in wf_event_t,');
133: utl_file.put_line(fh,' p_out_agent_override in wf_agent_t,');
134: utl_file.put_line(fh,' p_executed out nocopy boolean)');
135: utl_file.put_line(fh,'as');
136: utl_file.put_line(fh,' l_qh_name varchar2(240);');
137: utl_file.put_line(fh,'begin');
130: utl_file.put_line(fh,'--');
131: utl_file.put_line(fh,'PROCEDURE StaticEnqueue(p_qh_name in varchar2,');
132: utl_file.put_line(fh,' p_event in wf_event_t,');
133: utl_file.put_line(fh,' p_out_agent_override in wf_agent_t,');
134: utl_file.put_line(fh,' p_executed out nocopy boolean)');
135: utl_file.put_line(fh,'as');
136: utl_file.put_line(fh,' l_qh_name varchar2(240);');
137: utl_file.put_line(fh,'begin');
138: utl_file.put_line(fh,' p_executed := FALSE;');
131: utl_file.put_line(fh,'PROCEDURE StaticEnqueue(p_qh_name in varchar2,');
132: utl_file.put_line(fh,' p_event in wf_event_t,');
133: utl_file.put_line(fh,' p_out_agent_override in wf_agent_t,');
134: utl_file.put_line(fh,' p_executed out nocopy boolean)');
135: utl_file.put_line(fh,'as');
136: utl_file.put_line(fh,' l_qh_name varchar2(240);');
137: utl_file.put_line(fh,'begin');
138: utl_file.put_line(fh,' p_executed := FALSE;');
139: utl_file.put_line(fh,' l_qh_name := upper(trim(p_qh_name));');
132: utl_file.put_line(fh,' p_event in wf_event_t,');
133: utl_file.put_line(fh,' p_out_agent_override in wf_agent_t,');
134: utl_file.put_line(fh,' p_executed out nocopy boolean)');
135: utl_file.put_line(fh,'as');
136: utl_file.put_line(fh,' l_qh_name varchar2(240);');
137: utl_file.put_line(fh,'begin');
138: utl_file.put_line(fh,' p_executed := FALSE;');
139: utl_file.put_line(fh,' l_qh_name := upper(trim(p_qh_name));');
140:
133: utl_file.put_line(fh,' p_out_agent_override in wf_agent_t,');
134: utl_file.put_line(fh,' p_executed out nocopy boolean)');
135: utl_file.put_line(fh,'as');
136: utl_file.put_line(fh,' l_qh_name varchar2(240);');
137: utl_file.put_line(fh,'begin');
138: utl_file.put_line(fh,' p_executed := FALSE;');
139: utl_file.put_line(fh,' l_qh_name := upper(trim(p_qh_name));');
140:
141: if (p_agent_names is not null) then
134: utl_file.put_line(fh,' p_executed out nocopy boolean)');
135: utl_file.put_line(fh,'as');
136: utl_file.put_line(fh,' l_qh_name varchar2(240);');
137: utl_file.put_line(fh,'begin');
138: utl_file.put_line(fh,' p_executed := FALSE;');
139: utl_file.put_line(fh,' l_qh_name := upper(trim(p_qh_name));');
140:
141: if (p_agent_names is not null) then
142: for i in p_agent_names.FIRST..p_agent_names.LAST loop
135: utl_file.put_line(fh,'as');
136: utl_file.put_line(fh,' l_qh_name varchar2(240);');
137: utl_file.put_line(fh,'begin');
138: utl_file.put_line(fh,' p_executed := FALSE;');
139: utl_file.put_line(fh,' l_qh_name := upper(trim(p_qh_name));');
140:
141: if (p_agent_names is not null) then
142: for i in p_agent_names.FIRST..p_agent_names.LAST loop
143: l_first := TRUE;
144: l_atleast_one := FALSE;
145: for qhandler_rec in all_Queue_handlers(upper(p_agent_names(i))) loop
146: l_atleast_one := TRUE;
147: l_generated := TRUE;
148: utl_file.put_line(fh,' if (l_qh_name = '''
149: || qhandler_rec.qhandler || ''') then');
150: utl_file.put_line(fh,' '||qhandler_rec.qhandler
151: || '.Enqueue(p_event, p_out_agent_override);');
152: utl_file.put_line(fh,' p_executed := TRUE;');
146: l_atleast_one := TRUE;
147: l_generated := TRUE;
148: utl_file.put_line(fh,' if (l_qh_name = '''
149: || qhandler_rec.qhandler || ''') then');
150: utl_file.put_line(fh,' '||qhandler_rec.qhandler
151: || '.Enqueue(p_event, p_out_agent_override);');
152: utl_file.put_line(fh,' p_executed := TRUE;');
153: utl_file.put_line(fh,' return;');
154: utl_file.put_line(fh,' end if; ');
148: utl_file.put_line(fh,' if (l_qh_name = '''
149: || qhandler_rec.qhandler || ''') then');
150: utl_file.put_line(fh,' '||qhandler_rec.qhandler
151: || '.Enqueue(p_event, p_out_agent_override);');
152: utl_file.put_line(fh,' p_executed := TRUE;');
153: utl_file.put_line(fh,' return;');
154: utl_file.put_line(fh,' end if; ');
155: end loop;
156: end loop; -- p_agent_names
149: || qhandler_rec.qhandler || ''') then');
150: utl_file.put_line(fh,' '||qhandler_rec.qhandler
151: || '.Enqueue(p_event, p_out_agent_override);');
152: utl_file.put_line(fh,' p_executed := TRUE;');
153: utl_file.put_line(fh,' return;');
154: utl_file.put_line(fh,' end if; ');
155: end loop;
156: end loop; -- p_agent_names
157: end if; -- p_agent_names
150: utl_file.put_line(fh,' '||qhandler_rec.qhandler
151: || '.Enqueue(p_event, p_out_agent_override);');
152: utl_file.put_line(fh,' p_executed := TRUE;');
153: utl_file.put_line(fh,' return;');
154: utl_file.put_line(fh,' end if; ');
155: end loop;
156: end loop; -- p_agent_names
157: end if; -- p_agent_names
158:
157: end if; -- p_agent_names
158:
159: -- give a message within the generated file regarding the failure
160: if (not l_generated) then
161: utl_file.put_line(fh, '');
162: utl_file.put_line(fh, ' -- Package body could not be generated for the agent names given.');
163: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
164: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
165: utl_file.put_line(fh, '');
158:
159: -- give a message within the generated file regarding the failure
160: if (not l_generated) then
161: utl_file.put_line(fh, '');
162: utl_file.put_line(fh, ' -- Package body could not be generated for the agent names given.');
163: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
164: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
165: utl_file.put_line(fh, '');
166: end if;
159: -- give a message within the generated file regarding the failure
160: if (not l_generated) then
161: utl_file.put_line(fh, '');
162: utl_file.put_line(fh, ' -- Package body could not be generated for the agent names given.');
163: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
164: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
165: utl_file.put_line(fh, '');
166: end if;
167:
160: if (not l_generated) then
161: utl_file.put_line(fh, '');
162: utl_file.put_line(fh, ' -- Package body could not be generated for the agent names given.');
163: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
164: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
165: utl_file.put_line(fh, '');
166: end if;
167:
168: utl_file.put_line(fh,'end StaticEnqueue;');
161: utl_file.put_line(fh, '');
162: utl_file.put_line(fh, ' -- Package body could not be generated for the agent names given.');
163: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
164: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
165: utl_file.put_line(fh, '');
166: end if;
167:
168: utl_file.put_line(fh,'end StaticEnqueue;');
169:
164: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
165: utl_file.put_line(fh, '');
166: end if;
167:
168: utl_file.put_line(fh,'end StaticEnqueue;');
169:
170: utl_file.put_line(fh,'');
171: utl_file.put_line(fh,'--');
172: utl_file.put_line(fh,'-- Static dequeue procedure calls ');
166: end if;
167:
168: utl_file.put_line(fh,'end StaticEnqueue;');
169:
170: utl_file.put_line(fh,'');
171: utl_file.put_line(fh,'--');
172: utl_file.put_line(fh,'-- Static dequeue procedure calls ');
173: utl_file.put_line(fh,'--');
174:
167:
168: utl_file.put_line(fh,'end StaticEnqueue;');
169:
170: utl_file.put_line(fh,'');
171: utl_file.put_line(fh,'--');
172: utl_file.put_line(fh,'-- Static dequeue procedure calls ');
173: utl_file.put_line(fh,'--');
174:
175: utl_file.put_line(fh,'PROCEDURE StaticDequeue(p_qh_name in varchar2,');
168: utl_file.put_line(fh,'end StaticEnqueue;');
169:
170: utl_file.put_line(fh,'');
171: utl_file.put_line(fh,'--');
172: utl_file.put_line(fh,'-- Static dequeue procedure calls ');
173: utl_file.put_line(fh,'--');
174:
175: utl_file.put_line(fh,'PROCEDURE StaticDequeue(p_qh_name in varchar2,');
176: utl_file.put_line(fh,' p_agent_guid in raw,');
169:
170: utl_file.put_line(fh,'');
171: utl_file.put_line(fh,'--');
172: utl_file.put_line(fh,'-- Static dequeue procedure calls ');
173: utl_file.put_line(fh,'--');
174:
175: utl_file.put_line(fh,'PROCEDURE StaticDequeue(p_qh_name in varchar2,');
176: utl_file.put_line(fh,' p_agent_guid in raw,');
177: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
171: utl_file.put_line(fh,'--');
172: utl_file.put_line(fh,'-- Static dequeue procedure calls ');
173: utl_file.put_line(fh,'--');
174:
175: utl_file.put_line(fh,'PROCEDURE StaticDequeue(p_qh_name in varchar2,');
176: utl_file.put_line(fh,' p_agent_guid in raw,');
177: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
178: utl_file.put_line(fh,' p_wait in binary_integer,');
179: utl_file.put_line(fh,' p_executed out nocopy boolean)');
172: utl_file.put_line(fh,'-- Static dequeue procedure calls ');
173: utl_file.put_line(fh,'--');
174:
175: utl_file.put_line(fh,'PROCEDURE StaticDequeue(p_qh_name in varchar2,');
176: utl_file.put_line(fh,' p_agent_guid in raw,');
177: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
178: utl_file.put_line(fh,' p_wait in binary_integer,');
179: utl_file.put_line(fh,' p_executed out nocopy boolean)');
180:
173: utl_file.put_line(fh,'--');
174:
175: utl_file.put_line(fh,'PROCEDURE StaticDequeue(p_qh_name in varchar2,');
176: utl_file.put_line(fh,' p_agent_guid in raw,');
177: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
178: utl_file.put_line(fh,' p_wait in binary_integer,');
179: utl_file.put_line(fh,' p_executed out nocopy boolean)');
180:
181: utl_file.put_line(fh,'as');
174:
175: utl_file.put_line(fh,'PROCEDURE StaticDequeue(p_qh_name in varchar2,');
176: utl_file.put_line(fh,' p_agent_guid in raw,');
177: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
178: utl_file.put_line(fh,' p_wait in binary_integer,');
179: utl_file.put_line(fh,' p_executed out nocopy boolean)');
180:
181: utl_file.put_line(fh,'as');
182: utl_file.put_line(fh,' l_qh_name varchar2(240);');
175: utl_file.put_line(fh,'PROCEDURE StaticDequeue(p_qh_name in varchar2,');
176: utl_file.put_line(fh,' p_agent_guid in raw,');
177: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
178: utl_file.put_line(fh,' p_wait in binary_integer,');
179: utl_file.put_line(fh,' p_executed out nocopy boolean)');
180:
181: utl_file.put_line(fh,'as');
182: utl_file.put_line(fh,' l_qh_name varchar2(240);');
183: utl_file.put_line(fh,'begin');
177: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
178: utl_file.put_line(fh,' p_wait in binary_integer,');
179: utl_file.put_line(fh,' p_executed out nocopy boolean)');
180:
181: utl_file.put_line(fh,'as');
182: utl_file.put_line(fh,' l_qh_name varchar2(240);');
183: utl_file.put_line(fh,'begin');
184: utl_file.put_line(fh,' p_executed := FALSE;');
185: utl_file.put_line(fh,' l_qh_name := upper(trim(p_qh_name));');
178: utl_file.put_line(fh,' p_wait in binary_integer,');
179: utl_file.put_line(fh,' p_executed out nocopy boolean)');
180:
181: utl_file.put_line(fh,'as');
182: utl_file.put_line(fh,' l_qh_name varchar2(240);');
183: utl_file.put_line(fh,'begin');
184: utl_file.put_line(fh,' p_executed := FALSE;');
185: utl_file.put_line(fh,' l_qh_name := upper(trim(p_qh_name));');
186:
179: utl_file.put_line(fh,' p_executed out nocopy boolean)');
180:
181: utl_file.put_line(fh,'as');
182: utl_file.put_line(fh,' l_qh_name varchar2(240);');
183: utl_file.put_line(fh,'begin');
184: utl_file.put_line(fh,' p_executed := FALSE;');
185: utl_file.put_line(fh,' l_qh_name := upper(trim(p_qh_name));');
186:
187: if (p_agent_names is not null) then
180:
181: utl_file.put_line(fh,'as');
182: utl_file.put_line(fh,' l_qh_name varchar2(240);');
183: utl_file.put_line(fh,'begin');
184: utl_file.put_line(fh,' p_executed := FALSE;');
185: utl_file.put_line(fh,' l_qh_name := upper(trim(p_qh_name));');
186:
187: if (p_agent_names is not null) then
188: for i in p_agent_names.FIRST..p_agent_names.LAST loop
181: utl_file.put_line(fh,'as');
182: utl_file.put_line(fh,' l_qh_name varchar2(240);');
183: utl_file.put_line(fh,'begin');
184: utl_file.put_line(fh,' p_executed := FALSE;');
185: utl_file.put_line(fh,' l_qh_name := upper(trim(p_qh_name));');
186:
187: if (p_agent_names is not null) then
188: for i in p_agent_names.FIRST..p_agent_names.LAST loop
189: l_first := TRUE;
190: l_atleast_one := FALSE;
191: for qhandler_rec in all_Queue_handlers(upper(p_agent_names(i))) loop
192: l_atleast_one := TRUE;
193: l_generated := TRUE;
194: utl_file.put_line(fh,' if (l_qh_name = '''
195: || qhandler_rec.qhandler || ''') then');
196: utl_file.put_line(fh,' '||qhandler_rec.qhandler
197: || '.Dequeue(p_agent_guid, p_event, p_wait);');
198: utl_file.put_line(fh,' p_executed := TRUE;');
192: l_atleast_one := TRUE;
193: l_generated := TRUE;
194: utl_file.put_line(fh,' if (l_qh_name = '''
195: || qhandler_rec.qhandler || ''') then');
196: utl_file.put_line(fh,' '||qhandler_rec.qhandler
197: || '.Dequeue(p_agent_guid, p_event, p_wait);');
198: utl_file.put_line(fh,' p_executed := TRUE;');
199: utl_file.put_line(fh,' return;');
200: utl_file.put_line(fh,' end if; ');
194: utl_file.put_line(fh,' if (l_qh_name = '''
195: || qhandler_rec.qhandler || ''') then');
196: utl_file.put_line(fh,' '||qhandler_rec.qhandler
197: || '.Dequeue(p_agent_guid, p_event, p_wait);');
198: utl_file.put_line(fh,' p_executed := TRUE;');
199: utl_file.put_line(fh,' return;');
200: utl_file.put_line(fh,' end if; ');
201: end loop;
202: end loop; -- p_agent_names
195: || qhandler_rec.qhandler || ''') then');
196: utl_file.put_line(fh,' '||qhandler_rec.qhandler
197: || '.Dequeue(p_agent_guid, p_event, p_wait);');
198: utl_file.put_line(fh,' p_executed := TRUE;');
199: utl_file.put_line(fh,' return;');
200: utl_file.put_line(fh,' end if; ');
201: end loop;
202: end loop; -- p_agent_names
203: end if; -- p_agent_names
196: utl_file.put_line(fh,' '||qhandler_rec.qhandler
197: || '.Dequeue(p_agent_guid, p_event, p_wait);');
198: utl_file.put_line(fh,' p_executed := TRUE;');
199: utl_file.put_line(fh,' return;');
200: utl_file.put_line(fh,' end if; ');
201: end loop;
202: end loop; -- p_agent_names
203: end if; -- p_agent_names
204:
203: end if; -- p_agent_names
204:
205: -- give a message within the generated file regarding the failure
206: if (not l_generated) then
207: utl_file.put_line(fh, '');
208: utl_file.put_line(fh, ' -- Package body could not be generated for the agent name given.');
209: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
210: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
211: utl_file.put_line(fh, '');
204:
205: -- give a message within the generated file regarding the failure
206: if (not l_generated) then
207: utl_file.put_line(fh, '');
208: utl_file.put_line(fh, ' -- Package body could not be generated for the agent name given.');
209: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
210: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
211: utl_file.put_line(fh, '');
212: end if;
205: -- give a message within the generated file regarding the failure
206: if (not l_generated) then
207: utl_file.put_line(fh, '');
208: utl_file.put_line(fh, ' -- Package body could not be generated for the agent name given.');
209: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
210: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
211: utl_file.put_line(fh, '');
212: end if;
213:
206: if (not l_generated) then
207: utl_file.put_line(fh, '');
208: utl_file.put_line(fh, ' -- Package body could not be generated for the agent name given.');
209: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
210: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
211: utl_file.put_line(fh, '');
212: end if;
213:
214: utl_file.put_line(fh,'end StaticDequeue;');
207: utl_file.put_line(fh, '');
208: utl_file.put_line(fh, ' -- Package body could not be generated for the agent name given.');
209: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
210: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
211: utl_file.put_line(fh, '');
212: end if;
213:
214: utl_file.put_line(fh,'end StaticDequeue;');
215: utl_file.put_line(fh,' ');
210: utl_file.put_line(fh, ' -- agent name(s) was invalid or the agent name(s) specified do not exist');
211: utl_file.put_line(fh, '');
212: end if;
213:
214: utl_file.put_line(fh,'end StaticDequeue;');
215: utl_file.put_line(fh,' ');
216: utl_file.put_line(fh,'end WF_AGT_DYN_FUNCS;');
217: utl_file.put_line(fh,'/');
218: utl_file.put_line(fh,'commit;');
211: utl_file.put_line(fh, '');
212: end if;
213:
214: utl_file.put_line(fh,'end StaticDequeue;');
215: utl_file.put_line(fh,' ');
216: utl_file.put_line(fh,'end WF_AGT_DYN_FUNCS;');
217: utl_file.put_line(fh,'/');
218: utl_file.put_line(fh,'commit;');
219: utl_file.put_line(fh,'exit;');
212: end if;
213:
214: utl_file.put_line(fh,'end StaticDequeue;');
215: utl_file.put_line(fh,' ');
216: utl_file.put_line(fh,'end WF_AGT_DYN_FUNCS;');
217: utl_file.put_line(fh,'/');
218: utl_file.put_line(fh,'commit;');
219: utl_file.put_line(fh,'exit;');
220: utl_file.put_line(fh,' ');
213:
214: utl_file.put_line(fh,'end StaticDequeue;');
215: utl_file.put_line(fh,' ');
216: utl_file.put_line(fh,'end WF_AGT_DYN_FUNCS;');
217: utl_file.put_line(fh,'/');
218: utl_file.put_line(fh,'commit;');
219: utl_file.put_line(fh,'exit;');
220: utl_file.put_line(fh,' ');
221: utl_file.fclose(fh);
214: utl_file.put_line(fh,'end StaticDequeue;');
215: utl_file.put_line(fh,' ');
216: utl_file.put_line(fh,'end WF_AGT_DYN_FUNCS;');
217: utl_file.put_line(fh,'/');
218: utl_file.put_line(fh,'commit;');
219: utl_file.put_line(fh,'exit;');
220: utl_file.put_line(fh,' ');
221: utl_file.fclose(fh);
222:
215: utl_file.put_line(fh,' ');
216: utl_file.put_line(fh,'end WF_AGT_DYN_FUNCS;');
217: utl_file.put_line(fh,'/');
218: utl_file.put_line(fh,'commit;');
219: utl_file.put_line(fh,'exit;');
220: utl_file.put_line(fh,' ');
221: utl_file.fclose(fh);
222:
223: dbms_output.put_line('File generated is '||utl_dir||'/'||l_filename);
216: utl_file.put_line(fh,'end WF_AGT_DYN_FUNCS;');
217: utl_file.put_line(fh,'/');
218: utl_file.put_line(fh,'commit;');
219: utl_file.put_line(fh,'exit;');
220: utl_file.put_line(fh,' ');
221: utl_file.fclose(fh);
222:
223: dbms_output.put_line('File generated is '||utl_dir||'/'||l_filename);
224: exception
217: utl_file.put_line(fh,'/');
218: utl_file.put_line(fh,'commit;');
219: utl_file.put_line(fh,'exit;');
220: utl_file.put_line(fh,' ');
221: utl_file.fclose(fh);
222:
223: dbms_output.put_line('File generated is '||utl_dir||'/'||l_filename);
224: exception
225: when others then
222:
223: dbms_output.put_line('File generated is '||utl_dir||'/'||l_filename);
224: exception
225: when others then
226: if (utl_file.is_open(fh)) then
227: utl_file.fclose(fh);
228: end if;
229: raise;
230:
223: dbms_output.put_line('File generated is '||utl_dir||'/'||l_filename);
224: exception
225: when others then
226: if (utl_file.is_open(fh)) then
227: utl_file.fclose(fh);
228: end if;
229: raise;
230:
231: end StaticQH;
238: --
239:
240: Procedure StaticGenerateRule(p_correlation_ids in varchar_array) AS
241:
242: fh utl_file.file_type;
243: l_generated boolean := FALSE;
244: l_atleast_one boolean;
245: l_first boolean;
246:
305: from dual;
306:
307: l_filename := 'WFBESDFNB'||l_timestamp||'.pls';
308:
309: fh := utl_file.fopen(utl_dir, l_filename, 'w', 32767);
310:
311: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
312: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
313: utl_file.put_line(fh, '/*=======================================================================*');
307: l_filename := 'WFBESDFNB'||l_timestamp||'.pls';
308:
309: fh := utl_file.fopen(utl_dir, l_filename, 'w', 32767);
310:
311: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
312: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
313: utl_file.put_line(fh, '/*=======================================================================*');
314: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
315: utl_file.put_line(fh, '+========================================================================+');
308:
309: fh := utl_file.fopen(utl_dir, l_filename, 'w', 32767);
310:
311: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
312: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
313: utl_file.put_line(fh, '/*=======================================================================*');
314: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
315: utl_file.put_line(fh, '+========================================================================+');
316: utl_file.put_line(fh, '| NAME |');
309: fh := utl_file.fopen(utl_dir, l_filename, 'w', 32767);
310:
311: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
312: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
313: utl_file.put_line(fh, '/*=======================================================================*');
314: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
315: utl_file.put_line(fh, '+========================================================================+');
316: utl_file.put_line(fh, '| NAME |');
317: utl_file.put_line(fh, '| WFBESDFNB'||l_timestamp||'.pls |');
310:
311: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
312: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
313: utl_file.put_line(fh, '/*=======================================================================*');
314: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
315: utl_file.put_line(fh, '+========================================================================+');
316: utl_file.put_line(fh, '| NAME |');
317: utl_file.put_line(fh, '| WFBESDFNB'||l_timestamp||'.pls |');
318: utl_file.put_line(fh, '| |');
311: utl_file.put_line(fh, 'REM dbdrv: sql ~PROD ~PATH ~FILE none none none package '||g_amp||'phase=plb \');
312: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
313: utl_file.put_line(fh, '/*=======================================================================*');
314: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
315: utl_file.put_line(fh, '+========================================================================+');
316: utl_file.put_line(fh, '| NAME |');
317: utl_file.put_line(fh, '| WFBESDFNB'||l_timestamp||'.pls |');
318: utl_file.put_line(fh, '| |');
319: utl_file.put_line(fh, '| DESCRIPTION |');
312: utl_file.put_line(fh, 'REM dbdrv: checkfile(115.2=120.3):~PROD:~PATH:~FILE');
313: utl_file.put_line(fh, '/*=======================================================================*');
314: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
315: utl_file.put_line(fh, '+========================================================================+');
316: utl_file.put_line(fh, '| NAME |');
317: utl_file.put_line(fh, '| WFBESDFNB'||l_timestamp||'.pls |');
318: utl_file.put_line(fh, '| |');
319: utl_file.put_line(fh, '| DESCRIPTION |');
320: utl_file.put_line(fh, '| PL/SQL body for package WF_BES_DYN_FUNCS |');
313: utl_file.put_line(fh, '/*=======================================================================*');
314: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
315: utl_file.put_line(fh, '+========================================================================+');
316: utl_file.put_line(fh, '| NAME |');
317: utl_file.put_line(fh, '| WFBESDFNB'||l_timestamp||'.pls |');
318: utl_file.put_line(fh, '| |');
319: utl_file.put_line(fh, '| DESCRIPTION |');
320: utl_file.put_line(fh, '| PL/SQL body for package WF_BES_DYN_FUNCS |');
321: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
314: utl_file.put_line(fh, '| Copyright (c) 2005, Oracle. All Rights Reserved |');
315: utl_file.put_line(fh, '+========================================================================+');
316: utl_file.put_line(fh, '| NAME |');
317: utl_file.put_line(fh, '| WFBESDFNB'||l_timestamp||'.pls |');
318: utl_file.put_line(fh, '| |');
319: utl_file.put_line(fh, '| DESCRIPTION |');
320: utl_file.put_line(fh, '| PL/SQL body for package WF_BES_DYN_FUNCS |');
321: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
322: utl_file.put_line(fh, '| generate and rule functions |');
315: utl_file.put_line(fh, '+========================================================================+');
316: utl_file.put_line(fh, '| NAME |');
317: utl_file.put_line(fh, '| WFBESDFNB'||l_timestamp||'.pls |');
318: utl_file.put_line(fh, '| |');
319: utl_file.put_line(fh, '| DESCRIPTION |');
320: utl_file.put_line(fh, '| PL/SQL body for package WF_BES_DYN_FUNCS |');
321: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
322: utl_file.put_line(fh, '| generate and rule functions |');
323: utl_file.put_line(fh, '| |');
316: utl_file.put_line(fh, '| NAME |');
317: utl_file.put_line(fh, '| WFBESDFNB'||l_timestamp||'.pls |');
318: utl_file.put_line(fh, '| |');
319: utl_file.put_line(fh, '| DESCRIPTION |');
320: utl_file.put_line(fh, '| PL/SQL body for package WF_BES_DYN_FUNCS |');
321: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
322: utl_file.put_line(fh, '| generate and rule functions |');
323: utl_file.put_line(fh, '| |');
324: utl_file.put_line(fh, '| NOTES |');
317: utl_file.put_line(fh, '| WFBESDFNB'||l_timestamp||'.pls |');
318: utl_file.put_line(fh, '| |');
319: utl_file.put_line(fh, '| DESCRIPTION |');
320: utl_file.put_line(fh, '| PL/SQL body for package WF_BES_DYN_FUNCS |');
321: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
322: utl_file.put_line(fh, '| generate and rule functions |');
323: utl_file.put_line(fh, '| |');
324: utl_file.put_line(fh, '| NOTES |');
325: utl_file.put_line(fh, '| This package body has static function calls for following event |');
318: utl_file.put_line(fh, '| |');
319: utl_file.put_line(fh, '| DESCRIPTION |');
320: utl_file.put_line(fh, '| PL/SQL body for package WF_BES_DYN_FUNCS |');
321: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
322: utl_file.put_line(fh, '| generate and rule functions |');
323: utl_file.put_line(fh, '| |');
324: utl_file.put_line(fh, '| NOTES |');
325: utl_file.put_line(fh, '| This package body has static function calls for following event |');
326: utl_file.put_line(fh, '| names or corrlation ids |');
319: utl_file.put_line(fh, '| DESCRIPTION |');
320: utl_file.put_line(fh, '| PL/SQL body for package WF_BES_DYN_FUNCS |');
321: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
322: utl_file.put_line(fh, '| generate and rule functions |');
323: utl_file.put_line(fh, '| |');
324: utl_file.put_line(fh, '| NOTES |');
325: utl_file.put_line(fh, '| This package body has static function calls for following event |');
326: utl_file.put_line(fh, '| names or corrlation ids |');
327: utl_file.put_line(fh, '| oracle.apps.wf.% |');
320: utl_file.put_line(fh, '| PL/SQL body for package WF_BES_DYN_FUNCS |');
321: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
322: utl_file.put_line(fh, '| generate and rule functions |');
323: utl_file.put_line(fh, '| |');
324: utl_file.put_line(fh, '| NOTES |');
325: utl_file.put_line(fh, '| This package body has static function calls for following event |');
326: utl_file.put_line(fh, '| names or corrlation ids |');
327: utl_file.put_line(fh, '| oracle.apps.wf.% |');
328: utl_file.put_line(fh, '| oracle.apps.fnd.% |');
321: utl_file.put_line(fh, '| This is a generated file to provide static calls for |');
322: utl_file.put_line(fh, '| generate and rule functions |');
323: utl_file.put_line(fh, '| |');
324: utl_file.put_line(fh, '| NOTES |');
325: utl_file.put_line(fh, '| This package body has static function calls for following event |');
326: utl_file.put_line(fh, '| names or corrlation ids |');
327: utl_file.put_line(fh, '| oracle.apps.wf.% |');
328: utl_file.put_line(fh, '| oracle.apps.fnd.% |');
329: utl_file.put_line(fh, '| |');
322: utl_file.put_line(fh, '| generate and rule functions |');
323: utl_file.put_line(fh, '| |');
324: utl_file.put_line(fh, '| NOTES |');
325: utl_file.put_line(fh, '| This package body has static function calls for following event |');
326: utl_file.put_line(fh, '| names or corrlation ids |');
327: utl_file.put_line(fh, '| oracle.apps.wf.% |');
328: utl_file.put_line(fh, '| oracle.apps.fnd.% |');
329: utl_file.put_line(fh, '| |');
330: utl_file.put_line(fh, '*========================================================================*/ ');
323: utl_file.put_line(fh, '| |');
324: utl_file.put_line(fh, '| NOTES |');
325: utl_file.put_line(fh, '| This package body has static function calls for following event |');
326: utl_file.put_line(fh, '| names or corrlation ids |');
327: utl_file.put_line(fh, '| oracle.apps.wf.% |');
328: utl_file.put_line(fh, '| oracle.apps.fnd.% |');
329: utl_file.put_line(fh, '| |');
330: utl_file.put_line(fh, '*========================================================================*/ ');
331: utl_file.put_line(fh,'SET VERIFY OFF;');
324: utl_file.put_line(fh, '| NOTES |');
325: utl_file.put_line(fh, '| This package body has static function calls for following event |');
326: utl_file.put_line(fh, '| names or corrlation ids |');
327: utl_file.put_line(fh, '| oracle.apps.wf.% |');
328: utl_file.put_line(fh, '| oracle.apps.fnd.% |');
329: utl_file.put_line(fh, '| |');
330: utl_file.put_line(fh, '*========================================================================*/ ');
331: utl_file.put_line(fh,'SET VERIFY OFF;');
332: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
325: utl_file.put_line(fh, '| This package body has static function calls for following event |');
326: utl_file.put_line(fh, '| names or corrlation ids |');
327: utl_file.put_line(fh, '| oracle.apps.wf.% |');
328: utl_file.put_line(fh, '| oracle.apps.fnd.% |');
329: utl_file.put_line(fh, '| |');
330: utl_file.put_line(fh, '*========================================================================*/ ');
331: utl_file.put_line(fh,'SET VERIFY OFF;');
332: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
333: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
326: utl_file.put_line(fh, '| names or corrlation ids |');
327: utl_file.put_line(fh, '| oracle.apps.wf.% |');
328: utl_file.put_line(fh, '| oracle.apps.fnd.% |');
329: utl_file.put_line(fh, '| |');
330: utl_file.put_line(fh, '*========================================================================*/ ');
331: utl_file.put_line(fh,'SET VERIFY OFF;');
332: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
333: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
334:
327: utl_file.put_line(fh, '| oracle.apps.wf.% |');
328: utl_file.put_line(fh, '| oracle.apps.fnd.% |');
329: utl_file.put_line(fh, '| |');
330: utl_file.put_line(fh, '*========================================================================*/ ');
331: utl_file.put_line(fh,'SET VERIFY OFF;');
332: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
333: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
334:
335: utl_file.put_line(fh,'create or replace package body WF_BES_DYN_FUNCS as');
328: utl_file.put_line(fh, '| oracle.apps.fnd.% |');
329: utl_file.put_line(fh, '| |');
330: utl_file.put_line(fh, '*========================================================================*/ ');
331: utl_file.put_line(fh,'SET VERIFY OFF;');
332: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
333: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
334:
335: utl_file.put_line(fh,'create or replace package body WF_BES_DYN_FUNCS as');
336:
329: utl_file.put_line(fh, '| |');
330: utl_file.put_line(fh, '*========================================================================*/ ');
331: utl_file.put_line(fh,'SET VERIFY OFF;');
332: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
333: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
334:
335: utl_file.put_line(fh,'create or replace package body WF_BES_DYN_FUNCS as');
336:
337: utl_file.put_line(fh,'--');
331: utl_file.put_line(fh,'SET VERIFY OFF;');
332: utl_file.put_line(fh,'WHENEVER SQLERROR EXIT FAILURE ROLLBACK;');
333: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
334:
335: utl_file.put_line(fh,'create or replace package body WF_BES_DYN_FUNCS as');
336:
337: utl_file.put_line(fh,'--');
338: utl_file.put_line(fh,'-- Generate functions');
339: utl_file.put_line(fh,'--');
333: utl_file.put_line(fh,'WHENEVER OSERROR EXIT FAILURE ROLLBACK;');
334:
335: utl_file.put_line(fh,'create or replace package body WF_BES_DYN_FUNCS as');
336:
337: utl_file.put_line(fh,'--');
338: utl_file.put_line(fh,'-- Generate functions');
339: utl_file.put_line(fh,'--');
340:
341: utl_file.put_line(fh,'PROCEDURE Generate(p_func_name in varchar2,');
334:
335: utl_file.put_line(fh,'create or replace package body WF_BES_DYN_FUNCS as');
336:
337: utl_file.put_line(fh,'--');
338: utl_file.put_line(fh,'-- Generate functions');
339: utl_file.put_line(fh,'--');
340:
341: utl_file.put_line(fh,'PROCEDURE Generate(p_func_name in varchar2,');
342: utl_file.put_line(fh,' p_event_name in varchar2,');
335: utl_file.put_line(fh,'create or replace package body WF_BES_DYN_FUNCS as');
336:
337: utl_file.put_line(fh,'--');
338: utl_file.put_line(fh,'-- Generate functions');
339: utl_file.put_line(fh,'--');
340:
341: utl_file.put_line(fh,'PROCEDURE Generate(p_func_name in varchar2,');
342: utl_file.put_line(fh,' p_event_name in varchar2,');
343: utl_file.put_line(fh,' p_event_key in varchar2,');
337: utl_file.put_line(fh,'--');
338: utl_file.put_line(fh,'-- Generate functions');
339: utl_file.put_line(fh,'--');
340:
341: utl_file.put_line(fh,'PROCEDURE Generate(p_func_name in varchar2,');
342: utl_file.put_line(fh,' p_event_name in varchar2,');
343: utl_file.put_line(fh,' p_event_key in varchar2,');
344: utl_file.put_line(fh,' p_parameter_list in wf_parameter_list_t,');
345: utl_file.put_line(fh,' x_msg in out nocopy clob,');
338: utl_file.put_line(fh,'-- Generate functions');
339: utl_file.put_line(fh,'--');
340:
341: utl_file.put_line(fh,'PROCEDURE Generate(p_func_name in varchar2,');
342: utl_file.put_line(fh,' p_event_name in varchar2,');
343: utl_file.put_line(fh,' p_event_key in varchar2,');
344: utl_file.put_line(fh,' p_parameter_list in wf_parameter_list_t,');
345: utl_file.put_line(fh,' x_msg in out nocopy clob,');
346: utl_file.put_line(fh,' x_executed out nocopy boolean)');
339: utl_file.put_line(fh,'--');
340:
341: utl_file.put_line(fh,'PROCEDURE Generate(p_func_name in varchar2,');
342: utl_file.put_line(fh,' p_event_name in varchar2,');
343: utl_file.put_line(fh,' p_event_key in varchar2,');
344: utl_file.put_line(fh,' p_parameter_list in wf_parameter_list_t,');
345: utl_file.put_line(fh,' x_msg in out nocopy clob,');
346: utl_file.put_line(fh,' x_executed out nocopy boolean)');
347: utl_file.put_line(fh,'as');
340:
341: utl_file.put_line(fh,'PROCEDURE Generate(p_func_name in varchar2,');
342: utl_file.put_line(fh,' p_event_name in varchar2,');
343: utl_file.put_line(fh,' p_event_key in varchar2,');
344: utl_file.put_line(fh,' p_parameter_list in wf_parameter_list_t,');
345: utl_file.put_line(fh,' x_msg in out nocopy clob,');
346: utl_file.put_line(fh,' x_executed out nocopy boolean)');
347: utl_file.put_line(fh,'as');
348: utl_file.put_line(fh,' l_funcname varchar2(240);');
341: utl_file.put_line(fh,'PROCEDURE Generate(p_func_name in varchar2,');
342: utl_file.put_line(fh,' p_event_name in varchar2,');
343: utl_file.put_line(fh,' p_event_key in varchar2,');
344: utl_file.put_line(fh,' p_parameter_list in wf_parameter_list_t,');
345: utl_file.put_line(fh,' x_msg in out nocopy clob,');
346: utl_file.put_line(fh,' x_executed out nocopy boolean)');
347: utl_file.put_line(fh,'as');
348: utl_file.put_line(fh,' l_funcname varchar2(240);');
349: utl_file.put_line(fh,'begin');
342: utl_file.put_line(fh,' p_event_name in varchar2,');
343: utl_file.put_line(fh,' p_event_key in varchar2,');
344: utl_file.put_line(fh,' p_parameter_list in wf_parameter_list_t,');
345: utl_file.put_line(fh,' x_msg in out nocopy clob,');
346: utl_file.put_line(fh,' x_executed out nocopy boolean)');
347: utl_file.put_line(fh,'as');
348: utl_file.put_line(fh,' l_funcname varchar2(240);');
349: utl_file.put_line(fh,'begin');
350: utl_file.put_line(fh,' x_executed := FALSE;');
343: utl_file.put_line(fh,' p_event_key in varchar2,');
344: utl_file.put_line(fh,' p_parameter_list in wf_parameter_list_t,');
345: utl_file.put_line(fh,' x_msg in out nocopy clob,');
346: utl_file.put_line(fh,' x_executed out nocopy boolean)');
347: utl_file.put_line(fh,'as');
348: utl_file.put_line(fh,' l_funcname varchar2(240);');
349: utl_file.put_line(fh,'begin');
350: utl_file.put_line(fh,' x_executed := FALSE;');
351: utl_file.put_line(fh,' x_msg := null;');
344: utl_file.put_line(fh,' p_parameter_list in wf_parameter_list_t,');
345: utl_file.put_line(fh,' x_msg in out nocopy clob,');
346: utl_file.put_line(fh,' x_executed out nocopy boolean)');
347: utl_file.put_line(fh,'as');
348: utl_file.put_line(fh,' l_funcname varchar2(240);');
349: utl_file.put_line(fh,'begin');
350: utl_file.put_line(fh,' x_executed := FALSE;');
351: utl_file.put_line(fh,' x_msg := null;');
352: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
345: utl_file.put_line(fh,' x_msg in out nocopy clob,');
346: utl_file.put_line(fh,' x_executed out nocopy boolean)');
347: utl_file.put_line(fh,'as');
348: utl_file.put_line(fh,' l_funcname varchar2(240);');
349: utl_file.put_line(fh,'begin');
350: utl_file.put_line(fh,' x_executed := FALSE;');
351: utl_file.put_line(fh,' x_msg := null;');
352: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
353:
346: utl_file.put_line(fh,' x_executed out nocopy boolean)');
347: utl_file.put_line(fh,'as');
348: utl_file.put_line(fh,' l_funcname varchar2(240);');
349: utl_file.put_line(fh,'begin');
350: utl_file.put_line(fh,' x_executed := FALSE;');
351: utl_file.put_line(fh,' x_msg := null;');
352: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
353:
354: if (p_correlation_ids is not null) then
347: utl_file.put_line(fh,'as');
348: utl_file.put_line(fh,' l_funcname varchar2(240);');
349: utl_file.put_line(fh,'begin');
350: utl_file.put_line(fh,' x_executed := FALSE;');
351: utl_file.put_line(fh,' x_msg := null;');
352: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
353:
354: if (p_correlation_ids is not null) then
355: for i in p_correlation_ids.FIRST..p_correlation_ids.LAST loop
348: utl_file.put_line(fh,' l_funcname varchar2(240);');
349: utl_file.put_line(fh,'begin');
350: utl_file.put_line(fh,' x_executed := FALSE;');
351: utl_file.put_line(fh,' x_msg := null;');
352: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
353:
354: if (p_correlation_ids is not null) then
355: for i in p_correlation_ids.FIRST..p_correlation_ids.LAST loop
356: l_first := TRUE;
359:
360: l_atleast_one := TRUE;
361: l_generated := TRUE;
362: if (l_first) then
363: utl_file.put_line(fh, '');
364: utl_file.put_line(fh, ' -- Function calls for corrid ' || p_correlation_ids(i) || '%');
365: utl_file.put_line(fh, ' if (upper(p_event_name) like '''
366: || p_correlation_ids(i) || '%'') then ');
367: l_first := FALSE;
360: l_atleast_one := TRUE;
361: l_generated := TRUE;
362: if (l_first) then
363: utl_file.put_line(fh, '');
364: utl_file.put_line(fh, ' -- Function calls for corrid ' || p_correlation_ids(i) || '%');
365: utl_file.put_line(fh, ' if (upper(p_event_name) like '''
366: || p_correlation_ids(i) || '%'') then ');
367: l_first := FALSE;
368: end if;
361: l_generated := TRUE;
362: if (l_first) then
363: utl_file.put_line(fh, '');
364: utl_file.put_line(fh, ' -- Function calls for corrid ' || p_correlation_ids(i) || '%');
365: utl_file.put_line(fh, ' if (upper(p_event_name) like '''
366: || p_correlation_ids(i) || '%'') then ');
367: l_first := FALSE;
368: end if;
369:
366: || p_correlation_ids(i) || '%'') then ');
367: l_first := FALSE;
368: end if;
369:
370: utl_file.put_line(fh,' if (l_funcname = '''
371: || genfunc_rec.function || ''') then');
372: utl_file.put_line(fh,' ' || 'x_msg := '||genfunc_rec.function
373: || '(p_event_name, p_event_key,p_parameter_list);');
374: utl_file.put_line(fh,' x_executed := TRUE;');
368: end if;
369:
370: utl_file.put_line(fh,' if (l_funcname = '''
371: || genfunc_rec.function || ''') then');
372: utl_file.put_line(fh,' ' || 'x_msg := '||genfunc_rec.function
373: || '(p_event_name, p_event_key,p_parameter_list);');
374: utl_file.put_line(fh,' x_executed := TRUE;');
375: utl_file.put_line(fh,' return;');
376: utl_file.put_line(fh,' end if; ');
370: utl_file.put_line(fh,' if (l_funcname = '''
371: || genfunc_rec.function || ''') then');
372: utl_file.put_line(fh,' ' || 'x_msg := '||genfunc_rec.function
373: || '(p_event_name, p_event_key,p_parameter_list);');
374: utl_file.put_line(fh,' x_executed := TRUE;');
375: utl_file.put_line(fh,' return;');
376: utl_file.put_line(fh,' end if; ');
377:
378: end loop;--for loop
371: || genfunc_rec.function || ''') then');
372: utl_file.put_line(fh,' ' || 'x_msg := '||genfunc_rec.function
373: || '(p_event_name, p_event_key,p_parameter_list);');
374: utl_file.put_line(fh,' x_executed := TRUE;');
375: utl_file.put_line(fh,' return;');
376: utl_file.put_line(fh,' end if; ');
377:
378: end loop;--for loop
379:
372: utl_file.put_line(fh,' ' || 'x_msg := '||genfunc_rec.function
373: || '(p_event_name, p_event_key,p_parameter_list);');
374: utl_file.put_line(fh,' x_executed := TRUE;');
375: utl_file.put_line(fh,' return;');
376: utl_file.put_line(fh,' end if; ');
377:
378: end loop;--for loop
379:
380: if (l_atleast_one) then
377:
378: end loop;--for loop
379:
380: if (l_atleast_one) then
381: utl_file.put_line(fh, ' end if;');
382: end if;
383:
384: end loop; --for loop
385:
386: end if;
387:
388: -- give a message within the generated file regarding the failure
389: if (not l_generated) then
390: utl_file.put_line(fh, '');
391: utl_file.put_line(fh, ' -- Package body could not be generated for the corrids given.');
392: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
393: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
394: utl_file.put_line(fh, '');
387:
388: -- give a message within the generated file regarding the failure
389: if (not l_generated) then
390: utl_file.put_line(fh, '');
391: utl_file.put_line(fh, ' -- Package body could not be generated for the corrids given.');
392: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
393: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
394: utl_file.put_line(fh, '');
395: end if;
388: -- give a message within the generated file regarding the failure
389: if (not l_generated) then
390: utl_file.put_line(fh, '');
391: utl_file.put_line(fh, ' -- Package body could not be generated for the corrids given.');
392: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
393: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
394: utl_file.put_line(fh, '');
395: end if;
396:
389: if (not l_generated) then
390: utl_file.put_line(fh, '');
391: utl_file.put_line(fh, ' -- Package body could not be generated for the corrids given.');
392: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
393: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
394: utl_file.put_line(fh, '');
395: end if;
396:
397: utl_file.put_line(fh,'end Generate;');
390: utl_file.put_line(fh, '');
391: utl_file.put_line(fh, ' -- Package body could not be generated for the corrids given.');
392: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
393: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
394: utl_file.put_line(fh, '');
395: end if;
396:
397: utl_file.put_line(fh,'end Generate;');
398: utl_file.put_line(fh, '');
393: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
394: utl_file.put_line(fh, '');
395: end if;
396:
397: utl_file.put_line(fh,'end Generate;');
398: utl_file.put_line(fh, '');
399: utl_file.put_line(fh,'--');
400: utl_file.put_line(fh,'-- Rule functions');
401: utl_file.put_line(fh,'--');
394: utl_file.put_line(fh, '');
395: end if;
396:
397: utl_file.put_line(fh,'end Generate;');
398: utl_file.put_line(fh, '');
399: utl_file.put_line(fh,'--');
400: utl_file.put_line(fh,'-- Rule functions');
401: utl_file.put_line(fh,'--');
402:
395: end if;
396:
397: utl_file.put_line(fh,'end Generate;');
398: utl_file.put_line(fh, '');
399: utl_file.put_line(fh,'--');
400: utl_file.put_line(fh,'-- Rule functions');
401: utl_file.put_line(fh,'--');
402:
403: utl_file.put_line(fh,'PROCEDURE RuleFunction(p_func_name in varchar2,');
396:
397: utl_file.put_line(fh,'end Generate;');
398: utl_file.put_line(fh, '');
399: utl_file.put_line(fh,'--');
400: utl_file.put_line(fh,'-- Rule functions');
401: utl_file.put_line(fh,'--');
402:
403: utl_file.put_line(fh,'PROCEDURE RuleFunction(p_func_name in varchar2,');
404: utl_file.put_line(fh,' p_subscription_guid in raw,');
397: utl_file.put_line(fh,'end Generate;');
398: utl_file.put_line(fh, '');
399: utl_file.put_line(fh,'--');
400: utl_file.put_line(fh,'-- Rule functions');
401: utl_file.put_line(fh,'--');
402:
403: utl_file.put_line(fh,'PROCEDURE RuleFunction(p_func_name in varchar2,');
404: utl_file.put_line(fh,' p_subscription_guid in raw,');
405: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
399: utl_file.put_line(fh,'--');
400: utl_file.put_line(fh,'-- Rule functions');
401: utl_file.put_line(fh,'--');
402:
403: utl_file.put_line(fh,'PROCEDURE RuleFunction(p_func_name in varchar2,');
404: utl_file.put_line(fh,' p_subscription_guid in raw,');
405: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
406: utl_file.put_line(fh,' x_result in out nocopy varchar2,');
407: utl_file.put_line(fh,' x_executed out nocopy boolean)');
400: utl_file.put_line(fh,'-- Rule functions');
401: utl_file.put_line(fh,'--');
402:
403: utl_file.put_line(fh,'PROCEDURE RuleFunction(p_func_name in varchar2,');
404: utl_file.put_line(fh,' p_subscription_guid in raw,');
405: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
406: utl_file.put_line(fh,' x_result in out nocopy varchar2,');
407: utl_file.put_line(fh,' x_executed out nocopy boolean)');
408: utl_file.put_line(fh,'as');
401: utl_file.put_line(fh,'--');
402:
403: utl_file.put_line(fh,'PROCEDURE RuleFunction(p_func_name in varchar2,');
404: utl_file.put_line(fh,' p_subscription_guid in raw,');
405: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
406: utl_file.put_line(fh,' x_result in out nocopy varchar2,');
407: utl_file.put_line(fh,' x_executed out nocopy boolean)');
408: utl_file.put_line(fh,'as');
409: utl_file.put_line(fh,' l_funcname varchar2(240);');
402:
403: utl_file.put_line(fh,'PROCEDURE RuleFunction(p_func_name in varchar2,');
404: utl_file.put_line(fh,' p_subscription_guid in raw,');
405: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
406: utl_file.put_line(fh,' x_result in out nocopy varchar2,');
407: utl_file.put_line(fh,' x_executed out nocopy boolean)');
408: utl_file.put_line(fh,'as');
409: utl_file.put_line(fh,' l_funcname varchar2(240);');
410: utl_file.put_line(fh,' l_event_name varchar2(240);');
403: utl_file.put_line(fh,'PROCEDURE RuleFunction(p_func_name in varchar2,');
404: utl_file.put_line(fh,' p_subscription_guid in raw,');
405: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
406: utl_file.put_line(fh,' x_result in out nocopy varchar2,');
407: utl_file.put_line(fh,' x_executed out nocopy boolean)');
408: utl_file.put_line(fh,'as');
409: utl_file.put_line(fh,' l_funcname varchar2(240);');
410: utl_file.put_line(fh,' l_event_name varchar2(240);');
411: utl_file.put_line(fh,'begin');
404: utl_file.put_line(fh,' p_subscription_guid in raw,');
405: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
406: utl_file.put_line(fh,' x_result in out nocopy varchar2,');
407: utl_file.put_line(fh,' x_executed out nocopy boolean)');
408: utl_file.put_line(fh,'as');
409: utl_file.put_line(fh,' l_funcname varchar2(240);');
410: utl_file.put_line(fh,' l_event_name varchar2(240);');
411: utl_file.put_line(fh,'begin');
412: utl_file.put_line(fh,' x_executed := FALSE;');
405: utl_file.put_line(fh,' p_event in out nocopy wf_event_t,');
406: utl_file.put_line(fh,' x_result in out nocopy varchar2,');
407: utl_file.put_line(fh,' x_executed out nocopy boolean)');
408: utl_file.put_line(fh,'as');
409: utl_file.put_line(fh,' l_funcname varchar2(240);');
410: utl_file.put_line(fh,' l_event_name varchar2(240);');
411: utl_file.put_line(fh,'begin');
412: utl_file.put_line(fh,' x_executed := FALSE;');
413: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
406: utl_file.put_line(fh,' x_result in out nocopy varchar2,');
407: utl_file.put_line(fh,' x_executed out nocopy boolean)');
408: utl_file.put_line(fh,'as');
409: utl_file.put_line(fh,' l_funcname varchar2(240);');
410: utl_file.put_line(fh,' l_event_name varchar2(240);');
411: utl_file.put_line(fh,'begin');
412: utl_file.put_line(fh,' x_executed := FALSE;');
413: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
414: utl_file.put_line(fh,' l_event_name := upper(p_event.event_name);');
407: utl_file.put_line(fh,' x_executed out nocopy boolean)');
408: utl_file.put_line(fh,'as');
409: utl_file.put_line(fh,' l_funcname varchar2(240);');
410: utl_file.put_line(fh,' l_event_name varchar2(240);');
411: utl_file.put_line(fh,'begin');
412: utl_file.put_line(fh,' x_executed := FALSE;');
413: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
414: utl_file.put_line(fh,' l_event_name := upper(p_event.event_name);');
415:
408: utl_file.put_line(fh,'as');
409: utl_file.put_line(fh,' l_funcname varchar2(240);');
410: utl_file.put_line(fh,' l_event_name varchar2(240);');
411: utl_file.put_line(fh,'begin');
412: utl_file.put_line(fh,' x_executed := FALSE;');
413: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
414: utl_file.put_line(fh,' l_event_name := upper(p_event.event_name);');
415:
416:
409: utl_file.put_line(fh,' l_funcname varchar2(240);');
410: utl_file.put_line(fh,' l_event_name varchar2(240);');
411: utl_file.put_line(fh,'begin');
412: utl_file.put_line(fh,' x_executed := FALSE;');
413: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
414: utl_file.put_line(fh,' l_event_name := upper(p_event.event_name);');
415:
416:
417: l_first_r := TRUE;
410: utl_file.put_line(fh,' l_event_name varchar2(240);');
411: utl_file.put_line(fh,'begin');
412: utl_file.put_line(fh,' x_executed := FALSE;');
413: utl_file.put_line(fh,' l_funcname := upper(trim(p_func_name));');
414: utl_file.put_line(fh,' l_event_name := upper(p_event.event_name);');
415:
416:
417: l_first_r := TRUE;
418: for seeded_rulefunc_rec in seeded_rule_funcs() loop
416:
417: l_first_r := TRUE;
418: for seeded_rulefunc_rec in seeded_rule_funcs() loop
419: if (l_first_r) then
420: utl_file.put_line(fh, '');
421: utl_file.put_line(fh, ' -- Seeded Rule Functions');
422: l_first_r := FALSE;
423: end if;
424:
417: l_first_r := TRUE;
418: for seeded_rulefunc_rec in seeded_rule_funcs() loop
419: if (l_first_r) then
420: utl_file.put_line(fh, '');
421: utl_file.put_line(fh, ' -- Seeded Rule Functions');
422: l_first_r := FALSE;
423: end if;
424:
425: utl_file.put_line(fh,' if (l_funcname = '''
421: utl_file.put_line(fh, ' -- Seeded Rule Functions');
422: l_first_r := FALSE;
423: end if;
424:
425: utl_file.put_line(fh,' if (l_funcname = '''
426: || seeded_rulefunc_rec.function || ''') then');
427: utl_file.put_line(fh,' ' || 'x_result := '||seeded_rulefunc_rec.function
428: || '(p_subscription_guid, p_event);');
429: utl_file.put_line(fh,' x_executed := TRUE;');
423: end if;
424:
425: utl_file.put_line(fh,' if (l_funcname = '''
426: || seeded_rulefunc_rec.function || ''') then');
427: utl_file.put_line(fh,' ' || 'x_result := '||seeded_rulefunc_rec.function
428: || '(p_subscription_guid, p_event);');
429: utl_file.put_line(fh,' x_executed := TRUE;');
430: utl_file.put_line(fh,' return;');
431: utl_file.put_line(fh,' end if; ');
425: utl_file.put_line(fh,' if (l_funcname = '''
426: || seeded_rulefunc_rec.function || ''') then');
427: utl_file.put_line(fh,' ' || 'x_result := '||seeded_rulefunc_rec.function
428: || '(p_subscription_guid, p_event);');
429: utl_file.put_line(fh,' x_executed := TRUE;');
430: utl_file.put_line(fh,' return;');
431: utl_file.put_line(fh,' end if; ');
432: end loop;
433:
426: || seeded_rulefunc_rec.function || ''') then');
427: utl_file.put_line(fh,' ' || 'x_result := '||seeded_rulefunc_rec.function
428: || '(p_subscription_guid, p_event);');
429: utl_file.put_line(fh,' x_executed := TRUE;');
430: utl_file.put_line(fh,' return;');
431: utl_file.put_line(fh,' end if; ');
432: end loop;
433:
434:
427: utl_file.put_line(fh,' ' || 'x_result := '||seeded_rulefunc_rec.function
428: || '(p_subscription_guid, p_event);');
429: utl_file.put_line(fh,' x_executed := TRUE;');
430: utl_file.put_line(fh,' return;');
431: utl_file.put_line(fh,' end if; ');
432: end loop;
433:
434:
435: if (p_correlation_ids is not null) then
440: for rulefunc_rec in all_rule_funcs(p_correlation_ids(i)) loop
441: l_atleast_one_r := TRUE;
442: l_generated_r := TRUE;
443: if (l_first_r) then
444: utl_file.put_line(fh, '');
445: utl_file.put_line(fh, ' -- Function calls for correlation id ' || p_correlation_ids(i) ||'%');
446: utl_file.put_line(fh, ' if (l_event_name like '''
447: || p_correlation_ids(i) || '%'') then ');
448: l_first_r := FALSE;
441: l_atleast_one_r := TRUE;
442: l_generated_r := TRUE;
443: if (l_first_r) then
444: utl_file.put_line(fh, '');
445: utl_file.put_line(fh, ' -- Function calls for correlation id ' || p_correlation_ids(i) ||'%');
446: utl_file.put_line(fh, ' if (l_event_name like '''
447: || p_correlation_ids(i) || '%'') then ');
448: l_first_r := FALSE;
449: end if;
442: l_generated_r := TRUE;
443: if (l_first_r) then
444: utl_file.put_line(fh, '');
445: utl_file.put_line(fh, ' -- Function calls for correlation id ' || p_correlation_ids(i) ||'%');
446: utl_file.put_line(fh, ' if (l_event_name like '''
447: || p_correlation_ids(i) || '%'') then ');
448: l_first_r := FALSE;
449: end if;
450:
447: || p_correlation_ids(i) || '%'') then ');
448: l_first_r := FALSE;
449: end if;
450:
451: utl_file.put_line(fh,' if (l_funcname = '''
452: || rulefunc_rec.function || ''') then');
453: utl_file.put_line(fh,' ' || 'x_result := '||rulefunc_rec.function
454: || '(p_subscription_guid, p_event);');
455: utl_file.put_line(fh,' x_executed := TRUE;');
449: end if;
450:
451: utl_file.put_line(fh,' if (l_funcname = '''
452: || rulefunc_rec.function || ''') then');
453: utl_file.put_line(fh,' ' || 'x_result := '||rulefunc_rec.function
454: || '(p_subscription_guid, p_event);');
455: utl_file.put_line(fh,' x_executed := TRUE;');
456: utl_file.put_line(fh,' return;');
457: utl_file.put_line(fh,' end if; ');
451: utl_file.put_line(fh,' if (l_funcname = '''
452: || rulefunc_rec.function || ''') then');
453: utl_file.put_line(fh,' ' || 'x_result := '||rulefunc_rec.function
454: || '(p_subscription_guid, p_event);');
455: utl_file.put_line(fh,' x_executed := TRUE;');
456: utl_file.put_line(fh,' return;');
457: utl_file.put_line(fh,' end if; ');
458: end loop;
459: if (l_atleast_one_r) then
452: || rulefunc_rec.function || ''') then');
453: utl_file.put_line(fh,' ' || 'x_result := '||rulefunc_rec.function
454: || '(p_subscription_guid, p_event);');
455: utl_file.put_line(fh,' x_executed := TRUE;');
456: utl_file.put_line(fh,' return;');
457: utl_file.put_line(fh,' end if; ');
458: end loop;
459: if (l_atleast_one_r) then
460: utl_file.put_line(fh, ' end if;');
453: utl_file.put_line(fh,' ' || 'x_result := '||rulefunc_rec.function
454: || '(p_subscription_guid, p_event);');
455: utl_file.put_line(fh,' x_executed := TRUE;');
456: utl_file.put_line(fh,' return;');
457: utl_file.put_line(fh,' end if; ');
458: end loop;
459: if (l_atleast_one_r) then
460: utl_file.put_line(fh, ' end if;');
461: end if;
456: utl_file.put_line(fh,' return;');
457: utl_file.put_line(fh,' end if; ');
458: end loop;
459: if (l_atleast_one_r) then
460: utl_file.put_line(fh, ' end if;');
461: end if;
462: end loop; -- p_correlation_ids
463: end if; -- p_correlation_ids
464:
463: end if; -- p_correlation_ids
464:
465: -- give a message within the generated file regarding the failure
466: if (not l_generated_r) then
467: utl_file.put_line(fh, '');
468: utl_file.put_line(fh, ' -- Package body could not be generated for the corrid given.');
469: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
470: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
471: utl_file.put_line(fh, '');
464:
465: -- give a message within the generated file regarding the failure
466: if (not l_generated_r) then
467: utl_file.put_line(fh, '');
468: utl_file.put_line(fh, ' -- Package body could not be generated for the corrid given.');
469: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
470: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
471: utl_file.put_line(fh, '');
472: end if;
465: -- give a message within the generated file regarding the failure
466: if (not l_generated_r) then
467: utl_file.put_line(fh, '');
468: utl_file.put_line(fh, ' -- Package body could not be generated for the corrid given.');
469: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
470: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
471: utl_file.put_line(fh, '');
472: end if;
473:
466: if (not l_generated_r) then
467: utl_file.put_line(fh, '');
468: utl_file.put_line(fh, ' -- Package body could not be generated for the corrid given.');
469: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
470: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
471: utl_file.put_line(fh, '');
472: end if;
473:
474: utl_file.put_line(fh,'end RuleFunction;');
467: utl_file.put_line(fh, '');
468: utl_file.put_line(fh, ' -- Package body could not be generated for the corrid given.');
469: utl_file.put_line(fh, ' -- The reason could be because the procedure(s) referred to by the');
470: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
471: utl_file.put_line(fh, '');
472: end if;
473:
474: utl_file.put_line(fh,'end RuleFunction;');
475:
470: utl_file.put_line(fh, ' -- corrid(s) was invalid or the corrid(s) specified do not exist');
471: utl_file.put_line(fh, '');
472: end if;
473:
474: utl_file.put_line(fh,'end RuleFunction;');
475:
476:
477: utl_file.put_line(fh,'end WF_BES_DYN_FUNCS;');
478: utl_file.put_line(fh,'/');
473:
474: utl_file.put_line(fh,'end RuleFunction;');
475:
476:
477: utl_file.put_line(fh,'end WF_BES_DYN_FUNCS;');
478: utl_file.put_line(fh,'/');
479: utl_file.put_line(fh,'commit;');
480: utl_file.put_line(fh,'exit;');
481: utl_file.put_line(fh,' ');
474: utl_file.put_line(fh,'end RuleFunction;');
475:
476:
477: utl_file.put_line(fh,'end WF_BES_DYN_FUNCS;');
478: utl_file.put_line(fh,'/');
479: utl_file.put_line(fh,'commit;');
480: utl_file.put_line(fh,'exit;');
481: utl_file.put_line(fh,' ');
482: utl_file.fclose(fh);
475:
476:
477: utl_file.put_line(fh,'end WF_BES_DYN_FUNCS;');
478: utl_file.put_line(fh,'/');
479: utl_file.put_line(fh,'commit;');
480: utl_file.put_line(fh,'exit;');
481: utl_file.put_line(fh,' ');
482: utl_file.fclose(fh);
483:
476:
477: utl_file.put_line(fh,'end WF_BES_DYN_FUNCS;');
478: utl_file.put_line(fh,'/');
479: utl_file.put_line(fh,'commit;');
480: utl_file.put_line(fh,'exit;');
481: utl_file.put_line(fh,' ');
482: utl_file.fclose(fh);
483:
484: dbms_output.put_line('File generated is '||utl_dir||'/'||l_filename);
477: utl_file.put_line(fh,'end WF_BES_DYN_FUNCS;');
478: utl_file.put_line(fh,'/');
479: utl_file.put_line(fh,'commit;');
480: utl_file.put_line(fh,'exit;');
481: utl_file.put_line(fh,' ');
482: utl_file.fclose(fh);
483:
484: dbms_output.put_line('File generated is '||utl_dir||'/'||l_filename);
485: exception
478: utl_file.put_line(fh,'/');
479: utl_file.put_line(fh,'commit;');
480: utl_file.put_line(fh,'exit;');
481: utl_file.put_line(fh,' ');
482: utl_file.fclose(fh);
483:
484: dbms_output.put_line('File generated is '||utl_dir||'/'||l_filename);
485: exception
486: when others then
483:
484: dbms_output.put_line('File generated is '||utl_dir||'/'||l_filename);
485: exception
486: when others then
487: if (utl_file.is_open(fh)) then
488: utl_file.fclose(fh);
489: end if;
490: raise;
491: end StaticGenerateRule;
484: dbms_output.put_line('File generated is '||utl_dir||'/'||l_filename);
485: exception
486: when others then
487: if (utl_file.is_open(fh)) then
488: utl_file.fclose(fh);
489: end if;
490: raise;
491: end StaticGenerateRule;
492: