DBA Data[Home] [Help]

PACKAGE: APPS.CSF_TASKS_PUB

Source


4   -- Update Parent Task Actions
1 PACKAGE csf_tasks_pub AUTHID CURRENT_USER AS
2 /* $Header: CSFPTSKS.pls 120.32.12020000.3 2013/04/09 09:49:18 hemasha ship $ */
3 
5   g_action_normal_to_parent   CONSTANT PLS_INTEGER := 1;
6   g_action_parent_to_normal   CONSTANT PLS_INTEGER := 2;
7 
8   -- Update Customer Confirmation Actions
9   g_action_conf_to_required   CONSTANT PLS_INTEGER := 1;
10   g_action_conf_to_received   CONSTANT PLS_INTEGER := 2;
11   g_action_conf_not_required  CONSTANT PLS_INTEGER := 3;
12 
13   -- Customer Confirmation Initiation
14   g_dispatcher_initiated      CONSTANT PLS_INTEGER := 1;
15   g_customer_initiated        CONSTANT PLS_INTEGER := 2;
16 
17   g_reschedule VARCHAR2(1) := NULL;
18 
19   -- Task Information - Important Information of Task from JTF_TASKS_B
20   TYPE tasks_rec_type IS RECORD (
21     row_id                    VARCHAR2 (18)
22   , task_id                   jtf_tasks_b.task_id%TYPE
23   , object_version_number     jtf_tasks_b.object_version_number%TYPE
24   , task_status_id            jtf_tasks_b.task_status_id%TYPE
25   , task_status               VARCHAR2 (30)
26   , scheduled_start_date      jtf_tasks_b.scheduled_start_date%TYPE
27   , scheduled_end_date        jtf_tasks_b.scheduled_end_date%TYPE
28   , planned_start_date        jtf_tasks_b.planned_start_date%TYPE
29   , planned_end_date          jtf_tasks_b.planned_end_date%TYPE
33   , type_schedulable_flag     VARCHAR2 (1)
30   , planned_effort            jtf_tasks_b.planned_effort%TYPE
31   , planned_effort_uom        jtf_tasks_b.planned_effort_uom%TYPE
32   , status_schedulable_flag   VARCHAR2 (1)
34   , status_assigned_flag      VARCHAR2 (1)
35   , resource_name             VARCHAR2 (4000)
36   , task_split_flag           jtf_tasks_b.task_split_flag%TYPE
37   , parent_task_id            jtf_tasks_b.parent_task_id%TYPE
38   , updated_flag              VARCHAR2 (1)
39   );
40 
41   TYPE tasks_tbl_type IS TABLE OF tasks_rec_type;
42 
43   /**
44    * Validates the Task Status Transition based on the Old Status and
45    * the Chosen Responsibility.
46    * <br>
47    * If Old Task Status is provided, then validation is done to check whether
48    * there exists a Transition from the given Old Status to the given New Status
49    * for the signed in responsibility (FND_GLOBAL.RESP_ID).
50    * <br>
51    * If Old Task Status is not provided, then check is made to find out whether
52    * the New Status as the Initial Status is allowed or not for the responsibility.
53    *
54    * @param   p_state_type      Type of Statuses API should deal with (Default TASK_STATUS)
55    * @param   p_old_status_id   Current Task Status ID from which Transition is initiated.
56    * @param   p_new_status_id   Proposed New Task Status ID.
57    * @return Returns FND_API.G_TRUE/G_FALSE depending on the possibility
58    */
59   FUNCTION validate_state_transition (
60     p_state_type      VARCHAR2 DEFAULT 'TASK_STATUS'
61   , p_old_status_id   NUMBER   DEFAULT NULL
62   , p_new_status_id   NUMBER
63   )
64     RETURN VARCHAR2;
65 
66   /**
67    * Returns the set of Valid Task Statuses possible from the given Old Task Statuses.
68    * <br>
69    * Always used in conjunction with VALIDATE_STATE_TRANSITION to find the valid
70    * statuses possible from the old status if the Task Status Transition to the proposed
71    * new status is not allowed.
72    * <br>
73    * If Old Status is given, then the possible New Task Statuses is returned separated
74    * by FND_GLOBAL.LOCAL_CHR(10). If Old Status is not given, then the possible New Task
75    * Statuses as the Initial Status is returned separated by FND_GLOBAL.LOCAL_CHR(10).
76    *
77    * @param   p_state_type      Type of Statuses API should deal with (Default TASK_STATUS)
78    * @param   p_old_status_id   Current Task Status ID from which Transition is initiated.
79    * @return List of Valid Statuses (VARCHAR2).
80    */
81   FUNCTION get_valid_statuses (
82     p_state_type      VARCHAR2 DEFAULT 'TASK_STATUS'
83   , p_old_status_id   NUMBER   DEFAULT NULL
84   )
85     RETURN VARCHAR2;
86 
87   /**
88    * Validates whether the transition from the given Old Status to the new
89    * Status is possible. If its not possible, it raises an error
90    * (FND_API.G_EXC_ERROR) after pushing the appropriate message into the
91    * stack. It leverages VALIDATE_STATE_TRANSITION and GET_VALID_STATUSES
92    * for the operation.
93    */
94   PROCEDURE validate_status_change(
95     p_old_status_id NUMBER
96   , p_new_status_id NUMBER
97   );
98 
99   /**
100    * Returns the Translated Task Status Name given the Task Status ID.
101    *
105   FUNCTION get_task_status_name (p_task_status_id NUMBER)
102    * @param    p_task_status_id   Task Status ID
103    * @return  Translated Task Status Name
104    */
106     RETURN VARCHAR2;
107 
108   /**
109    * Returns the constant Task Type ID used for Departure Tasks.
110    *
111    * @return  Departure Task Type ID (20)
112    */
113   FUNCTION get_dep_task_type_id
114     RETURN NUMBER;
115 
116   /**
117    * Returns the constant Task Type ID used for Arrival Tasks.
118    *
119    * @return  Arrival Task Type ID (21)
120    */
121   FUNCTION get_arr_task_type_id
122     RETURN NUMBER;
123 
124   /**
125    * Checks whether the given Task can be closed and returns True or False
126    * accordingly.
127    *
128    * A Task can be closed only when
129    *   1. There exists a Transition from the current Task Status to the Closed Status
130    *   2. There are no Active / Open Task Assignments ( In-Planning, Planned, Assigned, Working)
131    *   3. If the profile "CSFW: Update Schedulable Task" is set to Yes, then the Debrief if
132    *      any linked to any of the Task Assignments of the Task should be in COMPLETED status.
133    * <br>
134    * The message stack will be populated with the proper message to indicate the
135    * reason why the Task is not closable.
136    *
137    * @param    x_return_status           Return Status of the Procedure.
138    * @param    x_msg_count               Number of Messages in the Stack.
139    * @param    x_msg_data                Stack of Error Messages.
140    * @param    p_task_id                 Task ID of the Task to be checked
141    * @return  True / False
142    */
143   FUNCTION is_task_closable (
144     x_return_status   OUT NOCOPY      VARCHAR2
145   , x_msg_count       OUT NOCOPY      NUMBER
146   , x_msg_data        OUT NOCOPY      VARCHAR2
147   , p_task_id         IN              NUMBER
148   )
149     RETURN BOOLEAN;
150 
151   /**
152    * Checks whether the given Task can be closed and returns True or False
153    * accordingly.
154    * @deprecated Use IS_TASK_CLOSABLE (SR Team is still calling this version)
155    */
156   FUNCTION task_is_closable (
157     x_return_status   OUT NOCOPY      VARCHAR2
161   )
158   , x_msg_count       OUT NOCOPY      NUMBER
159   , x_msg_data        OUT NOCOPY      VARCHAR2
160   , p_task_id         IN              NUMBER
162     RETURN BOOLEAN;
163 
164   /**
165    * Checks whether the given parameters of a Task (created or not yet created)
166    * will make the task schedulable or not and returns True or False
167    * accordingly.
168    *
169    * A Task is schedulable only when
170    *   1. Task doesnt have Deleted Flag set to 'Y'.
171    *   2. Task has Planned Window set properly - both Planned Start and Planned End.
172    *   3. Task has Planned Effort.
173    *   4. Task Status is schedulable (Task Status should have SCHEDULE_FLAG = 'Y')
174    *   5. Task Type is schedulable (Task Type should have SCHEDULABLE_FLAG = 'Y')
175    *   6. Task Type belongs to the DISPATCH Rule.
176    * <br>
177    *
178    * @param    p_deleted_flag            Whether the Task is already deleted
179    * @param    p_planned_start_date      Planned Start date
180    * @param    p_planned_end_date        Planned End date
181    * @param    p_planned_effort          Planned Effort
182    * @param    p_task_type_id            Task Type ID
183    * @param    p_task_status_id          Task Status ID
184    * @param    x_reason_code             If the Task is not schedulable, WHY ?
185    *
186    * @return  True / False
187    */
188   FUNCTION check_schedulable(
189     p_deleted_flag       IN         VARCHAR2
190   , p_planned_start_date IN         DATE
191   , p_planned_end_date   IN         DATE
192   , p_planned_effort     IN         NUMBER
193   , p_task_type_id       IN         NUMBER
194   , p_task_status_id     IN         NUMBER
195   , x_reason_code        OUT NOCOPY VARCHAR2
196   ) RETURN BOOLEAN;
197 
198   /**
199    * Checks whether the given Task is schedulable or not and returns True or False
200    * accordingly.
201    *
202    * A Task is schedulable only when
203    *   1. Task doesnt have Deleted Flag set to 'Y'.
204    *   2. Task has Planned Window set properly - both Planned Start and Planned End.
205    *   3. Task has Planned Effort.
206    *   4. Task Status is schedulable (Task Status should have SCHEDULE_FLAG = 'Y')
207    *   5. Task Type is schedulable (Task Type should have SCHEDULABLE_FLAG = 'Y')
208    *   6. Task Type belongs to the DISPATCH Rule.
209    * <br>
210    * The message stack will be populated with the proper message to indicate the
211    * reason (one among the six) why the Task is not schedulable.
212    *
213    * @param    x_return_status           Return Status of the Procedure.
214    * @param    x_msg_count               Number of Messages in the Stack.
215    * @param    x_msg_data                Stack of Error Messages.
216    * @param    p_task_id                 Task ID of the Task to be checked
217    * @return  True / False
218    */
219   FUNCTION is_task_schedulable (
220     x_return_status   OUT NOCOPY      VARCHAR2
221   , x_msg_count       OUT NOCOPY      NUMBER
222   , x_msg_data        OUT NOCOPY      VARCHAR2
223   , p_task_id         IN              NUMBER
224   )
225     RETURN BOOLEAN;
226 
227   /**
228    * Checks whether the given Task is already scheduled or not.
229    *
230    * A Task is already scheduled when
231    *   1. Task has Scheduled Start and End Date stamped.
232    *   2. Task has Assignments which are not in Cancelled Status
233    *
234    * @param    x_return_status           Return Status of the Procedure.
235    * @param    x_msg_count               Number of Messages in the Stack.
236    * @param    x_msg_data                Stack of Error Messages.
237    * @param    p_task_id                 Task ID of the Task to be checked
238    * @return  True / False
239    */
240   FUNCTION is_task_scheduled (
241     x_return_status   OUT NOCOPY      VARCHAR2
242   , x_msg_count       OUT NOCOPY      NUMBER
243   , x_msg_data        OUT NOCOPY      VARCHAR2
244   , p_task_id         IN              NUMBER
245   )
246     RETURN BOOLEAN;
247 
248   /**
249    * Checks whether the given Task is escalated or not.
250    *
251    * A Task is escalated when
252    *   1. There exists a Task Reference in JTF_TASK_REFERENCES
253    *      linked to the given Task with Object Type as TASK and Reference Code as ESC.
254    *   2. The referred Task should have Task Type ID as 22 (Escalated Task Type) and
255    *       and should be open (Not Closed, Completed or Cancelled).
256    *
257    * @param    p_task_id                 Task ID of the Task to be checked
258    * @return  True / False
259    */
260   FUNCTION is_task_escalated(p_task_id NUMBER)
261     RETURN BOOLEAN;
262 
263 
264   /**
265    * Checks whether the given Task Type has Field Service Rule attached.
266    *
267    * @param    p_task_type_id         Task Type ID to be checked
268    * @return  FND_API.G_TRUE / FND_API.G_FALSE
269    */
270   FUNCTION has_field_service_rule (p_task_type_id NUMBER)
271     RETURN VARCHAR2;
272 
273   /**
274    * Create a new Field Service Task
275    *
276    * Create a new Task by calling JTF_TASKS_PUB API. The only difference is that
280    * Right now P_PARENT_TASK_ID, P_PARENT_TASK_NUMBER, P_TASK_SPLIT_FLAG,
277    * the task to be created has to be Schedulable as per Field Service Standards.
278    * Uses the same logic as that of IS_TASK_SCHEDULABLE.
279    *
281    * P_CHILD_SEQUENCE_NUM, P_CHILD_POSITION, P_ENABLE_WORKFLOW and P_ABORT_WORKFLOW
282    * wont be used and its just in the signature as JTF Task API hasnt exposed any
283    * API wherein all parameters can be passed in a single shot.
284    * Note that JTF_TASKS_PUB.UPDATE_TASK cant be invoked as the caller module always
285    * assumes that the OBJECT_VERSION_NUMBER of the newly created task is 1.
286    */
287   PROCEDURE create_task (
288     p_api_version               IN           NUMBER
289   , p_init_msg_list             IN           VARCHAR2  DEFAULT NULL
290   , p_commit                    IN           VARCHAR2  DEFAULT NULL
291   , x_return_status             OUT  NOCOPY  VARCHAR2
292   , x_msg_count                 OUT  NOCOPY  NUMBER
293   , x_msg_data                  OUT  NOCOPY  VARCHAR2
294   , p_task_id                   IN           NUMBER    DEFAULT NULL
295   , p_task_name                 IN           VARCHAR2
296   , p_description               IN           VARCHAR2  DEFAULT NULL
297   , p_task_type_name            IN           VARCHAR2  DEFAULT NULL
298   , p_task_type_id              IN           NUMBER    DEFAULT NULL
299   , p_task_status_name          IN           VARCHAR2  DEFAULT NULL
300   , p_task_status_id            IN           NUMBER    DEFAULT NULL
301   , p_task_priority_name        IN           VARCHAR2  DEFAULT NULL
302   , p_task_priority_id          IN           NUMBER    DEFAULT NULL
303   , p_owner_type_name           IN           VARCHAR2  DEFAULT NULL
304   , p_owner_type_code           IN           VARCHAR2  DEFAULT NULL
305   , p_owner_id                  IN           NUMBER    DEFAULT NULL
306   , p_owner_territory_id        IN           NUMBER    DEFAULT NULL
307   , p_owner_status_id           IN           NUMBER    DEFAULT NULL
308   , p_assigned_by_name          IN           VARCHAR2  DEFAULT NULL
309   , p_assigned_by_id            IN           NUMBER    DEFAULT NULL
310   , p_customer_number           IN           VARCHAR2  DEFAULT NULL
311   , p_customer_id               IN           NUMBER    DEFAULT NULL
312   , p_cust_account_number       IN           VARCHAR2  DEFAULT NULL
313   , p_cust_account_id           IN           NUMBER    DEFAULT NULL
314   , p_address_id                IN           NUMBER    DEFAULT NULL
315   , p_address_number            IN           VARCHAR2  DEFAULT NULL
316   , p_location_id               IN           NUMBER    DEFAULT NULL
317   , p_planned_start_date        IN           DATE      DEFAULT NULL
318   , p_planned_end_date          IN           DATE      DEFAULT NULL
319   , p_scheduled_start_date      IN           DATE      DEFAULT NULL
320   , p_scheduled_end_date        IN           DATE      DEFAULT NULL
321   , p_actual_start_date         IN           DATE      DEFAULT NULL
322   , p_actual_end_date           IN           DATE      DEFAULT NULL
323   , p_timezone_id               IN           NUMBER    DEFAULT NULL
324   , p_timezone_name             IN           VARCHAR2  DEFAULT NULL
325   , p_source_object_type_code   IN           VARCHAR2  DEFAULT NULL
326   , p_source_object_id          IN           NUMBER    DEFAULT NULL
327   , p_source_object_name        IN           VARCHAR2  DEFAULT NULL
328   , p_duration                  IN           NUMBER    DEFAULT NULL
329   , p_duration_uom              IN           VARCHAR2  DEFAULT NULL
330   , p_planned_effort            IN           NUMBER    DEFAULT NULL
331   , p_planned_effort_uom        IN           VARCHAR2  DEFAULT NULL
332   , p_actual_effort             IN           NUMBER    DEFAULT NULL
333   , p_actual_effort_uom         IN           VARCHAR2  DEFAULT NULL
334   , p_percentage_complete       IN           NUMBER    DEFAULT NULL
335   , p_reason_code               IN           VARCHAR2  DEFAULT NULL
336   , p_private_flag              IN           VARCHAR2  DEFAULT NULL
337   , p_publish_flag              IN           VARCHAR2  DEFAULT NULL
338   , p_restrict_closure_flag     IN           VARCHAR2  DEFAULT NULL
339   , p_multi_booked_flag         IN           VARCHAR2  DEFAULT NULL
340   , p_milestone_flag            IN           VARCHAR2  DEFAULT NULL
341   , p_holiday_flag              IN           VARCHAR2  DEFAULT NULL
342   , p_billable_flag             IN           VARCHAR2  DEFAULT NULL
343   , p_bound_mode_code           IN           VARCHAR2  DEFAULT NULL
344   , p_soft_bound_flag           IN           VARCHAR2  DEFAULT NULL
345   , p_workflow_process_id       IN           NUMBER    DEFAULT NULL
346   , p_notification_flag         IN           VARCHAR2  DEFAULT NULL
347   , p_notification_period       IN           NUMBER    DEFAULT NULL
348   , p_notification_period_uom   IN           VARCHAR2  DEFAULT NULL
349   , p_alarm_start               IN           NUMBER    DEFAULT NULL
350   , p_alarm_start_uom           IN           VARCHAR2  DEFAULT NULL
351   , p_alarm_on                  IN           VARCHAR2  DEFAULT NULL
352   , p_alarm_count               IN           NUMBER    DEFAULT NULL
353   , p_alarm_interval            IN           NUMBER    DEFAULT NULL
354   , p_alarm_interval_uom        IN           VARCHAR2  DEFAULT NULL
355   , p_palm_flag                 IN           VARCHAR2  DEFAULT NULL
356   , p_wince_flag                IN           VARCHAR2  DEFAULT NULL
357   , p_laptop_flag               IN           VARCHAR2  DEFAULT NULL
358   , p_device1_flag              IN           VARCHAR2  DEFAULT NULL
359   , p_device2_flag              IN           VARCHAR2  DEFAULT NULL
360   , p_device3_flag              IN           VARCHAR2  DEFAULT NULL
361   , p_costs                     IN           NUMBER    DEFAULT NULL
362   , p_currency_code             IN           VARCHAR2  DEFAULT NULL
363   , p_escalation_level          IN           VARCHAR2  DEFAULT NULL
364   , p_attribute1                IN           VARCHAR2  DEFAULT NULL
365   , p_attribute2                IN           VARCHAR2  DEFAULT NULL
366   , p_attribute3                IN           VARCHAR2  DEFAULT NULL
370   , p_attribute7                IN           VARCHAR2  DEFAULT NULL
367   , p_attribute4                IN           VARCHAR2  DEFAULT NULL
368   , p_attribute5                IN           VARCHAR2  DEFAULT NULL
369   , p_attribute6                IN           VARCHAR2  DEFAULT NULL
371   , p_attribute8                IN           VARCHAR2  DEFAULT NULL
372   , p_attribute9                IN           VARCHAR2  DEFAULT NULL
373   , p_attribute10               IN           VARCHAR2  DEFAULT NULL
374   , p_attribute11               IN           VARCHAR2  DEFAULT NULL
375   , p_attribute12               IN           VARCHAR2  DEFAULT NULL
376   , p_attribute13               IN           VARCHAR2  DEFAULT NULL
377   , p_attribute14               IN           VARCHAR2  DEFAULT NULL
378   , p_attribute15               IN           VARCHAR2  DEFAULT NULL
379   , p_attribute_category        IN           VARCHAR2  DEFAULT NULL
380   , p_date_selected             IN           VARCHAR2  DEFAULT NULL
381   , p_category_id               IN           NUMBER    DEFAULT NULL
382   , p_show_on_calendar          IN           VARCHAR2  DEFAULT NULL
383   , p_task_assign_tbl           IN           jtf_tasks_pub.task_assign_tbl   DEFAULT jtf_tasks_pub.g_miss_task_assign_tbl
384   , p_task_depends_tbl          IN           jtf_tasks_pub.task_depends_tbl  DEFAULT jtf_tasks_pub.g_miss_task_depends_tbl
385   , p_task_rsrc_req_tbl         IN           jtf_tasks_pub.task_rsrc_req_tbl DEFAULT jtf_tasks_pub.g_miss_task_rsrc_req_tbl
386   , p_task_refer_tbl            IN           jtf_tasks_pub.task_refer_tbl    DEFAULT jtf_tasks_pub.g_miss_task_refer_tbl
387   , p_task_dates_tbl            IN           jtf_tasks_pub.task_dates_tbl    DEFAULT jtf_tasks_pub.g_miss_task_dates_tbl
388   , p_task_notes_tbl            IN           jtf_tasks_pub.task_notes_tbl    DEFAULT jtf_tasks_pub.g_miss_task_notes_tbl
389   , p_task_recur_rec            IN           jtf_tasks_pub.task_recur_rec    DEFAULT jtf_tasks_pub.g_miss_task_recur_rec
390   , p_task_contacts_tbl         IN           jtf_tasks_pub.task_contacts_tbl DEFAULT jtf_tasks_pub.g_miss_task_contacts_tbl
391   , p_template_id               IN           NUMBER    DEFAULT NULL
392   , p_template_group_id         IN           NUMBER    DEFAULT NULL
393   , p_enable_workflow           IN           VARCHAR2  DEFAULT NULL
394   , p_abort_workflow            IN           VARCHAR2  DEFAULT NULL
395   , p_task_split_flag           IN           VARCHAR2  DEFAULT NULL
396   , p_parent_task_number        IN           VARCHAR2  DEFAULT NULL
397   , p_parent_task_id            IN           NUMBER    DEFAULT NULL
398   , p_child_position            IN           VARCHAR2  DEFAULT NULL
399   , p_child_sequence_num        IN           NUMBER    DEFAULT NULL
400   , x_task_id                   OUT  NOCOPY  NUMBER
401   );
402 
403   /**
404    * Update an existing Task with new Task Attributes
405    *
406    * Given the Task ID and Task Object Version Number, it calls JTF Task API
407    * to update the Task with the new Attributes. It is actually a two step
408    * process
409    *    1. Updating the Task with the new Task Attributes except Task Status
410    *    2. Updating the Task with the new Task Status (if not FND_API.G_MISS_NUM)
411    *       by calling UPDATE_TASK_STATUS.
412    * <br>
413    * Because of the two step process, the returned Task Object Version Number might
414    * be incremented by 2 when user might have expected an increment of only 1.
415    * <br>
416    * Except Task ID, Task Object Version Number, Task Split Flag, all other
417    * parameters are optional. Task Split Flag is also made mandatory to call
418    * this version of UPDATE_TASK so that there is some difference between this
419    * version and the other overloaded version of UPDATE_TASK which is required
420    * by Service Team. The overloaded version ends up calling this version only.
421    */
422   PROCEDURE update_task(
423     p_api_version               IN              NUMBER
424   , p_init_msg_list             IN              VARCHAR2 DEFAULT fnd_api.g_false
425   , p_commit                    IN              VARCHAR2 DEFAULT fnd_api.g_false
426   , p_validation_level          IN              NUMBER   DEFAULT NULL
427   , x_return_status             OUT    NOCOPY   VARCHAR2
428   , x_msg_count                 OUT    NOCOPY   NUMBER
429   , x_msg_data                  OUT    NOCOPY   VARCHAR2
430   , p_task_id                   IN              NUMBER
431   , p_object_version_number     IN OUT NOCOPY   NUMBER
432   , p_task_number               IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
433   , p_task_name                 IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
434   , p_description               IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
435   , p_planned_start_date        IN              DATE     DEFAULT fnd_api.g_miss_date
436   , p_planned_end_date          IN              DATE     DEFAULT fnd_api.g_miss_date
437   , p_scheduled_start_date      IN              DATE     DEFAULT fnd_api.g_miss_date
438   , p_scheduled_end_date        IN              DATE     DEFAULT fnd_api.g_miss_date
439   , p_actual_start_date         IN              DATE     DEFAULT fnd_api.g_miss_date
440   , p_actual_end_date           IN              DATE     DEFAULT fnd_api.g_miss_date
441   , p_timezone_id               IN              NUMBER   DEFAULT fnd_api.g_miss_num
442   , p_source_object_type_code   IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
443   , p_source_object_id          IN              NUMBER   DEFAULT fnd_api.g_miss_num
444   , p_source_object_name        IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
445   , p_task_status_id            IN              NUMBER   DEFAULT fnd_api.g_miss_num
446   , p_task_type_id              IN              NUMBER   DEFAULT fnd_api.g_miss_num
447   , p_task_priority_id          IN              NUMBER   DEFAULT fnd_api.g_miss_num
448   , p_owner_type_code           IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
449   , p_owner_id                  IN              NUMBER   DEFAULT fnd_api.g_miss_num
450   , p_owner_territory_id        IN              NUMBER   DEFAULT fnd_api.g_miss_num
454   , p_cust_account_id           IN              NUMBER   DEFAULT fnd_api.g_miss_num
451   , p_owner_status_id           IN              NUMBER   DEFAULT fnd_api.g_miss_num
452   , p_assigned_by_id            IN              NUMBER   DEFAULT fnd_api.g_miss_num
453   , p_customer_id               IN              NUMBER   DEFAULT fnd_api.g_miss_num
455   , p_address_id                IN              NUMBER   DEFAULT fnd_api.g_miss_num
456   , p_location_id               IN              NUMBER   DEFAULT fnd_api.g_miss_num
457   , p_duration                  IN              NUMBER   DEFAULT fnd_api.g_miss_num
458   , p_duration_uom              IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
459   , p_planned_effort            IN              NUMBER   DEFAULT fnd_api.g_miss_num
460   , p_planned_effort_uom        IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
461   , p_actual_effort             IN              NUMBER   DEFAULT fnd_api.g_miss_num
462   , p_actual_effort_uom         IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
463   , p_percentage_complete       IN              NUMBER   DEFAULT fnd_api.g_miss_num
464   , p_reason_code               IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
465   , p_private_flag              IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
466   , p_publish_flag              IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
467   , p_restrict_closure_flag     IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
468   , p_attribute1                IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
469   , p_attribute2                IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
470   , p_attribute3                IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
471   , p_attribute4                IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
472   , p_attribute5                IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
473   , p_attribute6                IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
474   , p_attribute7                IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
475   , p_attribute8                IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
476   , p_attribute9                IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
477   , p_attribute10               IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
478   , p_attribute11               IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
479   , p_attribute12               IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
480   , p_attribute13               IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
481   , p_attribute14               IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
482   , p_attribute15               IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
483   , p_attribute_category        IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
484   , p_date_selected             IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
485   , p_category_id               IN              NUMBER   DEFAULT fnd_api.g_miss_num
486   , p_multi_booked_flag         IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
487   , p_milestone_flag            IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
488   , p_holiday_flag              IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
489   , p_billable_flag             IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
490   , p_bound_mode_code           IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
491   , p_soft_bound_flag           IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
492   , p_workflow_process_id       IN              NUMBER   DEFAULT fnd_api.g_miss_num
493   , p_notification_flag         IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
494   , p_notification_period       IN              NUMBER   DEFAULT fnd_api.g_miss_num
495   , p_notification_period_uom   IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
496   , p_alarm_start               IN              NUMBER   DEFAULT fnd_api.g_miss_num
497   , p_alarm_start_uom           IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
498   , p_alarm_on                  IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
499   , p_alarm_count               IN              NUMBER   DEFAULT fnd_api.g_miss_num
500   , p_alarm_fired_count         IN              NUMBER   DEFAULT fnd_api.g_miss_num
501   , p_alarm_interval            IN              NUMBER   DEFAULT fnd_api.g_miss_num
502   , p_alarm_interval_uom        IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
503   , p_palm_flag                 IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
504   , p_wince_flag                IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
505   , p_laptop_flag               IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
506   , p_device1_flag              IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
507   , p_device2_flag              IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
508   , p_device3_flag              IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
509   , p_show_on_calendar          IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
510   , p_costs                     IN              NUMBER   DEFAULT fnd_api.g_miss_num
511   , p_currency_code             IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
512   , p_escalation_level          IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
513   , p_parent_task_id            IN              NUMBER   DEFAULT fnd_api.g_miss_num
517   , p_child_sequence_num        IN              NUMBER   DEFAULT fnd_api.g_miss_num
514   , p_parent_task_number        IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
515   , p_task_split_flag           IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
516   , p_child_position            IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
518   , p_enable_workflow           IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
519   , p_abort_workflow            IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
520   , p_find_overlap              IN              VARCHAR2 DEFAULT NULL
521   );
522 
523   /**
524    *  Delete an existing Task given the Task ID.
525    * <br>
526    * Doesnt do anything extra except for calling JTF Task API. Is existing just for the
527    * sake of making this package complete and may be for future uses.
528    * <br>
529    * Either Task ID or Task Number has to be provided for it to be successful.
530    * <br>
531    * @param  p_api_version               API Version (1.0)
532    * @param  p_init_msg_list             Initialize Message List
533    * @param  p_commit                    Commit the Work
534    * @param  x_return_status             Return Status of the Procedure.
535    * @param  x_msg_count                 Number of Messages in the Stack.
536    * @param  x_msg_data                  Stack of Error Messages.
537    * @param  p_task_id                   Task ID of the Task to be deleted
538    * @param  p_task_number               Task Number of the Task to be deleted
539    * @param  p_object_version_number     Object Version of the Task to be deleted
540    * @param  p_delete_future_recurrences Delete all Tasks following the same recurrence rule as this one.
541 
542    */
543   PROCEDURE delete_task (
544     p_api_version                 IN              NUMBER
545   , p_init_msg_list               IN              VARCHAR2 DEFAULT fnd_api.g_false
546   , p_commit                      IN              VARCHAR2 DEFAULT fnd_api.g_false
547   , x_return_status               OUT NOCOPY      VARCHAR2
548   , x_msg_count                   OUT NOCOPY      NUMBER
549   , x_msg_data                    OUT NOCOPY      VARCHAR2
550   , p_task_id                     IN              NUMBER   DEFAULT NULL
551   , p_task_number                 IN              VARCHAR2 DEFAULT NULL
552   , p_object_version_number       IN              NUMBER   DEFAULT NULL
553   , p_delete_future_recurrences   IN              VARCHAR2 DEFAULT fnd_api.g_false
554   );
555 
556   /**
557    * Close an existing Task
558    *
559    * Closes an existing Task by updating the Task Status to be Closed as defined by
560    * the profile "CSF: Default Auto Close Task Status (CSF_DFLT_AUTO_CLOSE_TASK_STATUS)"
561    *
562    * @param  p_api_version               API Version (1.0)
563    * @param  p_init_msg_list             Initialize Message List
564    * @param  p_commit                    Commit the Work
565    * @param  x_return_status             Return Status of the Procedure.
566    * @param  x_msg_count                 Number of Messages in the Stack.
567    * @param  x_msg_data                  Stack of Error Messages.
568    * @param  p_task_id                   Task ID of the Task to be closed
569    */
570   PROCEDURE close_task (
571     p_api_version     IN           NUMBER
572   , p_init_msg_list   IN           VARCHAR2 DEFAULT fnd_api.g_false
573   , p_commit          IN           VARCHAR2 DEFAULT fnd_api.g_false
574   , x_return_status   OUT  NOCOPY  VARCHAR2
575   , x_msg_count       OUT  NOCOPY  NUMBER
576   , x_msg_data        OUT  NOCOPY  VARCHAR2
577   , p_task_id         IN           NUMBER
578   );
579 
580   /**
581    * Update the Task Status with the given Status and propagate to the
582    * Task Assignments also if required.
583    * <br>
584    * Task is updated with the new Status if the Transition from the current status
588    * If the new Status of the Task is CANCELLED, then all Assignments which are open
585    * to the new status is allowed as determined by VALIDATE_STATE_TRANSITION.
586    * Transition validation is done only when Validation Level is passed as FULL.
587    *
589    * (Working, Accepted, Assigned, In-Planning, Planned, On-Hold) needs to be
590    * cancelled too. Other Assignments of the Task will not be updated.
591    * <br>
592    * If the new Status of the Task is CLOSED, then we have to validate if the Task
593    * can be closed. For this, there should not be any Open Task Assignments linked
594    * to the Task. Moreover, if the Profile "CSFW: Update Schedulable Task" is set to
595    * Yes, then the debrief linked with the Assignments should have been COMPLETED.
596    * Otherwise Task cant be closed. If all verifications passes, then Task and the
597    * open Assignments are closed. Same logic as that of TASK_IS_CLOSABLE. Have to
598    * make it one.
599    *
600    * @param  p_api_version               API Version (1.0)
601    * @param  p_init_msg_list             Initialize Message List
602    * @param  p_commit                    Commit the Work
603    * @param  p_validation_level          Validate the given Parameters
604    * @param  x_return_status             Return Status of the Procedure.
605    * @param  x_msg_count                 Number of Messages in the Stack.
606    * @param  x_msg_data                  Stack of Error Messages.
607    * @param  p_task_id                   Task ID of the Task to be Updated
608    * @param  p_task_status_id            New Task Status ID for the Task.
609    * @param  p_object_version_number     Current Task Version and also container for new one.
610    */
611   PROCEDURE update_task_status (
612     p_api_version             IN              NUMBER
613   , p_init_msg_list           IN              VARCHAR2 DEFAULT NULL
614   , p_commit                  IN              VARCHAR2 DEFAULT NULL
615   , p_validation_level        IN              NUMBER   DEFAULT NULL
616   , x_return_status           OUT NOCOPY      VARCHAR2
617   , x_msg_count               OUT NOCOPY      NUMBER
618   , x_msg_data                OUT NOCOPY      VARCHAR2
619   , p_task_id                 IN              NUMBER
620   , p_task_status_id          IN              NUMBER
621   , p_object_version_number   IN OUT NOCOPY   NUMBER
622   );
623 
624   PROCEDURE autoreject_task (
625     p_api_version             IN              NUMBER
626   , p_init_msg_list           IN              VARCHAR2 DEFAULT NULL
627   , p_commit                  IN              VARCHAR2 DEFAULT NULL
628   , p_validation_level        IN              NUMBER   DEFAULT NULL
629   , x_return_status           OUT NOCOPY      VARCHAR2
630   , x_msg_count               OUT NOCOPY      NUMBER
631   , x_msg_data                OUT NOCOPY      VARCHAR2
632   , p_task_id                 IN              NUMBER
633   , p_task_status_id          IN              NUMBER
634   , p_object_version_number   IN OUT NOCOPY   NUMBER
635   , p_reject_message          IN              VARCHAR2
636   );
637 
638 
639   /**
640    * Commits the Tasks as per the given the Query Criteria or only the given Task.
641    *
642    * This API can be used in four different ways
643    *   1. <b> Giving Query ID </b> to be used to retrieve the Tasks which should be
644    *      validated and committed. For this, pass only P_QUERY_ID which will identify the
645    *      query to be used from CSF_DC_QUERIES_B. Auto Commit Task Concurrent Program uses it.
646    *
647    *   2. <b> Giving Resource and Dates </b> which will be used to get the valid Task Assignments
648    *      and committing them. Pass P_RESOURCE_ID, P_RESOURCE_TYPE, P_SCHEDULED_START_DATE
652    *   3. <b> A single Task </b> can be committed too. Use P_TASK_ID to implement this feature.
649    *      and P_SCHEDULED_END_DATE to implement this feature of getting the candidates.
650    *      Plan Board and Gantt uses this when a Resource is clicked and Committed.
651    *
653    *      Planboard / Gantt / Task List Right Click on a Task uses this feature.
654    *
655    *   4. <b> This is called from AUTO COMMIT concurrent program for committing tasks from
656    *	   selected territories by dispatcher. The parameters that are used along with Territories
657    *	   are horizon and horizon UOM.
658    *
659    * <br>
660    * Whenever a Task in the candidate list is a Parent Task, then the Child Tasks of the
661    * Parent Task are processed in place of the Parent Task. Parent Task will be committed
662    * thru the Automatic Task Propagation Mechanism.
663    * <br>
664    * Each Task is validated before it is committed
665    *   1. There should be a valid Status Transition from the current status to Assigned Status.
666    *   2. If the Task requires Customer Confirmation, it should be set to RECEIVED ('R').
667    *   3. If the Task Assignment belongs to a Trip, the Trip shouldnt be blocked.
668    *   4. The Task should have Scheduled Dates stamped.
669    *
670    * <br>
671    * If a Task is not committed, then the stack will have the proper reason why it is committed.
672    * Even if the Task is committed, then the stack is populated with the success message.
673    *
674    * @param  p_api_version               API Version (1.0)
675    * @param  p_init_msg_list             Initialize Message List
676    * @param  p_commit                    Commit the Work
677    * @param  x_return_status             Return Status of the Procedure.
678    * @param  x_msg_count                 Number of Messages in the Stack.
679    * @param  x_msg_data                  Stack of Error Messages.
680    * @param  p_resource_id               Resource ID
681    * @param  p_resource_type             Resource Type
685    * @param  p_trip_id                   Trip containing the Tasks to be committed.
682    * @param  p_scheduled_start_date      Scheduled Start Date of Tasks to be considered
683    * @param  p_scheduled_end_date        Scheduled End Date of Tasks to be considered
684    * @param  p_query_id                  Query ID to be used to pick up Tasks
686    * @param  p_task_id                   Task ID for one single task.
687    * @param  p_task_source	    		 This will have value 'TERRITORY OR TASK_LIST_QUERY' used in AUTO COMMIT CP
688    * @param  p_commit_horizon			 This is used in  AUTO COMMIT CP when p_task_source is 'TERRITORY'
689    * @param  p_commit_horizon_uom		 This is used in  AUTO COMMIT CP when p_commit_horizon is not null
690    * @param  p_from_task_id				 This is used in  AUTO COMMIT CP for reducing tasks in each CP (PARALLEL PROCESSING)
691    * @param  p_to_task_id				 This is used in  AUTO COMMIT CP for reducing tasks in each CP (PARALLEL PROCESSING)
692 
693 
694    */
695   PROCEDURE commit_schedule (
696     p_api_version            IN           NUMBER
697   , p_init_msg_list          IN           VARCHAR2  DEFAULT NULL
698   , p_commit                 IN           VARCHAR2  DEFAULT NULL
699   , x_return_status          OUT  NOCOPY  VARCHAR2
700   , x_msg_count              OUT  NOCOPY  NUMBER
701   , x_msg_data               OUT  NOCOPY  VARCHAR2
702   , p_resource_id            IN           NUMBER    DEFAULT NULL
703   , p_resource_type          IN           VARCHAR2  DEFAULT NULL
704   , p_scheduled_start_date   IN           DATE      DEFAULT NULL
705   , p_scheduled_end_date     IN           DATE      DEFAULT NULL
706   , p_query_id               IN           NUMBER    DEFAULT NULL
707   , p_trip_id                IN           NUMBER    DEFAULT NULL
708   , p_task_id                IN           NUMBER    DEFAULT NULL
709   , p_task_source	         IN           VARCHAR2  DEFAULT NULL
710   , p_commit_horizon		 IN  		  NUMBER    DEFAULT NULL
711   , p_commit_horizon_uom	 IN  		  VARCHAR2  DEFAULT NULL
712   , p_from_task_id			 IN  		  NUMBER    DEFAULT NULL
713   , p_to_task_id			 IN  		  NUMBER    DEFAULT NULL
714   , p_commit_horizon_from	 IN  		  NUMBER   	DEFAULT NULL
715   , p_commit_uom_from	 	 IN  		  VARCHAR2 	DEFAULT NULL
716   );
717 
718   /**
719    * Given a set of Tasks, the API identifies the tasks which have been modified and
720    * which are not by comparing the values in the collection with that in DB.
721    *
722    * The passed collection of Task Data itself will be updated with the new Task
723    * Data and Updated Flag as 'Y' corresponding to the modified Task Record.
724    *
725    * @param  p_api_version               API Version (1.0)
726    * @param  p_init_msg_list             Initialize Message List
727    * @param  x_return_status             Return Status of the Procedure.
728    * @param  x_msg_count                 Number of Messages in the Stack.
729    * @param  x_msg_data                  Stack of Error Messages.
730    * @param  x_collection                A Table of Tasks and its data
731    * @param  x_count                     Number of Tasks modified.
732    */
733   PROCEDURE identify_modified_tasks (
734     p_api_version     IN               NUMBER
735   , p_init_msg_list   IN               VARCHAR2 DEFAULT fnd_api.g_false
736   , x_return_status   OUT      NOCOPY  VARCHAR2
737   , x_msg_count       OUT      NOCOPY  NUMBER
741   );
738   , x_msg_data        OUT      NOCOPY  VARCHAR2
739   , x_collection      IN  OUT  NOCOPY  tasks_tbl_type
740   , x_count           OUT      NOCOPY  NUMBER
742 
743   /**
744    * Validates the passed dates against System Date.
745    * If Start Date is less than System Date or NULL, then it is set to System Date.
746    * If End Date is less than System Date or NULL, it is set to System Date + Planscope.
747    *
748    * @param x_start   Start Date of the Plan Window
749    * @param x_end     End Date of the Plan Window.
750    */
751   PROCEDURE validate_planned_dates (x_start IN OUT NOCOPY DATE, x_end IN OUT NOCOPY DATE);
752 
753   /**
754    * Moves the given Task to Scheduled Status by updating the Task and also
755    * creating an Assignment with the given Resource Details.
756    *
757    * Suppose Old Task Assignment ID is provided, then the Old Task Assignment
758    * is automatically cancelled.
759    * <br>
760    * Tries to validate the new Task Status by checking whether there exists any Transition
761    * from the old status to tbe new one. After that updates the Task with the given
762    * Status and Scheduled Timings. After that creates a new Task Assignment (or reuses Cancelled
763    * Task Assignments for the Task) with the given Resource and Travel Information.
764    *
765    * @param  p_api_version                 API Version (1.0)
766    * @param  p_init_msg_list               Initialize Message List
767    * @param  p_commit                      Commit the Work
768    * @param  x_return_status               Return Status of the Procedure.
769    * @param  x_msg_count                   Number of Messages in the Stack.
770    * @param  x_msg_data                    Stack of Error Messages.
771    * @param  p_task_id                     Task ID of the Task to be Updated
772    * @param  p_object_version_number       Current Task Version and also container for new one.
773    * @param  p_task_status_id              New Task Status ID
774    * @param  p_scheduled_start_date        New Scheduled Start Date (NULL if change not needed).
775    * @param  p_scheduled_end_date          New Scheduled End Date (NULL if change not needed).
776    * @param  p_planned_start_date          Planned Start Date of task.
777    * @param  p_planned_end_date            Planned End Date of task.
778    * @param  p_old_task_assignment_id      Old Task Assignment to be Cancelled.
779    * @param  p_old_ta_object_version       Object Version of Old Task Assignment to be Cancelled.
780    * @param  p_assignment_status_id        New Task Assignment Status ID
781    * @param  p_resource_id                 Resource ID who will perform the Task
782    * @param  p_resource_type               Type of the Resource who will perform the Task
783    * @param  p_object_capacity_id          Trip ID
784    * @param  p_sched_travel_distance       Scheduled Travel Distance
785    * @param  p_sched_travel_duration       Scheduled Travel Duration
786    * @param  p_sched_travel_duration_uom   Scheduled Travel Duration UOM
787    * @param  x_task_assignment_id          Task Assignment created for the Task
788    * @param  x_ta_object_version_number    Object Version Number of Task Assignment created
789    */
790   PROCEDURE assign_task(
791     p_api_version                 IN              NUMBER
792   , p_init_msg_list               IN              VARCHAR2 DEFAULT NULL
793   , p_commit                      IN              VARCHAR2 DEFAULT NULL
794   , x_return_status               OUT    NOCOPY   VARCHAR2
795   , x_msg_count                   OUT    NOCOPY   NUMBER
796   , x_msg_data                    OUT    NOCOPY   VARCHAR2
797   , p_task_id                     IN              NUMBER
798   , p_object_version_number       IN OUT NOCOPY   NUMBER
799   , p_task_status_id              IN              NUMBER
800   , p_scheduled_start_date        IN              DATE
801   , p_scheduled_end_date          IN              DATE
802   , p_planned_start_date          IN              DATE     DEFAULT FND_API.G_MISS_DATE
803   , p_planned_end_date            IN              DATE     DEFAULT FND_API.G_MISS_DATE
804   , p_old_task_assignment_id      IN              NUMBER   DEFAULT NULL
805   , p_old_ta_object_version       IN              NUMBER   DEFAULT NULL
806   , p_assignment_status_id        IN              NUMBER
807   , p_resource_id                 IN              NUMBER
808   , p_resource_type               IN              VARCHAR2
809   , p_object_capacity_id          IN              NUMBER
810   , p_sched_travel_distance       IN              NUMBER
811   , p_sched_travel_duration       IN              NUMBER
812   , p_sched_travel_duration_uom   IN              VARCHAR2
813   , p_planned_effort              IN              NUMBER   DEFAULT fnd_api.g_miss_num
814   , p_planned_effort_uom          IN              VARCHAR2 DEFAULT fnd_api.g_miss_char
815   , x_task_assignment_id          OUT NOCOPY      NUMBER
816   , x_ta_object_version_number    OUT NOCOPY      NUMBER
817   );
818 
819   /**
820    * Unschedules the Task by moving the Task to the given Task Status ID and also cancels
821    * the given Assignment by moving it to the given Assignment Status ID.
822    *
823    * Suppose Task Status is passed as NULL, then the Task Status is not updated.
824    * Suppose Assignment Status is passed as NULL, then the default Cancelled Status is used.
825    * <br>
826    * validates the given Task Status by checking the Transition. Also if the new Task Status
830    * @param  p_api_version                 API Version (1.0)
827    * has Cancelled Flag checked, and if the Task is a Child Task, then Parent Task ID and
828    * Task Split Flag column of the Task is cleared.
829    *
831    * @param  p_init_msg_list               Initialize Message List
832    * @param  p_commit                      Commit the Work
833    * @param  x_return_status               Return Status of the Procedure.
834    * @param  x_msg_count                   Number of Messages in the Stack.
835    * @param  x_msg_data                    Stack of Error Messages.
836    * @param  p_task_id                     Task ID of the Task to be Updated
837    * @param  p_object_version_number       Current Task Version and also container for new one.
838    * @param  p_task_status_id              New Task Status ID
839    * @param  p_task_assignment_id          Task Assignment to be cancelled
840    * @param  p_ta_object_version_number    Object Version Number of Task Assignment to be cancelled
841    * @param  p_assignment_status_id        New Assignment Status to be used to cancel the Assignments
842    */
843   PROCEDURE unassign_task(
844     p_api_version                IN              NUMBER
845   , p_init_msg_list              IN              VARCHAR2 DEFAULT NULL
846   , p_commit                     IN              VARCHAR2 DEFAULT NULL
847   , x_return_status              OUT    NOCOPY   VARCHAR2
848   , x_msg_count                  OUT    NOCOPY   NUMBER
849   , x_msg_data                   OUT    NOCOPY   VARCHAR2
850   , p_task_id                    IN              NUMBER
851   , p_object_version_number      IN OUT NOCOPY   NUMBER
852   , p_task_status_id             IN              NUMBER
853   , p_task_assignment_id         IN              NUMBER
854   , p_ta_object_version_number   IN OUT NOCOPY   NUMBER
855   , p_assignment_status_id       IN              NUMBER
856   );
857 
858   /**
859    * Updates the affected Task along with the Assignment.
860    *
861    * When Tasks in a Trip are affected by Scheduling / Unscheduling a
862    * Task into/from the Trip, the Task's Scheduled Dates and Travel
863    * Data are updated as specified. Trip Data is not touched and Task
864    * Assignment still resides in the same Trip.
865    *
866    * <b> Parameters and the optionality of the parameter. </b>
872    *    p_sched_travel_duration       No Change   NA           Update
867    *    Parameter                     NULL        FND_MISS_%   other
868    *    ---------------------------   ---------   ----------   ------
869    *    p_scheduled_start_date        No Change   NA           Update
870    *    p_scheduled_end_date          No Change   NA           Update
871    *    p_sched_travel_distance       No Change   NA           Update
873    *    p_sched_travel_duration_uom   No Change   NA           Update
874    *
875    * <b>Key</b>
876    *    NA        - Not Applicable (Value should be passed)
877    *    No Change - Whatever value is there in DB for the column is retained.
878    *    Update    - Column is updated with the new value in the DB
879    *
880    * @param  p_api_version                 API Version (1.0)
881    * @param  p_init_msg_list               Initialize Message List
882    * @param  p_commit                      Commit the Work
883    * @param  x_return_status               Return Status of the Procedure.
884    * @param  x_msg_count                   Number of Messages in the Stack.
885    * @param  x_msg_data                    Stack of Error Messages.
886    * @param  p_task_id                     Task ID of the Task to be Updated
887    * @param  p_object_version_number       Current Task Version and also container for new one.
888    * @param  p_scheduled_start_date        New Scheduled Start Date (NULL if change not needed).
892    * @param  p_sched_travel_distance       Travel Distance (NULL if change not needed).
889    * @param  p_scheduled_end_date          New Scheduled End Date (NULL if change not needed).
890    * @param  p_task_assignment_id          Task Assignment ID to be updated
891    * @param  p_ta_object_version_number    Current Assignment Version and also container for new one.
893    * @param  p_sched_travel_duration       Travel Duration (NULL if change not needed).
894    * @param  p_sched_travel_duration_uom   Travel Duration UOM (NULL if change not needed).
895    */
896   PROCEDURE update_task_and_assignment(
897     p_api_version                 IN              NUMBER
898   , p_init_msg_list               IN              VARCHAR2 DEFAULT NULL
899   , p_commit                      IN              VARCHAR2 DEFAULT NULL
900   , x_return_status               OUT    NOCOPY   VARCHAR2
901   , x_msg_count                   OUT    NOCOPY   NUMBER
902   , x_msg_data                    OUT    NOCOPY   VARCHAR2
903   , p_task_id                     IN              NUMBER
904   , p_object_version_number       IN OUT NOCOPY   NUMBER
905   , p_scheduled_start_date        IN              DATE
906   , p_scheduled_end_date          IN              DATE
907   , p_task_assignment_id          IN              NUMBER
908   , p_ta_object_version_number    IN OUT NOCOPY   NUMBER
909   , p_sched_travel_distance       IN              NUMBER
910   , p_sched_travel_duration       IN              NUMBER
911   , p_sched_travel_duration_uom   IN              VARCHAR2
912   );
913 
914   /**
915    * Updates the given Task with the given information or Transforms the task
916    * so that it becomes a Normal Task from a Parent Task or a Parent Task
917    * from a Normal Task.
918    *
919    * <b> Transforming a Normal Task into a Parent Task (ScheduleOption) </b>
920    *    Action should be passed as <b> CSF_TASKS_PUB.G_ACTION_NORMAL_TO_PARENT </b>
924    *    ---------------------------   ---------   ----------   ------
921    *    Task Split Flag is changed as 'M'.
922    *
923    *    Parameter                     NULL        FND_MISS_%   other
925    *    p_action                      NA          NA           Process Action
926    *    p_task_status_id              No Change   NA           Update
927    *    p_scheduled_start_date        NA          NA           Update
928    *    p_scheduled_end_date          NA          NA           Update
929    *
930    * <b> Updating a Parent Task </b>
931    *    Action should be passed as <b> CSF_TASKS_PUB.G_ACTION_UPDATE_PARENT </b>
932    *    Task Split Flag is not updated.
933    *
934    *    Parameter                     NULL        FND_MISS_%   other
935    *    ---------------------------   ---------   ----------   ------
936    *    p_action                      NA          NA           Process Action
937    *    p_task_status_id              No Change   NA           Update
938    *    p_scheduled_start_date        No Change   NA           Update
939    *    p_scheduled_end_date          No Change   NA           Update
940    *
941    * <b> Transforming a Parent Task into a Normal Task (UnscheduleTask) </b>
942    *    Action should be passed as <b> CSF_TASKS_PUB.G_ACTION_PARENT_TO_NORMAL </b>
943    *    Task Split Flag of the Task will be cleared.
944    *
945    *    Parameter                     NULL        FND_MISS_%   other
946    *    ---------------------------   ---------   ----------   ------
947    *    p_action                      NA          NA           Process Action
948    *    p_task_status_id              No Change   NA           Update
949    *    p_scheduled_start_date        ** Parameter not used. Column Cleared **
950    *    p_scheduled_end_date          ** Parameter not used. Column Cleared **
951    *
952    * <b>Key</b>
953    *    NA        - Not Applicable (Value should be passed)
954    *    No Change - Whatever value is there in DB for the column is retained.
955    *    Update    - Column is updated with the new value in the DB
956    *
957    * @param  p_api_version                 API Version (1.0)
958    * @param  p_init_msg_list               Initialize Message List
959    * @param  p_commit                      Commit the Work
960    * @param  x_return_status               Return Status of the Procedure.
961    * @param  x_msg_count                   Number of Messages in the Stack.
962    * @param  x_msg_data                    Stack of Error Messages.
963    * @param  p_task_id                     Task ID of the Task to be Updated
964    * @param  p_object_version_number       Current Task Version and also container for new one.
965    * @param  p_action                      Action to be processed
969    */
966    * @param  p_task_status_id              New Task Status ID
967    * @param  p_planned_start_date          Planned Start Date
968    * @param  p_planned_end_date            Planned End Date
970   PROCEDURE update_task_longer_than_shift (
971     p_api_version             IN              NUMBER
972   , p_init_msg_list           IN              VARCHAR2 DEFAULT NULL
973   , p_commit                  IN              VARCHAR2 DEFAULT NULL
974   , x_return_status           OUT    NOCOPY   VARCHAR2
975   , x_msg_count               OUT    NOCOPY   NUMBER
976   , x_msg_data                OUT    NOCOPY   VARCHAR2
977   , p_task_id                 IN              NUMBER
978   , p_object_version_number   IN OUT NOCOPY   NUMBER
979   , p_planned_start_date      IN              DATE     DEFAULT FND_API.G_MISS_DATE
980   , p_planned_end_date        IN              DATE     DEFAULT FND_API.G_MISS_DATE
981   , p_action                  IN              PLS_INTEGER
982   , p_task_status_id          IN              NUMBER   DEFAULT fnd_api.g_miss_num
983   );
984 
985   /**
986    * Creates a Child Task (and Assignment) from the given Parent Task
987    * with the given Scheduled Timings and Duration in the given Trip.
988    *
989    * Creates a Child Task by copying most of the attributes from the given
990    * Parent Task and also an assignment. Moreover the Confirmation and Confirmation
991    * Counter is copied from the Parent Task.
992    *
993    * @param  p_api_version               API Version (1.0)
994    * @param  p_init_msg_list             Initialize Message List
995    * @param  p_commit                    Commit the Work
996    * @param  x_return_status             Return Status of the Procedure.
997    * @param  x_msg_count                 Number of Messages in the Stack.
998    * @param  x_msg_data                  Stack of Error Messages.
999    * @param  p_parent_task_id            Parent Task Identifier
1000    * @param  p_task_status_id            Task Status ID of the Child Task
1001    * @param  p_planned_effort            Planned Effort of the Child Task
1002    * @param  p_planned_effort_uom        Planned Effort UOM of the Child Task
1003    * @param  p_bound_mode_flag           Bound Mode
1004    * @param  p_soft_bound_flag           Soft Bound
1005    * @param  p_scheduled_start_date      Scheduled Start Date of Child Task
1006    * @param  p_scheduled_end_date        Scheduled End Date of Child Task
1007    * @param  p_assignment_status_id      Task Assignment Status
1008    * @param  p_resource_id               Resource ID of the Child Task
1009    * @param  p_resource_type_code        Resource Type of the Child Task
1010    * @param  p_object_capacity_id        Trip ID of the Child Task
1011    * @param  p_sched_travel_distance     Scheduled Travel Distance of Child Task
1012    * @param  p_sched_travel_duration     Scheduled Travel Duration of Child Task
1013    * @param  p_sched_travel_duration_uom Scheduled Travel Duration UOM of Child Task
1014    * @param  x_task_id                   New Task Identifier of the Child Task
1015    * @param  x_object_version_number     Object Version of the Task created.
1016    * @param  x_task_assignment_id        Task Assignment created
1017    * @param  p_child_position            Position of the Child Task ('F', 'M', 'L', 'N')
1018    * @param  p_child_sequence_num        Sequence Number among the Child Tasks
1019    * @param  x_task_id                   The Task Id of the created Task
1020    * @param  x_object_version_number     Object Version Number of created task
1021    * @param  x_task_assignment_id        Task Assignment ID of the created Assignment
1022    */
1023   PROCEDURE create_child_task(
1024     p_api_version                 IN              NUMBER
1025   , p_init_msg_list               IN              VARCHAR2 DEFAULT NULL
1029   , x_msg_data                    OUT NOCOPY      VARCHAR2
1026   , p_commit                      IN              VARCHAR2 DEFAULT NULL
1027   , x_return_status               OUT NOCOPY      VARCHAR2
1028   , x_msg_count                   OUT NOCOPY      NUMBER
1030   , p_parent_task_id              IN              NUMBER
1031   , p_task_status_id              IN              NUMBER
1032   , p_planned_effort              IN              NUMBER
1033   , p_planned_effort_uom          IN              VARCHAR2
1034   , p_bound_mode_code             IN              VARCHAR2
1035   , p_soft_bound_flag             IN              VARCHAR2
1036   , p_scheduled_start_date        IN              DATE
1037   , p_scheduled_end_date          IN              DATE
1038   , p_assignment_status_id        IN              NUMBER
1039   , p_resource_id                 IN              NUMBER
1040   , p_resource_type               IN              VARCHAR2
1041   , p_object_capacity_id          IN              NUMBER
1042   , p_sched_travel_distance       IN              NUMBER
1043   , p_sched_travel_duration       IN              NUMBER
1044   , p_sched_travel_duration_uom   IN              VARCHAR2
1045   , p_child_position              IN              VARCHAR2 DEFAULT NULL
1046   , p_child_sequence_num          IN              NUMBER   DEFAULT NULL
1047   , x_task_id                     OUT NOCOPY      NUMBER
1048   , x_object_version_number       OUT NOCOPY      NUMBER
1049   , x_task_assignment_id          OUT NOCOPY      NUMBER
1050   );
1051 
1052   /**
1053    * Updates the customer confirmation for normal/child/parent task
1054    *
1055    * @param  p_api_version                   API Version (1.0)
1056    * @param  p_init_msg_list                 Initialize Message List
1057    * @param  p_commit                        Commit the Work
1058    * @param  x_return_status                 Return Status of the Procedure
1059    * @param  x_msg_count                     Number of Messages in the Stack
1060    * @param  x_msg_data                      Stack of Error Messages
1061    * @param  p_task_id                       Task to be processed
1062    * @param  p_object_version_number         Object version of input task
1063    * @param  p_action                        Whether Required/Received/Not Required
1064    * @param  p_initiated                     Whether Customer or Dispatcher
1065    */
1066   PROCEDURE update_cust_confirmation(
1067     p_api_version                 IN              NUMBER
1068   , p_init_msg_list               IN              VARCHAR2 DEFAULT NULL
1069   , p_commit                      IN              VARCHAR2 DEFAULT NULL
1070   , x_return_status               OUT NOCOPY      VARCHAR2
1071   , x_msg_count                   OUT NOCOPY      NUMBER
1072   , x_msg_data                    OUT NOCOPY      VARCHAR2
1073   , p_task_id                     IN              NUMBER
1074   , p_object_version_number       IN OUT NOCOPY   NUMBER
1075   , p_action                      IN              PLS_INTEGER
1076   , p_initiated                   IN              PLS_INTEGER
1077   );
1078 
1079   /**
1080    * Gets the Location ID of the Task given the Task ID / Party Site ID / Location ID
1081    * <br>
1082    * 1. If Location ID is passed, the function just returns the value.
1083    * 2. If Party Site ID is passed, then the function returns the Location ID tied to the
1084    *    Party Site.
1088    *
1085    * 3. If Task ID alone is given, then the function finds out whether the Task's Location
1086    *    ID is stamped. If yes, then returns it.. otherwise returns the Location ID tied
1087    *    to the Task's Party Site.
1089    * @param  p_task_id          Task ID
1090    * @param  p_party_site_id    Party Site ID of the Task
1091    * @param  p_location_id      Location ID of the Task
1092    */
1093   FUNCTION get_task_location_id (
1094     p_task_id       IN NUMBER
1095   , p_party_site_id IN NUMBER DEFAULT NULL
1099 
1096   , p_location_id   IN NUMBER DEFAULT NULL
1097   )
1098     RETURN NUMBER;
1100   /**
1101    * Gets the Address of the Task given the Task ID / Party Site ID / Location ID
1102    * <br>
1103    * 1. If Location ID is passed, it will be directly used.
1104    * 2. If Party Site ID is passed, then the function retrieves the Location ID tied to the
1105    *    Party Site and returns the Address.
1106    * 3. If Task ID alone is given, then the function finds out whether the Task's Location
1107    *    ID is stamped. If yes, then returns the address of the Location.. Otherwise
1108    *    returns the address of the location tied to the Task's Party Site.
1109    *
1110    * @param  p_task_id          Task ID
1111    * @param  p_party_site_id    Party Site ID of the Task
1112    * @param  p_location_id      Location ID of the Task
1113    * @param  p_short_flag       Address Format - Short Format / Long Format
1114    */
1115   FUNCTION get_task_address (
1116     p_task_id       IN NUMBER
1117   , p_party_site_id IN NUMBER   DEFAULT NULL
1118   , p_location_id   IN NUMBER   DEFAULT NULL
1119   , p_short_flag    IN VARCHAR2 DEFAULT 'Y'
1120   )
1124    * Gets the Task Effort conditionally converted to the Default UOM as given by
1121     RETURN VARCHAR2;
1122 
1123   /**
1125    * the profile CSF: Default Effort UOM by calling
1126    * CSF_UTIL_PVT.GET_EFFORT_IN_DEFAULT_UOM function.
1127    * <br>
1128    * All parameters are optional. If Planned Effort, Planned Effort UOM and Task
1129    * Split Flag are passed, then it helps in better performance as JTF_TASKS_B
1130    * wont be queried to get those information. In case of better flexibility,
1131    * the caller can just pass the Task ID and the API will fetch the required
1132    * information. If case none of the required parameters are passed, the API returns
1133    * NULL.
1134    * <br>
1135    * Parent Task / Normal Tasks are created by the Teleservice Operators and therefore
1136    * its always better to represent them in the UOM they had given initially. Tasks
1137    * created as part of the Background processes like Child Tasks are always created
1138    * in Minutes by Scheduler and therefore it is incumbent upon us to represent
1139    * them in a proper UOM. Thus this API will convert the Planned Effort to the default
1140    * UOM only for Child Tasks and will merely act as a Concatenation Operator for
1141    * other Tasks. If you want to overrule this and want conversion to Default UOM
1142    * to take place for all Tasks, pass p_always_convert as FND_API.G_TRUE
1143    *
1144    * Also refer to the documentation on CSF_UTIL_PVT.GET_EFFORT_IN_DEFAULT_UOM.
1145    * <br>
1146    *
1147    * @param p_planned_effort      Planned Effort to be converted
1148    * @param p_planned_effort_uom  UOM of the above Effort
1149    * @param p_task_split_flag     Determines whether the Task is Child / Other
1150    * @param p_task_id             Task ID of the Task whose effort is to be converted
1151    * @param p_always_convert      Overrule the condition and convert for all Tasks.
1152    *
1153    * @result Planned Effort appro converted to Default UOM.
1154    */
1155   FUNCTION get_task_effort_in_default_uom(
1159   , p_task_id              NUMBER     DEFAULT NULL
1156     p_planned_effort       NUMBER     DEFAULT NULL
1157   , p_planned_effort_uom   VARCHAR2   DEFAULT NULL
1158   , p_task_split_flag      VARCHAR2   DEFAULT '@' -- NULL not used as NULL is a valid value
1160   , p_always_convert       VARCHAR2   DEFAULT NULL
1161   )
1162     RETURN VARCHAR2;
1163 
1164   /**
1165    * Given the Service Request Incident ID or Task ID, Contact
1166    * Details are fetched. If the profile CSF: Default Source for
1167    * Contact is set to SR, then SR is queried. Otherwise Task is
1168    * queried.
1169    *
1170    * @param p_incident_id   Service Request ID
1171    * @param p_task_id       Task Id
1172    * @param x_last_name     Last Name
1173    * @param x_first_name    First Name
1174    * @param x_title         Title
1175    * @param x_phone         Phone Number of the Contact Person
1176    * @param x_phone_ext     Phone Extension
1177    * @param x_email_address Email Address of the Contact Person
1178    */
1179   PROCEDURE get_contact_details(
1180     p_incident_id    IN        NUMBER
1181   , p_task_id        IN        NUMBER    DEFAULT NULL
1182   , x_last_name     OUT NOCOPY VARCHAR2
1183   , x_first_name    OUT NOCOPY VARCHAR2
1184   , x_title         OUT NOCOPY VARCHAR2
1185   , x_phone         OUT NOCOPY VARCHAR2
1186   , x_phone_ext     OUT NOCOPY VARCHAR2
1187   , x_email_address OUT NOCOPY VARCHAR2
1188   );
1189 
1190   /**
1191    * Given the Service Request Incident ID or the Task ID, Contact
1192    * Person Name and Phone are fetched. The Name and Phone are
1193    * separated by @@
1194    *
1195    * @param p_incident_id  Service Request ID
1196    * @param p_task_id      Task ID
1197    */
1198   FUNCTION get_contact_details(
1199     p_incident_id  NUMBER
1200   , p_task_id      NUMBER    DEFAULT NULL
1201   ) RETURN VARCHAR2;
1202 
1203   procedure update_personal_task(
1204 	      	p_api_version               in number
1205 	      , p_init_msg_list        in varchar2
1206           , p_commit             in varchar2
1207           , p_task_id                    in NUMBER
1208           , p_task_name                  in varchar2
1209           , x_version     in out nocopy number
1210 	      , p_description                in VARCHAR2
1211 	      , p_task_type_id             in number
1212 	      , p_task_status_id           in number
1213 	      , p_task_priority_id    in number
1214 	      , p_owner_id                   in number
1215 	      , p_owner_type_code            in varchar2
1216 	      , p_address_id                 in number
1217 	      , p_customer_id               in number
1218 	      , p_planned_start_date         in date
1219 	      , p_planned_end_date          in date
1220 	      , p_scheduled_start_date       in date
1221 	      , p_scheduled_end_date         in date
1222 	      , p_source_object_type_code   in varchar2
1223 	      , p_planned_effort             in number
1224 	      , p_planned_effort_uom         in varchar2
1225 	      , p_bound_mode_code            in varchar2
1226 	      , p_soft_bound_flag           in varchar2
1227 	      , p_type                       in varchar2
1228         , p_trip                     in number
1229 	      , x_return_status              out nocopy varchar2
1230 	      , x_msg_count                  out nocopy number
1231 	      , x_msg_data                   out nocopy varchar2
1232         );
1233 
1234 procedure  create_personal_task(
1235 		    p_api_version                   in number
1236 	      , p_init_msg_list        in varchar2
1237 		  , p_commit             in varchar2
1238           , p_task_name                in varchar2
1239 	      , p_description               in varchar2
1240 	      , p_task_type_name           in varchar2
1241 	      , p_task_type_id              in number
1242 	      , p_task_status_name          in varchar2
1243 	      , p_task_status_id              in number
1244 	      , p_task_priority_name        in varchar2
1245 	      , p_task_priority_id            in number
1246 	      , p_owner_id                   in number
1247 	      , p_owner_type_code           in varchar2
1248 	      , p_address_id                  in number
1249 	      , p_customer_id                 in number
1250 	      , p_planned_start_date         in date
1251 	      , p_planned_end_date           in date
1252 	      , p_scheduled_start_date      in date
1253 	      , p_scheduled_end_date         in date
1254 	      , p_source_object_type_code    in varchar2
1255 	      , p_planned_effort             in number
1259 	      , p_task_assign_tbl           jtf_tasks_pub.task_assign_tbl
1256 	      , p_planned_effort_uom        in varchar2
1257 	      , p_bound_mode_code            in varchar2
1258 	      , p_soft_bound_flag            in varchar2
1260 	      , p_type                     in varchar2
1261           , p_trip                     in number
1262 	      , x_return_status             out nocopy varchar2
1263 	      , x_msg_count                 out nocopy number
1264 	      , x_msg_data                  out nocopy varchar2
1265 	      , x_task_id                    out nocopy number
1266 	      );
1267 
1268  -- Inst_flexfld_rec_type : This type is used to pass record information
1269  -- for flexfields used in CSFDCTKS.
1270  -- flex field are ITEM_INSTANCE for SERVICE FLEX FIELD it is updated in CSFDCLIB.old
1271  -- flex field FOR tasks in updated in update_task_attr procedure in this package
1272  TYPE Inst_flexfld_rec_type IS RECORD (
1276 	,l_task_ovn            number DEFAULT NULL
1273    l_flex_fl_table       varchar2(255) DEFAULT NULL
1274 	,l_task_id             number DEFAULT NULL
1275 	,l_att_catogary        varchar2(255) DEFAULT NULL
1277   ,l_instance_id 		     number DEFAULT NULL
1278   ,l_party_id            number DEFAULT NULL
1279   ,l_obj_ver_number	     number DEFAULT NULL
1280 	,l_context 			       varchar2(255)
1281 	,ATTRIBUTE1 		       varchar2(255)
1282 	,ATTRIBUTE2 		       varchar2(255)
1283 	,ATTRIBUTE3            varchar2(255)
1284 	,ATTRIBUTE4            varchar2(255)
1285 	,ATTRIBUTE5 		       varchar2(255)
1286 	,ATTRIBUTE6            varchar2(255)
1287 	,ATTRIBUTE7            varchar2(255)
1288 	,ATTRIBUTE8 		       varchar2(255)
1289 	,ATTRIBUTE9            varchar2(255)
1290 	,ATTRIBUTE10           varchar2(255)
1291 	,ATTRIBUTE11		       varchar2(255)
1292 	,ATTRIBUTE12           varchar2(255)
1293 	,ATTRIBUTE13           varchar2(255)
1294 	,ATTRIBUTE14		       varchar2(255)
1295 	,ATTRIBUTE15           varchar2(255)
1296 	,ATTRIBUTE16           varchar2(255)
1297 	,ATTRIBUTE17           varchar2(255)
1298 	,ATTRIBUTE18           varchar2(255)
1299 	,ATTRIBUTE19           varchar2(255)
1300 	,ATTRIBUTE20           varchar2(255)
1301 	,ATTRIBUTE21           varchar2(255)
1302 	,ATTRIBUTE22           varchar2(255)
1303 	,ATTRIBUTE23		       varchar2(255)
1304 	,ATTRIBUTE24           varchar2(255)
1305 	,ATTRIBUTE25           varchar2(255)
1306 	,ATTRIBUTE26           varchar2(255)
1307 	,ATTRIBUTE27           varchar2(255)
1308 	,ATTRIBUTE28           varchar2(255)
1309 	,ATTRIBUTE29           varchar2(255)
1310 	,ATTRIBUTE30           varchar2(255)
1311   );
1312 
1313   TYPE l_inst_flex_fld_tbl IS TABLE OF Inst_flexfld_rec_type;
1314 
1315   PROCEDURE set_desc_field_attr(
1316 	 p_inst_flex_fld_tbl IN  csf_tasks_pub.Inst_flexfld_rec_type
1317 	,p_return_status     OUT NOCOPY      VARCHAR2
1318 	,p_msg_count         OUT NOCOPY      NUMBER
1319 	,p_msg_data          OUT NOCOPY      VARCHAR2
1320   ,p_obj_ver_no        OUT NOCOPY      NUMBER
1321   );
1322 
1323   /**
1324    * This procedure is called from CSFDCTKS.fmb--Dates package
1325    * this procedure updates planned start/end, planned effort
1326    * scheduled dates ,priority and flex field for task
1327    * @param  p_api_version                   API Version (1.0)
1328    * @param  p_init_msg_list                 Initialize Message List
1329    * @param  p_commit                        Commit the Work
1330    * @param  x_return_status                 Return Status of the Procedure
1331    * @param  x_msg_count                     Number of Messages in the Stack
1332    * @param  x_msg_data                      Stack of Error Messages
1333    * @param  p_task_id              				 Task Id
1337    * @param  p_planned_start_date            Planned Start Date of task.
1334    * @param  p_object_version_number     		 Object version number for task
1335    * @param  p_scheduled_start_date          New Scheduled Start Date (NULL if change not needed).
1336    * @param  p_scheduled_end_date            New Scheduled End Date (NULL if change not needed).
1338    * @param  p_planned_end_date              Planned End Date of task.
1339    * @param  p_task_priority_id        	  	 Task priority Id
1340    * @param  p_planned_effort		             Planned effort for task
1341    * @param  p_planned_effort_uom	  		     Planned effort  UOM for task
1342    * @param  ATTRIBUTE1 		   		 	         Column can be used for Task Flex field
1343    * @param  ATTRIBUTE2 		  			         Column can be used for Task Flex field
1344    * @param  ATTRIBUTE3              		     Column can be used for Task Flex field
1345    * @param  ATTRIBUTE4              		     Column can be used for Task Flex field
1346    * @param  ATTRIBUTE5 		        	       Column can be used for Task Flex field
1347    * @param  ATTRIBUTE6                      Column can be used for Task Flex field
1348    * @param  ATTRIBUTE7                      Column can be used for Task Flex field
1349    * @param  ATTRIBUTE8 		                 Column can be used for Task Flex field
1353    * @param  ATTRIBUTE12                     Column can be used for Task Flex field
1350    * @param  ATTRIBUTE9               	     Column can be used for Task Flex field
1351    * @param  ATTRIBUTE10                     Column can be used for Task Flex field
1352    * @param  ATTRIBUTE11		                 Column can be used for Task Flex field
1354    * @param  ATTRIBUTE13                     Column can be used for Task Flex field
1355    * @param  ATTRIBUTE14		                 Column can be used for Task Flex field
1359 
1356    * @param  ATTRIBUTE15                     Column can be used for Task Flex field
1357    * @param  ATTRIBUTE_CATEGORY		           Catgory column for flex field
1358    */
1360   PROCEDURE update_task_attr(
1361     p_api_version             IN              NUMBER
1362   , p_init_msg_list           IN              VARCHAR2 DEFAULT NULL
1363   , p_commit                  IN              VARCHAR2 DEFAULT NULL
1364   , x_return_status           OUT NOCOPY      VARCHAR2
1365   , x_msg_count               OUT NOCOPY      NUMBER
1366   , x_msg_data                OUT NOCOPY      VARCHAR2
1367   , p_task_id                 IN              NUMBER
1368   , p_object_version_number   IN OUT NOCOPY   NUMBER
1369   , p_scheduled_start_date    IN              DATE 		DEFAULT NULL
1370   , p_scheduled_end_date      IN              DATE 		DEFAULT NULL
1371   , p_planned_start_date      IN              DATE 		DEFAULT NULL
1372   , p_planned_end_date        IN              DATE 		DEFAULT NULL
1373   , p_task_priority_id        IN              NUMBER  	DEFAULT NULL
1374   , p_planned_effort		  IN	     	  NUMBER 	DEFAULT NULL
1375   , p_planned_effort_uom	  IN	    	  VARCHAR2  DEFAULT NULL
1376   , ATTRIBUTE1 		   		  IN    		  VARCHAR2 DEFAULT NULL
1377   , ATTRIBUTE2 		  		  IN    		  VARCHAR2 DEFAULT NULL
1378   , ATTRIBUTE3                IN              VARCHAR2 DEFAULT NULL
1379   , ATTRIBUTE4                IN              VARCHAR2 DEFAULT NULL
1380   , ATTRIBUTE5 		          IN              VARCHAR2 DEFAULT NULL
1381   , ATTRIBUTE6                IN	          VARCHAR2 DEFAULT NULL
1382   , ATTRIBUTE7                IN	          VARCHAR2 DEFAULT NULL
1383   , ATTRIBUTE8 		          IN              VARCHAR2 DEFAULT NULL
1384   , ATTRIBUTE9                IN              VARCHAR2 DEFAULT NULL
1385   , ATTRIBUTE10               IN              VARCHAR2 DEFAULT NULL
1386   , ATTRIBUTE11		          IN              VARCHAR2 DEFAULT NULL
1387   , ATTRIBUTE12               IN              VARCHAR2 DEFAULT NULL
1388   , ATTRIBUTE13               IN	          VARCHAR2 DEFAULT NULL
1389   , ATTRIBUTE14		          IN	          VARCHAR2 DEFAULT NULL
1390   , ATTRIBUTE15               IN              VARCHAR2 DEFAULT NULL
1391   , ATTRIBUTE_CATEGORY		  IN    		  VARCHAR2 DEFAULT NULL
1392   );
1393 
1394   PROCEDURE get_site_details_for_task
1395   ( p_task_id       IN NUMBER
1396   , p_party_id 		IN NUMBER
1397   , p_party_site_id IN NUMBER DEFAULT NULL
1398   , p_location_id   IN NUMBER DEFAULT NULL
1399   , p_party_site_no  OUT NOCOPY  VARCHAR
1400   , p_party_site_nm  OUT NOCOPY VARCHAR
1401   , p_party_site_add OUT NOCOPY VARCHAR
1402   , p_party_site_ph  OUT NOCOPY VARCHAR
1403   );
1404   FUNCTION return_primary_phone
1405   (
1406 	party_id  IN number
1407   ) return varchar2 ;
1408 
1409   PROCEDURE create_achrs( x_return_status    out nocopy varchar2 );
1410   PROCEDURE CREATE_ACC_HRS( p_task_id                     IN NUMBER
1411 							            , x_return_status              OUT NOCOPY VARCHAR2
1412 							            , x_msg_count                  OUT NOCOPY NUMBER
1413 							            , x_msg_data                   OUT NOCOPY VARCHAR2);
1414 END csf_tasks_pub;