1 PACKAGE OE_VALIDATE_WF AUTHID CURRENT_USER AS
2 /* $Header: OEXVVWFS.pls 120.1.12000000.1 2007/01/16 22:13:06 appldev ship $ */
3
4 /*----------------------------------------------------------------
5 Global variables used in the context of validating flows
6 ------------------------------------------------------------------*/
7 -- Variable_name VARIABLE_DATATYPE := <DEFAULT>
8
9 -- Activities Record type
10 TYPE Activities_Rec_Type IS RECORD
11 ( activity_name VARCHAR2(30)
12 , process_name VARCHAR2(30)
13 , activity_item_type VARCHAR2(8)
14 , instance_id NUMBER
15 , type VARCHAR2(8)
16 , function VARCHAR2(240)
17 , instance_label VARCHAR2(30)
18 , start_end VARCHAR2(8)
19 );
20
21 TYPE Activities_Tbl_Type IS TABLE OF Activities_Rec_Type
22 INDEX BY BINARY_INTEGER;
23
24 -- G_loop_tbl is a package global that stores all process
25 -- activities during one non-recursive call to in_loop()
26 TYPE NumberTable IS TABLE OF NUMBER
27 INDEX BY BINARY_INTEGER;
28
29 /*
30 -- Transaction Record type
31 TYPE Transaction_Rec_Type IS RECORD
32 ( sales_document_type_code VARCHAR2(30)
33 , transaction_type_id NUMBER
34 , transaction_type_code VARCHAR2(30)
35 , order_category_code VARCHAR2(30)
36 , start_date_active DATE
37 , end_date_active DATE
38 );
39
40 TYPE Transaction_Tbl_Type IS TABLE OF Transaction_Rec_Type
41 INDEX BY BINARY_INTEGER;
42 */
43 -- Not required as the same has been handled at 'Validate' procedure level itself.
44
45 /*----------------------------------------------------------------
46 Function Display_Name
47 A function returning Display name of a process name.
48 ------------------------------------------------------------------*/
49 FUNCTION Display_Name
50 ( P_process IN OUT NOCOPY VARCHAR2
51 , P_item_type IN VARCHAR2
52 )
53 RETURN VARCHAR2;
54
55 /*----------------------------------------------------------------
56 Function In_Loop
57 A function returning Boolean.
58 ------------------------------------------------------------------*/
59 FUNCTION In_Loop
60 ( activity1 IN NUMBER
61 , activity2 IN NUMBER
62 )
63 RETURN BOOLEAN;
64
65 /*----------------------------------------------------------------
66 Function Has_Activity
67 Determines whether a workflow process contains a particular
68 activity (or subprocess) at any level. A function returning
69 Boolean.
70 ------------------------------------------------------------------*/
71 FUNCTION Has_Activity
72 ( P_process IN VARCHAR2
73 , P_process_item_type IN VARCHAR2
74 , P_activity IN VARCHAR2
75 , P_activity_item_type IN VARCHAR2
76 )
77 RETURN BOOLEAN;
78
79 /*----------------------------------------------------------------
80 Procedure Get_Activities
81 Determines all the activities or a particular activity in a
82 workflow process (and subprocess) at any level.
83 ------------------------------------------------------------------*/
84 PROCEDURE Get_Activities
85 ( P_process IN VARCHAR2
86 , P_process_item_type IN VARCHAR2
87 , P_instance_label IN VARCHAR2 DEFAULT NULL
88 , P_activity_item_type IN VARCHAR2 DEFAULT NULL
89 --, G_all_activity_tab OUT NOCOPY OE_VALIDATE_WF.Activities_Tbl_Type
90 );
91
92 /*----------------------------------------------------------------
93 Procedure Wait_And_Loops
94 Determines whether a workflow process contains a particular
95 activity (or subprocess) at any level. A function returning
96 Boolean.
97 ------------------------------------------------------------------*/
98 PROCEDURE Wait_And_Loops
99 ( P_process IN VARCHAR2
100 , P_process_item_type IN VARCHAR2
101 , P_activity_id IN NUMBER
102 , P_activity_label IN VARCHAR2
103 , P_api IN VARCHAR2
104 , X_return_status OUT NOCOPY VARCHAR2
105 );
106
107 /*------------------------------------------------------------------
108 Procedure Line_Flow_Assignment
109 Checks if a particular seeded workflow is incompatible with the OM item
110 type to which it is assigned. If so, returns error and puts a message on
111 the error stack. Determines if a customized flow might be incompatible
112 with the OM item type to which it is assigned. If yes, returns a warning
113 message and puts it on the message stack.
114 ------------------------------------------------------------------*/
115
116 PROCEDURE Line_Flow_Assignment
117 ( P_name IN VARCHAR2
118 , P_item_type IN VARCHAR2
119 , X_return_status OUT NOCOPY VARCHAR2
120 , X_msg_count OUT NOCOPY NUMBER
121 );
122
123 /*----------------------------------------------------------------
124 Procedure Check_Sync
125 Checks if continue/wait p_activity in OEOH/OEOL process p_process
126 has a corresponding wait/continue activity in the OEOL/OEOH
127 flow(s) assigned to p_order_type.
128 ------------------------------------------------------------------*/
129 PROCEDURE Check_Sync
130 ( P_process IN VARCHAR2
131 , P_process_item_type IN VARCHAR2
132 , P_order_type_id IN NUMBER
133 , P_order_flow IN VARCHAR2 DEFAULT NULL
134 , P_instance_label IN VARCHAR2
135 , P_act_item_type IN VARCHAR2
136 , P_function IN VARCHAR2 --Vaibhav
137 , P_type IN VARCHAR2 --Vaibhav
138 , P_instance_id IN NUMBER --Vaibhav
139 , X_return_status OUT NOCOPY VARCHAR2
140 );
141
142 /*----------------------------------------------------------------
143 Procedure Out_Transitions
144 Looks for any activity or subprocess in process p_name that has
145 no OUT transition defined. If any are found, error status is
146 returned and appropriate error messages logged.
147 ------------------------------------------------------------------*/
148 PROCEDURE Out_Transitions
149 ( P_name IN VARCHAR2
150 , P_type IN VARCHAR2
151 , X_return_status OUT NOCOPY VARCHAR2
152 );
153
154 /*----------------------------------------------------------------
155 Procedure Validate_Line_Flow
156 ------------------------------------------------------------------*/
157 PROCEDURE Validate_Line_Flow
158 ( P_name IN VARCHAR2
159 , P_order_flow IN VARCHAR2
160 , p_quick_val IN BOOLEAN DEFAULT TRUE
161 , X_return_status OUT NOCOPY VARCHAR2
162 , X_msg_count OUT NOCOPY NUMBER
163 , X_msg_data OUT NOCOPY VARCHAR2
164 );
165
166 PROCEDURE Validate_Line_Flow /* Bug # 4908592 */
167 ( P_name IN VARCHAR2
168 , P_order_flow IN VARCHAR2
169 , p_quick_val IN BOOLEAN DEFAULT TRUE
170 , X_return_status OUT NOCOPY VARCHAR2
171 , X_msg_count OUT NOCOPY NUMBER
172 , X_msg_data OUT NOCOPY VARCHAR2
173 , p_item_type IN VARCHAR2
174 );
175
176
177 /*----------------------------------------------------------------
178 Procedure Validate_Order_flow
179 ------------------------------------------------------------------*/
180 PROCEDURE Validate_Order_flow
181 ( P_name IN VARCHAR2
182 , P_order_type_id IN NUMBER DEFAULT NULL
183 , P_type IN VARCHAR2
184 , p_quick_val IN BOOLEAN DEFAULT TRUE
185 , X_return_status OUT NOCOPY VARCHAR2
186 , X_msg_count OUT NOCOPY NUMBER
187 , X_msg_data OUT NOCOPY VARCHAR2
188 );
189
190 /*----------------------------------------------------------------
191 Procedure Validate
192 Validates all order/blanket header, negotiation and line workflow
193 processes assigned to order type p_order_type_id. If
194 p_order_type_id is NULL, runs the validation for all active order
195 types.
196 ------------------------------------------------------------------*/
197 PROCEDURE Validate
198 ( Errbuf OUT NOCOPY VARCHAR2 -- AOL standard
199 , retcode OUT NOCOPY VARCHAR2 -- AOL standard
200 , P_order_type_id IN NUMBER DEFAULT NULL
201 );
202
203 END OE_VALIDATE_WF;