DBA Data[Home] [Help]

PACKAGE: APPS.AMS_SCHEDULERULES_PVT

Source


1 PACKAGE AMS_ScheduleRules_PVT AS
2 /* $Header: amsvsbrs.pls 120.5 2006/03/08 01:34:16 anchaudh ship $ */
3 
4 --========================================================================
5 -- PROCEDURE
6 --    Handle_Status
7 -- Purpose
8 --    Created to get the system status code for the user status id
9 -- HISTORY
10 --    19-Jan-2000   ptendulk    Created.
11 --
12 --========================================================================
13 PROCEDURE Handle_Status(
14    p_user_status_id    IN     NUMBER,
15    p_sys_status_code   IN     VARCHAR2,
16    x_status_code       OUT NOCOPY    VARCHAR2,
17    x_return_status     OUT NOCOPY    VARCHAR2
18 ) ;
19 
20 --========================================================================
21 -- PROCEDURE
22 --    Handle_Schedule_Source_Code
23 -- Purpose
24 --    Created to get the source code for the schedules.
25 -- HISTORY
26 --    30-Jan-2000   ptendulk    Created.
27 --
28 --========================================================================
29 PROCEDURE Handle_Schedule_Source_Code(
30    p_source_code    IN  VARCHAR2,
31    p_camp_id        IN  NUMBER,
32    p_setup_id       IN  NUMBER,
33    p_cascade_flag   IN  VARCHAR2,
34    x_source_code    OUT NOCOPY VARCHAR2,
35    x_return_status  OUT NOCOPY VARCHAR2
36 ) ;
37 
38 --========================================================================
39 -- PROCEDURE
40 --    Push_Source_Code
41 -- Purpose
42 --    Created to push the source code for the schedule
43 --    after the schedule is created.
44 --
45 -- HISTORY
46 --    19-Jan-2000   ptendulk    Created.
47 --
48 --========================================================================
49 PROCEDURE Push_Source_Code(
50            p_source_code    IN  VARCHAR2,
51            p_arc_object     IN  VARCHAR2,
52            p_object_id      IN  NUMBER,
53            p_related_source_code    IN    VARCHAR2 := NULL,
54            p_related_source_object  IN    VARCHAR2 := NULL,
55            p_related_source_id      IN    NUMBER   := NULL
56 ) ;
57 
58 --========================================================================
59 -- PROCEDURE
60 --    Check_Source_Code
61 --
62 -- Purpose
63 --    Created to check the source code for the schedule before updation
64 --
65 -- HISTORY
66 --    19-Jan-2000   ptendulk    Created.
67 --    13-dec-2001   soagrawa    added parameter x_source_code
68 --========================================================================
69 PROCEDURE Check_Source_Code(
70    p_schedule_rec   IN  AMS_Camp_Schedule_PVT.schedule_rec_type,
71    x_return_status  OUT NOCOPY VARCHAR2,
72    x_source_code    OUT NOCOPY VARCHAR2
73 ) ;
74 
75 --========================================================================
76 -- PROCEDURE
77 --    Check_Sched_Dates_Vs_Camp
78 --
79 -- Purpose
80 --    Created to check if the schedules start and end date are within
81 --    campaigns start date and end date.
82 --
83 -- HISTORY
84 --    02-Feb-2001   ptendulk    Created.
85 
86 --========================================================================
87 PROCEDURE Check_Sched_Dates_Vs_Camp(
88    p_campaign_id    IN  NUMBER,
89    p_start_date     IN  DATE,
90    p_end_date       IN  DATE,
91    x_return_status  OUT NOCOPY VARCHAR2
92 ) ;
93 
94 --========================================================================
95 -- PROCEDURE
96 --    Check_Schedule_Update
97 --
98 -- Purpose
99 --    Created to check if the user can update the schedule details
100 --    It also checks for the locked columns and if user tries to update
101 --    API will be errored out.
102 --
103 -- HISTORY
104 --    13-Feb-2001   ptendulk    Created.
105 
106 --========================================================================
107 PROCEDURE Check_Schedule_Update(
108    p_schedule_rec    IN   AMS_Camp_Schedule_PVT.schedule_rec_type,
109    x_return_status   OUT NOCOPY  VARCHAR2
110 ) ;
111 
112 --========================================================================
113 -- PROCEDURE
114 --    Check_Schedule_Activity
115 --
116 -- PURPOSE
117 --    This api is created to validate the activity type , activity
118 --    and marketing medium attached to the schedule.
119 --
120 -- HISTORY
121 --  13-Feb-2001    ptendulk    Created.
122 --
123 --========================================================================
124 PROCEDURE Check_Schedule_Activity(
125    p_schedule_id       IN  NUMBER,
126    p_activity_type     IN  VARCHAR2,
127    p_activity_id       IN  NUMBER,
128    p_medium_id         IN  NUMBER,
129    p_arc_channel_from  IN  VARCHAR2,
130    p_status_code       IN  VARCHAR2,
131    x_return_status     OUT NOCOPY VARCHAR2
132 ) ;
133 
134 --========================================================================
135 -- PROCEDURE
136 --    Activate_Schedule
137 --
138 -- PURPOSE
139 --    This api is created to be used by concurrent program to activate
140 --    schedules. It will internally call the Activate schedules api to
141 --    activate the schedule.
142 
143 --
144 -- HISTORY
145 --  17-Mar-2001    ptendulk    Created.
146 --
147 --========================================================================
148 PROCEDURE Activate_Schedule
149                (errbuf            OUT NOCOPY    VARCHAR2,
150                 retcode           OUT NOCOPY    NUMBER) ;
151 
152 --========================================================================
153 -- PROCEDURE
154 --    Update_Schedule_Status
155 --
156 -- PURPOSE
157 --    This api is created to be used for schedule status changes.
158 --
159 -- HISTORY
160 --  28-Mar-2001    ptendulk    Created.
161 --
162 --========================================================================
163 PROCEDURE Update_Schedule_Status(
164    p_schedule_id      IN  NUMBER,
165    p_campaign_id      IN  NUMBER,
166    p_user_status_id   IN  NUMBER,
167    p_budget_amount    IN  NUMBER,
168    p_asn_group_id     IN  VARCHAR2 DEFAULT NULL -- anchaudh added for leads bug.
169 );
170 
171 --========================================================================
172 -- PROCEDURE
173 --    Create_list
174 --
175 -- PURPOSE
176 --    This api is called after the creation of the Direct marketing schedules
177 --    to create the default target group for the schedule. User can go to the
178 --    target group screen to modify the details.
179 --
180 -- NOTE
181 --    The list of Type Target is created in list header and the association is
182 --    created in the ams_act_lists table.
183 --
184 -- HISTORY
185 --  18-May-2001    ptendulk    Created.
186 --
187 --========================================================================
188 PROCEDURE Create_list
189                (p_schedule_id     IN     NUMBER,
190                 p_schedule_name   IN     VARCHAR2,
191                 p_owner_id        IN     NUMBER) ;
192 
193 
194 --========================================================================
195 -- PROCEDURE
196 --    Create_Schedule_Access
197 --
198 -- PURPOSE
199 --    This api is called in Create schedule api to give the access for
200 --    schedule to the team members of the campaign.
201 --
202 -- NOTE
203 --
204 -- HISTORY
205 --  11-Sep-2001    ptendulk    Created.
206 --
207 --========================================================================
208 PROCEDURE Create_Schedule_Access(p_schedule_id        IN NUMBER,
209                                  p_campaign_id        IN NUMBER,
210                                  p_owner_id           IN NUMBER,
211                                  p_init_msg_list      IN VARCHAR2,
212                                  p_commit             IN VARCHAR2,
213                                  p_validation_level   IN NUMBER,
214 
215                                  x_return_status     OUT NOCOPY VARCHAR2,
216                                  x_msg_count         OUT NOCOPY NUMBER,
217                                  x_msg_data          OUT NOCOPY VARCHAR2
218                                  );
219 
220 
221 --========================================================================
222 -- PROCEDURE
223 --    update_status
224 --
225 -- NOTE
226 --
227 -- HISTORY
228 --  02-oct-2001    soagrawa    Created.
229 --
230 --========================================================================
231 
232 PROCEDURE update_status(         p_schedule_id             IN NUMBER,
233                                  p_new_status_id           IN NUMBER,
234                                  p_new_status_code         IN VARCHAR2,
235 				 p_asn_group_id            IN VARCHAR2 DEFAULT NULL -- anchaudh added for leads bug.
236                                  );
237 
238 --========================================================================
239 -- PROCEDURE
240 --    target_group_exist
241 --
242 -- NOTE
243 --
244 -- HISTORY
245 --  31-jan-2002    soagrawa    Modified signature and added to specs
246 --
247 --========================================================================
248 
249 FUNCTION Target_Group_Exist (p_schedule_id IN NUMBER
250                              , p_obj_type IN VARCHAR2 :='CSCH')
251 RETURN VARCHAR2;
252 
253 
254 --========================================================================
255 -- PROCEDURE
256 --    write_interaction
257 --
258 -- NOTE
259 --
260 -- HISTORY
261 --  12-mar-2002    soagrawa    Created.
262 --
263 --========================================================================
264 
265 PROCEDURE write_interaction(
266                p_schedule_id               IN     NUMBER
267                );
268 
269 
270 
271 --=====================================================================
272 -- PROCEDURE
273 --    Update_Schedule_Owner
274 --
275 -- PURPOSE
276 --    The api is created to update the owner of the schedule from the
277 --    access table if the owner is changed in update.
278 --
279 -- HISTORY
280 --    06-Jun-2002  soagrawa    Created. Refer to bug# 2406677
281 --=====================================================================
282 PROCEDURE Update_Schedule_Owner(
283    p_api_version       IN  NUMBER,
284    p_init_msg_list     IN  VARCHAR2  := FND_API.g_false,
285    p_commit            IN  VARCHAR2  := FND_API.g_false,
286    p_validation_level  IN  NUMBER    := FND_API.g_valid_level_full,
287    x_return_status     OUT NOCOPY VARCHAR2,
288    x_msg_count         OUT NOCOPY NUMBER,
289    x_msg_data          OUT NOCOPY VARCHAR2,
290    p_object_type       IN  VARCHAR2 := NULL ,
291    p_schedule_id       IN  NUMBER,
292    p_owner_id          IN  NUMBER   );
293 
294 
295 --=====================================================================
296 -- PROCEDURE
297 --    Init_Schedule_val
298 --
299 -- PURPOSE
300 --    This api will be used by schedule execution workflow to initialize the schedule
301 --    parameter values.
302 --
303 -- HISTORY
304 --    23-Aug-2003  ptendulk       Created.
305 --    19-Sep-2003  dbiswas        Added nocopy
306 --=====================================================================
307 PROCEDURE Init_Schedule_val(itemtype    IN     VARCHAR2,
308                             itemkey     IN     VARCHAR2,
309                             actid       IN     NUMBER,
310                             funcmode    IN     VARCHAR2,
311                             result      OUT NOCOPY    VARCHAR2);
312 
313 --=====================================================================
314 -- PROCEDURE
315 --    Check_Schedule_Status
316 --
317 -- PURPOSE
318 --    This api will be used by schedule execution workflow to check schedule status
319 --    The schedule can be in available or active status. if the schedule is available
320 --    workflow will update the status to active.
321 --
322 -- HISTORY
323 --    23-Aug-2003  ptendulk       Created.
324 --    19-Sep-2003  dbiswas        Added nocopy
325 --=====================================================================
326 PROCEDURE Check_Schedule_Status(itemtype    IN     VARCHAR2,
327                                 itemkey     IN     VARCHAR2,
328                                 actid       IN     NUMBER,
329                                 funcmode    IN     VARCHAR2,
330                                 result      OUT NOCOPY    VARCHAR2);
331 
332 --=====================================================================
333 -- PROCEDURE
334 --    Update_Schedule_Status
335 --
336 -- PURPOSE
337 --    This api will be used by schedule execution workflow to update schedule status
338 --    It will update the schedule status to Active.
339 --
340 -- HISTORY
341 --    23-Aug-2003  ptendulk       Created.
342 --    19-Sep-2003  dbiswas        Added nocopy
343 --=====================================================================
344 PROCEDURE Update_Schedule_Status(itemtype    IN     VARCHAR2,
345                                 itemkey     IN     VARCHAR2,
346                                 actid       IN     NUMBER,
347                                 funcmode    IN     VARCHAR2,
348                                 result      OUT  NOCOPY   VARCHAR2);
349 
350 --=====================================================================
351 -- PROCEDURE
352 --    Check_Schedule_Act_Type
353 --
354 -- PURPOSE
355 --    This api will be used by schedule execution workflow to check schedule activity
356 --    Based on the activity type different apis will be called.
357 --
358 -- HISTORY
359 --    23-Aug-2003  ptendulk       Created.
360 --    19-Sep-2003  dbiswas        Added nocopy
361 --=====================================================================
365                                 funcmode    IN     VARCHAR2,
362 PROCEDURE Check_Schedule_Act_Type(itemtype    IN     VARCHAR2,
363                                 itemkey     IN     VARCHAR2,
364                                 actid       IN     NUMBER,
366                                 result      OUT NOCOPY    VARCHAR2) ;
367 
368 --=====================================================================
369 -- PROCEDURE
370 --    Execute_Direct_Marketing
371 --
372 -- PURPOSE
373 --    This api will be used by schedule execution workflow to execute schedule
374 --    of type Direct Marketing
375 --
376 -- HISTORY
377 --    23-Aug-2003  ptendulk       Created.
378 --    19-Sep-2003  dbiswas        Added nocopy
379 --=====================================================================
380 PROCEDURE Execute_Direct_Marketing(itemtype  IN     VARCHAR2,
381                                 itemkey      IN     VARCHAR2,
382                                 actid        IN     NUMBER,
383                                 funcmode     IN     VARCHAR2,
384                                 result       OUT NOCOPY    VARCHAR2) ;
385 
386 --=====================================================================
387 -- PROCEDURE
388 --    Execute_Sales
389 --
390 -- PURPOSE
391 --    This api will be used by schedule execution workflow to execute schedule
392 --    of type Sales
393 --
394 -- HISTORY
395 --    23-Aug-2003  ptendulk       Created.
396 --    19-Sep-2003  dbiswas        Added nocopy
397 --=====================================================================
398 PROCEDURE Execute_Sales(itemtype     IN     VARCHAR2,
399                         itemkey      IN     VARCHAR2,
400                         actid        IN     NUMBER,
401                         funcmode     IN     VARCHAR2,
402                         result       OUT NOCOPY    VARCHAR2) ;
403 
404 
405 --=====================================================================
406 -- PROCEDURE
407 --    generate_leads
408 --
409 -- PURPOSE
410 --    This api will be used by schedule execution workflow generate leads.
411 --
412 -- HISTORY
413 --    08-Sep-2003  asaha       Created.
414 --=====================================================================
415 PROCEDURE generate_leads(
416    p_obj_id  IN NUMBER,
417    p_obj_type  IN VARCHAR2,
418    x_return_status OUT NOCOPY VARCHAR2,
419    itemtype     IN     VARCHAR2,--anchaudh changed the signature of this api for the leads bug.
420    itemkey      IN     VARCHAR2);--anchaudh changed the signature of this api for the leads bug.
421 
422 --=====================================================================
423 -- PROCEDURE
424 --    Check_WF_Error
425 --
426 -- PURPOSE
427 --    This api will be used by schedule execution workflow to check error
428 --    The api will check the error flag and based on the value, the error
429 --    notifications will be sent to schedule owner.
430 --
431 -- HISTORY
432 --    23-Aug-2003  ptendulk       Created.
433 --    19-Sep-2003  dbiswas        Added nocopy
434 --=====================================================================
435 PROCEDURE Check_WF_Error(itemtype    IN     VARCHAR2,
436                          itemkey     IN     VARCHAR2,
437                          actid       IN     NUMBER,
438                          funcmode    IN     VARCHAR2,
439                          result      OUT NOCOPY   VARCHAR2);
440 
441 
442 --=====================================================================
443 -- Procedure
444 --    WF_REPEAT_INIT_VAR
445 --
446 -- PURPOSE
447 --    This api is used by scheduler workflow to initialize the attributes
448 --    Returns the processId information in the schedules table
449 --
450 -- HISTORY
451 --    07-Oct-2003  dbiswas       Created.
452 --=====================================================================
453 PROCEDURE Wf_Repeat_Init_var(itemtype    IN     VARCHAR2,
454                                    itemkey     IN     VARCHAR2,
455                                    actid       IN     NUMBER,
456                                    funcmode    IN     VARCHAR2,
457                                    result      OUT NOCOPY   VARCHAR2);
458 
459 --=====================================================================
460 -- Procedure
461 --    WF_REPEAT_CHECK_EXECUTE
462 --
463 -- PURPOSE
464 --    This api is used by scheduler workflow to check if the schedule
465 --    should execute or not based on status and dates
466 --
467 -- HISTORY
468 --    07-Oct-2003  dbiswas       Created.
469 --=====================================================================
470 PROCEDURE Wf_Repeat_Check_Execute(itemtype    IN     VARCHAR2,
471                                    itemkey     IN     VARCHAR2,
472                                    actid       IN     NUMBER,
473                                    funcmode    IN     VARCHAR2,
474                                    result      OUT NOCOPY   VARCHAR2);
475 
476 --=====================================================================
477 -- Procedure
478 --    WF_REPEAT_SCHEDULER
479 --
480 -- PURPOSE
481 --    This api is used by scheduler workflow to check when the next schedule run should be
482 --
483 -- HISTORY
484 --    07-Oct-2003  dbiswas       Created.
488                                    actid       IN     NUMBER,
485 --=====================================================================
486 PROCEDURE Wf_Repeat_Scheduler(itemtype    IN     VARCHAR2,
487                                    itemkey     IN     VARCHAR2,
489                                    funcmode    IN     VARCHAR2,
490                                    result      OUT NOCOPY   VARCHAR2);
491 
492 --=====================================================================
493 -- Procedure
494 --    WF_REPEAT_CHECK_CREATE_CSCH
495 --
496 -- PURPOSE
497 --    This api is used by scheduler workflow to check whether to create the next child schedule
498 --    based on schedule date boundaries. (campaign end date in case parent's end date is null
499 --
500 -- HISTORY
501 --    07-Oct-2003  dbiswas       Created.
502 --=====================================================================
503 PROCEDURE WF_REPEAT_CHECK_CREATE_CSCH(itemtype    IN     VARCHAR2,
504                                    itemkey     IN     VARCHAR2,
505                                    actid       IN     NUMBER,
506                                    funcmode    IN     VARCHAR2,
507                                    result      OUT NOCOPY   VARCHAR2);
508 
509 --=====================================================================
510 -- Procedure
511 --    WF_REPEAT_CREATE_CSCH
512 --
513 -- PURPOSE
514 --    This api is used by scheduler workflow to create the next child schedule
515 --
516 -- HISTORY
517 --    11-Oct-2003  dbiswas       Created.
518 --=====================================================================
519 PROCEDURE WF_REPEAT_CREATE_CSCH(itemtype    IN     VARCHAR2,
520                                    itemkey     IN     VARCHAR2,
521                                    actid       IN     NUMBER,
522                                    funcmode    IN     VARCHAR2,
523                                    result      OUT NOCOPY   VARCHAR2);
524 
525 --=====================================================================
526 -- Procedure
527 --    WF_REPEAT_RAISE_EVENT
528 --
529 -- PURPOSE
530 --    This api is used by scheduler workflow to raise the event for the next sched run
531 --
532 -- HISTORY
533 --    11-Oct-2003  dbiswas       Created.
534 --=====================================================================
535 
536    PROCEDURE WF_REPEAT_RAISE_EVENT(itemtype    IN     VARCHAR2,
537                                    itemkey     IN     VARCHAR2,
538                                    actid       IN     NUMBER,
539                                    funcmode    IN     VARCHAR2,
540                                    result      OUT NOCOPY    VARCHAR2);
541 
542 --========================================================================
543 -- PROCEDURE
544 --    WRITE_LOG
545 -- Purpose
546 --   This method will be used to write logs for this api
547 -- HISTORY
548 --    10-Oct-2000   dbiswas    Created.
549 --
550 --========================================================================
551 PROCEDURE WRITE_LOG             ( p_api_name      IN VARCHAR2 := NULL,
552                                   p_log_message   IN VARCHAR2  := NULL);
553 
554 
555 --========================================================================
556 -- PROCEDURE
557 --    AMS_SELECTOR
558 -- Purpose
559 --   This method will be used as callback API for Workflow
560 -- HISTORY
561 --    09-Apr-2004   asaha    Created.
562 --
563 --========================================================================
564 /* Commented for sql rep 14423973. Bug 4956974
565 PROCEDURE AMS_SELECTOR
566 ( p_itemtype in varchar2
567 , p_itemkey in varchar2
568 , p_actid in number
569 , p_funcmode in varchar2
570 , p_result in OUT NOCOPY varchar2) ;
571 */
572 
573 --========================================================================
574 -- PROCEDURE
575 --    RAISE_BE_ON_STATUS_CHANGE
576 -- Purpose
577 --   This method will be used to raise business event on UserStatus change
578 -- HISTORY
579 --    17-Mar-2005   spendem    Created for enh # 3805347
580 --
581 --========================================================================
582 
583 PROCEDURE RAISE_BE_ON_STATUS_CHANGE(p_obj_id           IN     NUMBER,
584                                     p_obj_type         IN     VARCHAR2,
585                                     p_old_status_code  IN     VARCHAR2,
586                                     p_new_status_code  IN     VARCHAR2);
587 
588 
589 
590 
591 --========================================================================
592 -- PROCEDURE
593 --    validate_activation_rules
594 -- Purpose
595 --    Created to validate the activation rules going forward in R12
596 -- HISTORY
597 --    27-Jul-2005   anchaudh    Created.
598 --
599 --========================================================================
600 PROCEDURE validate_activation_rules(
601    p_scheduleid    IN     NUMBER,
602    x_status_code   OUT NOCOPY    VARCHAR2
603 );
604 
605 
606 
607 --=================================================================================
608 -- PROCEDURE
609 --    collateral_activation_rule
610 -- Purpose
611 --    Created to validate the collateral content status before activity activation
612 -- HISTORY
613 --    27-Jul-2005   anchaudh    Created.
614 --
615 --=================================================================================
616 PROCEDURE collateral_activation_rule(
617    p_scheduleid    IN     NUMBER,
618    x_status_code   OUT NOCOPY    VARCHAR2,
619    x_msg_count     OUT NOCOPY    NUMBER,
620    x_msg_data      OUT NOCOPY    VARCHAR2
621 );
622 
623 -------------------------------------------------------------
624 -- Start of Comments
625 -- Name
626 -- HANDLE_COLLATERAL
627 --
628 -- Purpose
629 -- This function is called from Business Event
630 -------------------------------------------------------------
631 FUNCTION HANDLE_COLLATERAL(p_subscription_guid   IN       RAW,
632                                     p_event               IN OUT NOCOPY  WF_EVENT_T
633 ) RETURN VARCHAR2;
634 
635 --========================================================================
636 -- PROCEDURE
637 --    CHECK_NOTIFICATION_PREFERENCE
638 -- Purpose
639 --   This method will be used to check the notification preference for an activity
640 -- HISTORY
641 --    08-Aug-2005   srivikri    Created
642 --
643 --========================================================================
644 
645 PROCEDURE CHECK_NOTIFICATION_PREFERENCE(itemtype    IN     VARCHAR2,
646                                 itemkey     IN     VARCHAR2,
647                                 actid       IN     NUMBER,
648                                 funcmode    IN     VARCHAR2,
649                                 result      OUT NOCOPY    VARCHAR2);
650 
651 
652 END AMS_ScheduleRules_PVT ;