1 PACKAGE JTF_TASK_dependency_pvt AS
2 /* $Header: jtfvtkes.pls 120.4 2006/09/29 22:24:46 twan ship $ */
3 /*#
4 * This is the private package to validate, crete, update, and delete task dependencies.
5 *
6 * @rep:scope private
7 * @rep:product CAC
8 * @rep:lifecycle active
9 * @rep:displayname Jtf Task Dependency
10 * @rep:compatibility S
11 * @rep:category BUSINESS_ENTITY CAC_CAL_TASK
12 */
13
14 Type TASK_DEPENDENCY_REC is RECORD
15 (
16 DEPENDENCY_ID NUMBER,
17 TASK_ID NUMBER,
18 TASK_NAME VARCHAR2(30),
19 TASK_NUMBER NUMBER,
20 DEPENDENT_ON_TASK_ID NUMBER,
21 DEPENDENT_ON_TASK_NAME NUMBER,
22 DEPENDENT_ON_TASK_NUMBER NUMBER,
23 DEPENDENCY_TYPE_CODE VARCHAR2(30),
24 DEPENDENCY_TYPE_CODE_DESC VARCHAR2(80),
25 ADJUSTMENT_TIME NUMBER,
26 ADJUSTMENT_TIME_UOM VARCHAR2(30)
27 );
28
29 /**
30 * Validate task dependency based on task dependency type code.
31 * There are four task dependency types need to be checked for validation, they are:
32 *<li>S2S: The successor task start date can't be less than the predecessor start date.</li>
33 *<li>S2F: The successor task end date can't be less than the predecessor start date.</li>
34 *<li>F2S: The successor task start date can't be less than the predecessor end date.</li>
35 *<li>F2F: The successor task end date can't be less than the predecessor end date.</li>
36 * The parent's scheduled_start_date or scheduled_end_date will be re-calculated based on
37 * the adjustment_time and adjustment_time_uom for different dependency type code.
38 *
39 * @param p_task_id the task id to be queried
40 * @param p_dependent_on_task_id the master task id of the task to be queried
41 * @param p_dependency_id the dependency id of the task to be queried
42 * @param p_dependency_type_code the dependency type code to be queried from
43 * @param p_template_flag the template flag to be applied to the query
44 * @param p_adjustment_time the time offset to be applied to re-calculate the master tasks scheduled start date or end date
45 * @param p_adjustment_time_uom the unit of measure of the time offset to be applied for date re-calculation
46 * @return status of the validation
47 * @paraminfo {@rep:precision 6000}
48 *
49 * @rep:scope private
50 * @rep:product JTF
51 * @rep:lifecycle active
52 * @rep:displayname Validate Dependency
53 * @rep:compatibility S
54 */
55 function validate_dependency(
56 p_task_id in number,
57 p_dependent_on_task_id in number,
58 p_dependency_type_code in varchar2,
59 p_adjustment_time in number,
60 p_adjustment_time_uom in varchar2,
61 p_validated_flag in varchar2 default 'N'
62 ) return varchar2;
63
64 /**
65 * Validate task dependency whether it violates the dependency rules.
66 * There are rules such as:
67 * Task should depend only once on another task
68 * Task can not have reverse dependency with other dependent task
69 * Task can not self depend
70 * Tasks cannot make dependency with other task in a cyclic manner
71 * The metadata are coming from the table <code>JTF_OBJECTS_B<code>.
72 * The parent's scheduled_start_date or scheduled_end_date will be re-calculated based on
73 * the adjustment_time and adjustment_time_uom for different dependency type code.
74 *
75 * @param p_task_id the task id to be queried
76 * @param p_dependent_on_task_id the master task id of the task to be queried
77 * @param p_dependency_id the dependency id of the task to be queried
78 * @return status of the validation
79 * @paraminfo {@rep:precision 6000}
80 *
81 * @rep:scope private
82 * @rep:product JTF
83 * @rep:lifecycle active
84 * @rep:displayname Validate Task Dependency
85 * @rep:compatibility S
86 */
87 FUNCTION validate_task_dependency (
88 p_task_id IN NUMBER,
89 p_dependent_on_task_id IN NUMBER,
90 p_dependency_id IN NUMBER,
91 p_template_flag IN VARCHAR2
92 ) return varchar2;
93
94 /**
95 * This method provides capability of reconnecting the dependencies of a task after it is deleted.
96 * Rules for reconnecting task dependencies, all three are required:
97 * <li>The dependency type code of the parent task dependencies and the child task dependencies must be the same.</li>
98 * <li>The adjustment time of the parent task dependency and the child task dependency must be the same.</li>
99 * <li>The adjustment time uom of the parent task dependency and the child task dependency must be the same.</li>
100 * @param p_api_version the standard API version number
101 * @param p_init_msg_list the standard API flag allows API callers to request
102 * that the API does the initialization of the message list on their behalf.
103 * By default, the message list will not be initialized.
104 * @param p_commit the standard API flag is used by API callers to ask
105 * the API to commit on their behalf after performing its function
106 * By default, the commit will not be performed.
107 * @param x_return_status returns the result of all the operations performed
108 * by the API and must have one of the following values:
109 * <LI><Code>FND_API.G_RET_STS_SUCCESS</Code>
110 * <LI><Code>FND_API.G_RET_STS_ERROR</Code>
111 * <LI><Code>FND_API.G_RET_STS_UNEXP_ERROR</Code>
112 * @param x_msg_count returns the number of messages in the API message list
113 * @param x_msg_data returns the message in an encoded format if
114 * <code>x_msg_count</code> returns number one.
115 *
116 * @param p_task_id the task id to be queried
117 * @param p_template_flag the template flag to be queried
118 * @paraminfo {@rep:precision 6000}
119 *
120 * @rep:scope private
121 * @rep:product JTF
122 * @rep:lifecycle active
123 * @rep:displayname Reconnect Dependency
124 * @rep:compatibility S
125 */
126 PROCEDURE reconnect_dependency (
127 p_api_version IN NUMBER,
128 p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
129 p_commit IN VARCHAR2 DEFAULT fnd_api.g_false,
130 x_return_status OUT NOCOPY VARCHAR2,
131 x_msg_data OUT NOCOPY VARCHAR2,
132 x_msg_count OUT NOCOPY NUMBER,
133 p_task_id IN NUMBER,
134 p_template_flag IN VARCHAR2 DEFAULT 'N'
135 );
136
137
138 /**
139 * Task dependency creation API. Many validations will be performed before
140 * creating task dependency.
141 *
142 * @param p_api_version the standard API version number
143 * @param p_init_msg_list the standard API flag allows API callers to request
144 * that the API does the initialization of the message list on their behalf.
145 * By default, the message list will not be initialized.
146 * @param p_commit the standard API flag is used by API callers to ask
147 * the API to commit on their behalf after performing its function
148 * By default, the commit will not be performed.
149 * @param p_task_id the task id for dependency creation
150 * @param p_dependent_on_task_id the master task id for dependency creation
151 * @param p_dependency_type_code the dependency type code of the dependency
152 * @param p_template_flag the template flag to be applied
153 * @param p_adjustment_time the time offset to be applied to re-calculate the master tasks scheduled start date or end date
154 * @param p_adjustment_time_uom the unit of measure of the time offset to be applied for date re-calculation
155 * @param x_dependency_id the dependency id being created
156 * @param x_return_status returns the result of all the operations performed
157 * by the API and must have one of the following values:
158 * <LI><Code>FND_API.G_RET_STS_SUCCESS</Code>
159 * <LI><Code>FND_API.G_RET_STS_ERROR</Code>
160 * <LI><Code>FND_API.G_RET_STS_UNEXP_ERROR</Code>
161 * @param x_msg_data returns the message in an encoded format if
162 * <code>x_msg_count</code> returns number one.
163 * @param x_msg_count returns the number of messages in the API message list
164 * @param p_attribute1 attribute1 for flexfield
165 * @param p_attribute2 attribute2 for flexfield
166 * @param p_attribute3 attribute3 for flexfield
167 * @param p_attribute4 attribute4 for flexfield
168 * @param p_attribute5 attribute5 for flexfield
169 * @param p_attribute6 attribute6 for flexfield
170 * @param p_attribute7 attribute7 for flexfield
171 * @param p_attribute8 attribute8 for flexfield
172 * @param p_attribute9 attribute9 for flexfield
173 * @param p_attribute10 attribute10 for flexfield
174 * @param p_attribute11 attribute11 for flexfield
175 * @param p_attribute12 attribute12 for flexfield
176 * @param p_attribute13 attribute13 for flexfield
177 * @param p_attribute14 attribute14 for flexfield
178 * @param p_attribute15 attribute15 for flexfield
179 * @param p_attribute_category attribute category
180 * @paraminfo {@rep:precision 6000}
181 * @rep:scope private
182 * @rep:product JTF
183 * @rep:lifecycle active
184 * @rep:displayname Create Task Dependency
185 * @rep:compatibility S
186 */
187 PROCEDURE create_task_dependency (
188 p_api_version IN NUMBER,
189 p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
190 p_commit IN VARCHAR2 DEFAULT fnd_api.g_false,
191 p_task_id IN NUMBER,
192 p_dependent_on_task_id IN NUMBER,
193 p_dependency_type_code IN VARCHAR2,
194 p_template_flag IN VARCHAR2 DEFAULT jtf_task_utl.g_no,
195 p_adjustment_time IN NUMBER DEFAULT NULL,
196 p_adjustment_time_uom IN VARCHAR2 DEFAULT NULL,
197 x_dependency_id OUT NOCOPY NUMBER,
198 x_return_status OUT NOCOPY VARCHAR2,
199 x_msg_data OUT NOCOPY VARCHAR2,
200 x_msg_count OUT NOCOPY NUMBER,
201 p_attribute1 IN VARCHAR2 DEFAULT null ,
202 p_attribute2 IN VARCHAR2 DEFAULT null ,
203 p_attribute3 IN VARCHAR2 DEFAULT null ,
204 p_attribute4 IN VARCHAR2 DEFAULT null ,
205 p_attribute5 IN VARCHAR2 DEFAULT null ,
206 p_attribute6 IN VARCHAR2 DEFAULT null ,
207 p_attribute7 IN VARCHAR2 DEFAULT null ,
208 p_attribute8 IN VARCHAR2 DEFAULT null ,
209 p_attribute9 IN VARCHAR2 DEFAULT null ,
210 p_attribute10 IN VARCHAR2 DEFAULT null ,
211 p_attribute11 IN VARCHAR2 DEFAULT null ,
212 p_attribute12 IN VARCHAR2 DEFAULT null ,
213 p_attribute13 IN VARCHAR2 DEFAULT null ,
214 p_attribute14 IN VARCHAR2 DEFAULT null ,
215 p_attribute15 IN VARCHAR2 DEFAULT null ,
216 p_attribute_category IN VARCHAR2 DEFAULT null,
217 p_validated_flag in varchar2 default 'N'
218 );
219
220
221 /**
222 * Task dependency update API. Many validations will be performed before
223 * updating task dependency.
224 *
225 * @param p_api_version the standard API version number
226 * @param p_init_msg_list the standard API flag allows API callers to request
227 * that the API does the initialization of the message list on their behalf.
228 * By default, the message list will not be initialized.
229 * @param p_commit the standard API flag is used by API callers to ask
230 * the API to commit on their behalf after performing its function
231 * By default, the commit will not be performed.
232 * @param p_task_id the task id for dependency creation
233 * @param p_dependent_on_task_id the master task id for dependency creation
234 * @param p_dependency_type_code the dependency type code of the dependency
235 * @param p_template_flag the template flag to be applied
236 * @param p_adjustment_time the time offset to be applied to re-calculate the master tasks scheduled start date or end date
237 * @param p_adjustment_time_uom the unit of measure of the time offset to be applied for date re-calculation
238 * @param x_dependency_id the dependency id being created
239 * @param x_return_status returns the result of all the operations performed
240 * by the API and must have one of the following values:
241 * <LI><Code>FND_API.G_RET_STS_SUCCESS</Code>
242 * <LI><Code>FND_API.G_RET_STS_ERROR</Code>
243 * <LI><Code>FND_API.G_RET_STS_UNEXP_ERROR</Code>
244 * @param x_msg_data returns the message in an encoded format if
245 * <code>x_msg_count</code> returns number one.
246 * @param x_msg_count returns the number of messages in the API message list
247 * @param p_attribute1 attribute1 for flexfield
248 * @param p_attribute2 attribute2 for flexfield
249 * @param p_attribute3 attribute3 for flexfield
250 * @param p_attribute4 attribute4 for flexfield
251 * @param p_attribute5 attribute5 for flexfield
252 * @param p_attribute6 attribute6 for flexfield
253 * @param p_attribute7 attribute7 for flexfield
254 * @param p_attribute8 attribute8 for flexfield
255 * @param p_attribute9 attribute9 for flexfield
256 * @param p_attribute10 attribute10 for flexfield
257 * @param p_attribute11 attribute11 for flexfield
258 * @param p_attribute12 attribute12 for flexfield
259 * @param p_attribute13 attribute13 for flexfield
260 * @param p_attribute14 attribute14 for flexfield
261 * @param p_attribute15 attribute15 for flexfield
262 * @param p_attribute_category attribute category
263 * @paraminfo {@rep:precision 6000}
264 * @rep:scope private
265 * @rep:product JTF
266 * @rep:lifecycle active
267 * @rep:displayname Create Task Dependency
268 * @rep:compatibility S
269 */
270 PROCEDURE UPDATE_TASK_DEPENDENCY
271 (
272 P_API_VERSION IN NUMBER,
273 P_INIT_MSG_LIST IN VARCHAR2 DEFAULT FND_API.G_FALSE,
274 P_COMMIT IN VARCHAR2 DEFAULT FND_API.G_FALSE ,
275 P_OBJECT_VERSION_NUMBER IN out NOCOPY NUMBER,
276 P_DEPENDENCY_ID IN NUMBER,
277 P_TASK_ID IN NUMBER DEFAULT fnd_api.g_miss_num ,
278 P_DEPENDENT_ON_TASK_ID IN NUMBER DEFAULT fnd_api.g_miss_num ,
279 P_DEPENDENCY_TYPE_CODE IN VARCHAR2 DEFAULT fnd_api.g_miss_char ,
280 P_ADJUSTMENT_TIME IN NUMBER DEFAULT fnd_api.g_miss_num ,
281 P_ADJUSTMENT_TIME_UOM IN VARCHAR2 DEFAULT fnd_api.g_miss_char ,
282 X_RETURN_STATUS OUT NOCOPY VARCHAR2 ,
283 X_MSG_COUNT OUT NOCOPY NUMBER ,
284 X_MSG_DATA OUT NOCOPY VARCHAR2,
285 p_attribute1 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
286 p_attribute2 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
287 p_attribute3 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
288 p_attribute4 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
289 p_attribute5 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
290 p_attribute6 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
291 p_attribute7 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
292 p_attribute8 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
293 p_attribute9 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
294 p_attribute10 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
295 p_attribute11 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
296 p_attribute12 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
297 p_attribute13 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
298 p_attribute14 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
299 p_attribute15 IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
300 p_attribute_category IN VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
301 p_validated_flag in varchar2 default 'N'
302 );
303
304
305 /**
306 * Task dependency delete API.
307 *
308 * @param p_api_version the standard API version number
309 * @param p_init_msg_list the standard API flag allows API callers to request
310 * that the API does the initialization of the message list on their behalf.
311 * By default, the message list will not be initialized.
312 * @param p_commit the standard API flag is used by API callers to ask
313 * the API to commit on their behalf after performing its function
314 * By default, the commit will not be performed.
315 * @param p_object_version_number the object version number for delete
316 * @param x_dependency_id the dependency id being created
317 * @param x_return_status returns the result of all the operations performed
318 * by the API and must have one of the following values:
319 * <LI><Code>FND_API.G_RET_STS_SUCCESS</Code>
320 * <LI><Code>FND_API.G_RET_STS_ERROR</Code>
321 * <LI><Code>FND_API.G_RET_STS_UNEXP_ERROR</Code>
322 * @param x_msg_count returns the number of messages in the API message list
323 * @param x_msg_data returns the message in an encoded format if
324 * <code>x_msg_count</code> returns number one.
325 * @paraminfo {@rep:precision 6000}
326 * @rep:scope private
327 * @rep:product JTF
328 * @rep:lifecycle active
329 * @rep:displayname Delete Task Dependency
330 * @rep:compatibility S
331 */
332 PROCEDURE delete_TASK_DEPENDENCY
333 (
334 P_API_VERSION IN NUMBER ,
335 P_INIT_MSG_LIST IN VARCHAR2 DEFAULT FND_API.G_FALSE,
336 P_COMMIT IN VARCHAR2 DEFAULT FND_API.G_FALSE ,
337 P_OBJECT_VERSION_NUMBER IN NUMBER,
338 P_DEPENDENCY_ID IN NUMBER ,
339 X_RETURN_STATUS OUT NOCOPY VARCHAR2 ,
340 X_MSG_COUNT OUT NOCOPY NUMBER ,
341 X_MSG_DATA OUT NOCOPY VARCHAR2) ;
343 END; -- CREATE OR REPLACE PACKAGE spec
342