CREATE OR REPLACE PACKAGE sy_process IS ---------- Debug Levels nodebu

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
CREATE OR REPLACE PACKAGE sy_process IS
---------- Debug Levels
nodebug CONSTANT dtype.name %TYPE := 'NO';
onlydebug CONSTANT dtype.name %TYPE := 'DEBUG';
onlytrace CONSTANT dtype.name %TYPE := 'TRACE';
allinfo CONSTANT dtype.name %TYPE := 'ALL';
---------- Message Types
information CONSTANT dtype.tag %TYPE := 'I';
warning CONSTANT dtype.tag %TYPE := 'W';
error CONSTANT dtype.tag %TYPE := 'E';
fatalerror CONSTANT dtype.tag %TYPE := 'F';
debug CONSTANT dtype.tag %TYPE := 'D';
trace CONSTANT dtype.tag %TYPE := 'O';
timing CONSTANT dtype.tag %TYPE := 'T';
unitask CONSTANT dtype.tag %TYPE := 'U';
multytask CONSTANT dtype.tag %TYPE := 'M';
securityalert CONSTANT dtype.tag %TYPE := 'S';
---------- Uniqueness Types ---------------
uniunique CONSTANT dtype.tag %TYPE := 'Y'; -- Fail when start the same
uninotunique CONSTANT dtype.tag %TYPE := 'N'; -- Allow to start the same
uniclose CONSTANT dtype.tag %TYPE := 'S'; -- Reject previous when start the same
unisessclose CONSTANT dtype.tag %TYPE := 'C'; -- Reject previous when start the same in the same session
---------- Process Statuses ---------------
statusactive CONSTANT dtype.tag %TYPE := 'A'; -- In progress
statussuspended CONSTANT dtype.tag %TYPE := 'P'; -- Temporary paused
statusstopped CONSTANT dtype.tag %TYPE := 'I'; -- Sent a termination command
statusclosed CONSTANT dtype.tag %TYPE := 'C'; -- Finished normally
statusrejected CONSTANT dtype.tag %TYPE := 'J'; -- Finished abnormally
---------- Aux Session Statuses
auxsessionscheduled CONSTANT dtype.tag %TYPE := 'Q';
auxsessionactive CONSTANT dtype.tag %TYPE := 'A';
auxsessionfinished CONSTANT dtype.tag %TYPE := 'C';
auxsessionspawned CONSTANT dtype.tag %TYPE := 'S';
TYPE tprocessinfo IS RECORD(
processid dtype.recordid %TYPE,
sessionid dtype.recordid %TYPE,
sessionrole dtype.name %TYPE,
isgrp dtype.tag %TYPE,
processname dtype.name %TYPE,
processnameext dtype.name %TYPE,
objecttype dtype.name %TYPE,
objectid dtype.recordid %TYPE,
sysinstanceid dtype.recordid %TYPE,
procauxid dtype.recordid %TYPE,
dbmsspec dtype.longstr %TYPE);
PROCEDURE schedule_proc_aux
(
processid IN dtype.recordid %TYPE,
sessionid IN dtype.recordid %TYPE,
sessionrole IN dtype.name %TYPE,
indbmsspec IN dtype.longstr %TYPE
);
FUNCTION curr_debug_level
(
permdebuglevel IN dtype.name %TYPE,
tmpdebuglevel IN dtype.name %TYPE,
tmpdebuglevelto IN dtype.currentdate %TYPE,
currtime IN dtype.currentdate %TYPE
) RETURN dtype.tag %TYPE;
PRAGMA RESTRICT_REFERENCES(curr_debug_level, WNDS, WNPS, RNDS);
FUNCTION get_debug_level RETURN dtype.name %TYPE;
PRAGMA RESTRICT_REFERENCES(get_debug_level, WNDS, WNPS);
PROCEDURE set_debug_level(level_in IN dtype.name %TYPE);
PRAGMA RESTRICT_REFERENCES(set_debug_level, WNDS, RNDS);
FUNCTION get_current_process RETURN dtype.recordid %TYPE;
PRAGMA RESTRICT_REFERENCES(get_current_process, WNDS, WNPS);
FUNCTION get_current_process_name RETURN dtype.name %TYPE;
PRAGMA RESTRICT_REFERENCES(get_current_process_name, WNDS, WNPS);
FUNCTION get_current_object_type RETURN dtype.name %TYPE;
PRAGMA RESTRICT_REFERENCES(get_current_object_type, WNDS, WNPS);
FUNCTION get_current_object_id RETURN dtype.name %TYPE;
PRAGMA RESTRICT_REFERENCES(get_current_object_id, WNDS, WNPS);
FUNCTION get_last_process RETURN dtype.recordid %TYPE;
PRAGMA RESTRICT_REFERENCES(get_last_process, WNDS, WNPS);
FUNCTION get_process_parameter
(
processid IN dtype.recordid %TYPE,
incachedparameters IN dtype.longstr %TYPE,
iniscacheincomplete IN dtype.tag %TYPE,
parametername IN dtype.name %TYPE,
defaultvalue IN dtype.name %TYPE
) RETURN dtype.xmlstring %TYPE;
FUNCTION get_current_prm_string RETURN dtype.name %TYPE;
FUNCTION get_current_parameter
(
parametername IN dtype.name %TYPE,
defaultvalue IN dtype.name %TYPE
) RETURN dtype.xmlstring %TYPE;
FUNCTION get_proc_prm_template
(
processname IN dtype.name %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
prmcode IN dtype.name %TYPE
) RETURN dtype.longstr %TYPE;
PROCEDURE start_process_v5
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
parentprocessid IN dtype.recordid %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
processidt IN dtype.name %TYPE,
filledprocessparms OUT dtype.longstr %TYPE,
processid OUT dtype.recordid %TYPE
);
PROCEDURE start_process_v3
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
parentprocessid IN dtype.recordid %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
filledprocessparms OUT dtype.longstr %TYPE,
processid OUT dtype.recordid %TYPE
);
PROCEDURE start_process
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
processid OUT dtype.recordid %TYPE
);
PROCEDURE start_simple_process
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
processid OUT dtype.recordid %TYPE
);
FUNCTION find_process
(
processname IN dtype.name %TYPE,
processparams IN dtype.name %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE
) RETURN dtype.recordid %TYPE;
PROCEDURE find_or_start_process_v2
(
processname IN dtype.name %TYPE,
processparams IN dtype.name %TYPE,
parentprocessid IN dtype.recordid %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
defaultparameters IN dtype.longstr %TYPE,
processid OUT dtype.recordid %TYPE,
isprocessnew OUT dtype.tag %TYPE
);
PROCEDURE find_or_start_process
(
processname IN dtype.name %TYPE,
processparams IN dtype.name %TYPE,
parentprocessid IN dtype.recordid %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
processid OUT dtype.recordid %TYPE,
isprocessnew OUT dtype.tag %TYPE
);
PROCEDURE finish_process_v3
(
processid IN dtype.recordid %TYPE,
isok IN dtype.tag %TYPE,
parentprocessid OUT dtype.recordid %TYPE
);
PROCEDURE finish_process
(
processid IN dtype.recordid %TYPE,
isok IN dtype.tag %TYPE
);
PROCEDURE start_current_v6
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
tostartsub IN dtype.tag %TYPE,
isgrp IN dtype.tag %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
processidt IN dtype.name %TYPE,
defaultparameters IN dtype.longstr %TYPE,
isactive OUT dtype.tag %TYPE
);
PROCEDURE start_current_v4
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
tostartsub IN dtype.tag %TYPE,
isgrp IN dtype.tag %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
isactive OUT dtype.tag %TYPE
);
PROCEDURE start_current_v3
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
tostartsub IN dtype.tag %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
isactive OUT dtype.tag %TYPE
);
PROCEDURE start_current
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
isactive OUT dtype.tag %TYPE
);
PROCEDURE start_simple
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE
);
PROCEDURE start_current_if_need_obj
(
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
isactive OUT dtype.tag %TYPE,
wasstarted OUT dtype.tag %TYPE
);
PROCEDURE start_current_if_need
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
isactive OUT dtype.tag %TYPE,
wasstarted OUT dtype.tag %TYPE
);
PROCEDURE start_simple_if_need
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
wasstarted OUT dtype.tag %TYPE
);
PROCEDURE finish_current_if_need
(
wasstarted IN dtype.tag %TYPE,
isok IN dtype.tag %TYPE
);
PROCEDURE finish_current(isok IN dtype.tag %TYPE);
PROCEDURE start_button_process_obj
(
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
wasstarted OUT dtype.tag %TYPE
);
PROCEDURE start_button_process
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
wasstarted OUT dtype.tag %TYPE
);
FUNCTION finish_button_process
(
wasstarted IN dtype.tag %TYPE,
errmsg IN dtype.errormessage %TYPE
) RETURN dtype.errormessage %TYPE;
FUNCTION finish_button_process_obj
(
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
wasstarted IN dtype.tag %TYPE,
errmsg IN dtype.errormessage %TYPE
) RETURN dtype.errormessage %TYPE;
FUNCTION finish_button_process_exc(wasstarted IN dtype.tag %TYPE) RETURN dtype.errormessage %TYPE;
FUNCTION finish_button_process_obj_exc
(
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
wasstarted IN dtype.tag %TYPE
) RETURN dtype.errormessage %TYPE;
PROCEDURE update_process_parameters
(
processid IN dtype.recordid %TYPE,
newprocessprms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
waschanged OUT dtype.tag %TYPE
);
PROCEDURE update_current_parameters
(
newprocessprms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
waschanged OUT dtype.tag %TYPE
);
PROCEDURE process_start1
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE,
processid OUT dtype.recordid %TYPE,
retcode OUT dtype.counter %TYPE
);
FUNCTION process_start
(
processname IN dtype.name %TYPE,
processparms IN dtype.name %TYPE,
isunique IN dtype.tag %TYPE
) RETURN dtype.counter %TYPE;
PROCEDURE process_end1(processid IN dtype.recordid %TYPE);
PROCEDURE process_end;
PROCEDURE process_reject1(processid IN dtype.recordid %TYPE);
PROCEDURE process_reject;
-- - legacy interface
PROCEDURE detach_process_v2(auxsessionstatus IN dtype.tag %TYPE);
PROCEDURE detach_process;
FUNCTION is_current_right_sys RETURN dtype.tag %TYPE;
FUNCTION have_other_auxes_finished RETURN dtype.tag %TYPE;
PROCEDURE set_last_process(processid IN dtype.recordid %TYPE);
PROCEDURE get_process_info
(
processid IN dtype.recordid %TYPE,
sessionid IN dtype.recordid %TYPE,
sessionrole IN dtype.name %TYPE,
processinfo OUT tprocessinfo
);
PROCEDURE attach_process_r(processinfo IN tprocessinfo);
PROCEDURE attach_process_v3(processid IN dtype.recordid %TYPE - 03.39.30 dbk - 592 * /);
PROCEDURE attach_process_v2
(
processid IN dtype.recordid %TYPE,
inprocessname IN dtype.name %TYPE,
inprocessparameters IN dtype.name %TYPE
);
PROCEDURE attach_process
(
processid IN dtype.recordid %TYPE,
inprocessname IN dtype.name %TYPE
);
FUNCTION get_curr_proc_aux_dbms_spec RETURN dtype.longstr %TYPE;
PROCEDURE set_total_number1
(
processid IN dtype.recordid %TYPE,
n IN dtype.counter %TYPE
);
PROCEDURE set_total_number(n IN dtype.counter %TYPE);
PROCEDURE renew_process_status
(
processid IN dtype.recordid %TYPE,
processstatus IN OUT dtype.tag %TYPE
);
FUNCTION is_process_to_continue(processid IN dtype.recordid %TYPE) RETURN dtype.tag %TYPE;
FUNCTION is_current_to_continue RETURN dtype.tag %TYPE;
FUNCTION add_current_number1
(
processid IN dtype.recordid %TYPE,
n IN dtype.counter %TYPE
) RETURN dtype.counter %TYPE;
FUNCTION add_current_number(n IN dtype.counter %TYPE) RETURN dtype.counter %TYPE;
FUNCTION suspend_process(processid IN dtype.recordid %TYPE) RETURN dtype.errormessage %TYPE;
FUNCTION resume_process(processid IN dtype.recordid %TYPE) RETURN dtype.errormessage %TYPE;
FUNCTION process_stop(processid IN dtype.recordid %TYPE) RETURN dtype.errormessage %TYPE;
FUNCTION stop_and_clear_process(processid IN dtype.recordid %TYPE) RETURN dtype.errormessage %TYPE;
FUNCTION change_process_debug_level(processid IN dtype.recordid %TYPE) RETURN dtype.errormessage %TYPE;
FUNCTION process_stop_periodic
(
processid IN dtype.recordid %TYPE,
isok IN dtype.tag %TYPE
) RETURN dtype.errormessage %TYPE;
FUNCTION terminate_job_process(processid IN dtype.recordid %TYPE) RETURN dtype.errormessage %TYPE;
FUNCTION process_clear(processid IN dtype.recordid %TYPE) RETURN dtype.errormessage %TYPE;
FUNCTION clear_process_lc RETURN dtype.errormessage %TYPE;
PROCEDURE process_clear1(processid IN dtype.recordid %TYPE);
FUNCTION set_lc_date_to_default RETURN dtype.errormessage %TYPE;
FUNCTION clear_old_processes_lc RETURN dtype.errormessage %TYPE;
FUNCTION lock_process_status1(processid IN dtype.recordid %TYPE) RETURN dtype.tag %TYPE;
FUNCTION lock_process_status RETURN dtype.tag %TYPE;
FUNCTION get_process_error_level1(processid IN dtype.recordid %TYPE) RETURN dtype.tag %TYPE;
FUNCTION get_process_error_level RETURN dtype.tag %TYPE;
PROCEDURE process_object_message1
(
processid IN dtype.recordid %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
messagetype IN dtype.tag %TYPE,
messagetext IN dtype.errormessage %TYPE
);
PROCEDURE process_object_message
(
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE,
messagetype IN dtype.tag %TYPE,
messagetext IN dtype.errormessage %TYPE
);
PROCEDURE process_doc_message1
(
processid IN dtype.recordid %TYPE,
docid IN dtype.recordid %TYPE,
messagetype IN dtype.tag %TYPE,
messagetext IN dtype.errormessage %TYPE
);
PROCEDURE process_doc_message
(
docid IN dtype.recordid %TYPE,
messagetype IN dtype.tag %TYPE,
messagetext IN dtype.errormessage %TYPE
);
PROCEDURE process_message1
(
processid IN dtype.recordid %TYPE,
messagetype IN dtype.tag %TYPE,
messagetext IN dtype.errormessage %TYPE
);
PROCEDURE process_message
(
messagetype IN dtype.tag %TYPE,
messagetext IN dtype.errormessage %TYPE
);
PROCEDURE process_file_message1
(
processid IN dtype.recordid %TYPE,
messagetype IN dtype.tag %TYPE,
messagetext IN dtype.errormessage %TYPE,
fileinfoid IN dtype.recordid %TYPE,
filerecordparams IN dtype.name %TYPE
);
PROCEDURE process_file_message
(
messagetype IN dtype.tag %TYPE,
messagetext IN dtype.errormessage %TYPE,
fileinfoid IN dtype.recordid %TYPE,
filerecordparams IN dtype.name %TYPE
);
PROCEDURE process_exception_message;
PROCEDURE start_export_file
(
filename IN dtype.name %TYPE,
filetype IN dtype.name %TYPE,
fileid IN dtype.name %TYPE,
params IN dtype.name %TYPE,
fileinfoid OUT dtype.recordid %TYPE
);
PROCEDURE finish_export_file
(
fileinfoid IN dtype.recordid %TYPE,
recordsexported IN dtype.counter %TYPE
);
FUNCTION get_reject_message(processid IN dtype.recordid %TYPE) RETURN dtype.longstr %TYPE;
PRAGMA RESTRICT_REFERENCES(get_reject_message, WNDS, WNPS);
PROCEDURE set_process_buffered
(
processid IN dtype.recordid %TYPE,
buffered IN dtype.tag %TYPE
);
PROCEDURE set_current_buffered(buffered IN dtype.tag %TYPE);
PROCEDURE flush_buffered_messages
(
processid IN dtype.recordid %TYPE,
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE
);
PROCEDURE flush_current_messages
(
objecttype IN dtype.name %TYPE,
objectid IN dtype.recordid %TYPE
);
PROCEDURE wait_for_v2
(
processid IN dtype.recordid %TYPE,
waitingtimeout IN dtype.counter %TYPE,
processstatus OUT dtype.tag %TYPE,
processednumber OUT dtype.counter %TYPE
);
FUNCTION wait_for(processid IN dtype.recordid %TYPE) RETURN dtype.tag %TYPE;
PROCEDURE wait_for_last_v1
(
processstatus OUT dtype.tag %TYPE,
processednumber OUT dtype.counter %TYPE,
errmsg OUT dtype.errormessage %TYPE
);
FUNCTION wait_for_last RETURN dtype.errormessage %TYPE;
PROCEDURE wait_for_name(processname IN dtype.name %TYPE);
FUNCTION from_module(processid IN dtype.recordid %TYPE) RETURN dtype.tag %TYPE;
FUNCTION get_stored_parameter
(
processid IN dtype.recordid %TYPE,
prmname IN dtype.name %TYPE
) RETURN dtype.xmlstring %TYPE;
PROCEDURE set_stored_parameter
(
processid IN dtype.recordid %TYPE,
prmname IN dtype.name %TYPE,
prmvalue IN dtype.xmlstring %TYPE
);
FUNCTION get_curr_stored_parameter(prmname IN dtype.name %TYPE) RETURN dtype.xmlstring %TYPE;
PROCEDURE set_curr_stored_parameter
(
prmname IN dtype.name %TYPE,
prmvalue IN dtype.xmlstring %TYPE
);
END sy_process;
/