DBA Data[Home] [Help]

PACKAGE: APPS.OKC_WF

Source


1 PACKAGE okc_wf authid current_user as
2 /*$Header: OKCRWFSS.pls 120.3 2011/03/10 18:08:59 harchand noship $*/
3 
4 subtype p_outcomerec_type is okc_outcome_init_pvt.p_outcomerec_type;
5 subtype p_outcometbl_type is okc_outcome_init_pvt.p_outcometbl_type;
6 -- we use the above table as outcome's parameters table for building the
7 -- formatted string with the parameters for sending to workflow process
8 
9 /* definitions for the above subtypes as it is defined in okc code
10 just for info
11  TYPE p_outcomerec_type IS RECORD(
12     name        okc_process_def_parameters_v.name%TYPE,
13     data_type   okc_process_def_parameters_v.data_type%TYPE,
14     value       okc_process_def_parameters_v.default_value%TYPE);
15  TYPE p_outcometbl_type IS TABLE OF p_outcomerec_type
16  INDEX BY BINARY_INTEGER;
17 */
18 
19 procedure init_wf_string;  -- clean the string
20 -- set the string if you know it's format (know what are you doing)
21 procedure init_wf_string(p_wf in varchar2);
22 
23 -- builds the string from outcome name and outcome parameters table
24 -- (see above the table definition)
25 -- it's exactly like it has been used in okc code
26 function build_wf_string(   p_outcome_name in varchar2,
27                             p_outcome_tbl in p_outcometbl_type
28                             )   return varchar2;
29 
30 -- call the below two procedures if you want to build the formatted string
31 -- yourself
32 
33 -- set the string header (it's outcome name setting)
34 procedure init_wf_header(p_head in varchar2);
35 
36 -- call the procedure in loop after the previous one if you want build the
37 -- formatted string without outcome parameters table usage (it's parameters
38 -- settings)
39 -- only valid parameter types are ('DATE','CHAR','NUMBER') - skips all others
40 procedure append_wf_string( p_dnum in number,
41                             p_dname in varchar2,
42                             p_dtype in varchar2,
43                             p_dvalue in varchar2
44                             );
45 /*
46 the formatted string looks like (for example):
47 
48 \h=OKC_TEST.UPD_COMMENTS
49 \#=1\t=N\n=P_API_VERSION\l=3\v=1.0
50 \#=2\t=C\n=P_COMMENTS\l=28\v=the contract has been signed
51 \#=3\t=C\n=P_NEW_K_MODIFIER\l=19\v=OKC_API.G_MISS_CHAR
52 \#=4\t=C\n=P_NEW_K_NUMBER\l=5\v=mar11
53 \#=5\t=N\n=P_OLD_KID\l=39\v=267689698479967951429302244026754724781
54 
55 structure of the formatted string:
56 \h - outcome name
57 \# - parameter number
58 \t - parameter type (only valid C/N/D (CHAR/NUMBER/DATE))
59 \n - parameter name
60 \l - parameter's value length
61 \v - parameter's value
62 */
63 
64 function get_wf_string return varchar2;   -- get the string
65 
66 -- gets p_num'th parameter from the string returns it as number
67 function Nvalue(p_num in number) return number;
68 
69 -- gets p_num'th parameter from the string returns it as date
70 function Dvalue(p_num in number) return date;
71 
72 -- gets p_num'th parameter from the string returns it as varchar2
73 function Cvalue(p_num in number) return varchar2;
74 
75 -- pre-builds the plsql procedure call (pre-build means - there is no standard
76 -- trail for the call)
77 function prebuild_wf_plsql  return varchar2;
78 function prebuild_wf_plsql(p_wf in varchar2)   return varchar2;
79 
80 -- builds and returns the plsql call - uses prebuild_wf_plsql output as input
81 -- parameter and adds standard trail and 'begin' ... 'end'
82 function build_wf_plsql(p_prebuilt_wf_plsql in varchar2)   return varchar2;
83 
84 -- executes the built plsql call (only for testing and debugging)
85 function exec_wf_plsql(p_proc in varchar2)   return varchar2;
86 
87 End okc_wf;