DBA Data[Home] [Help]

PACKAGE: APPS.CSF_ALERTS_PUB

Source


1 PACKAGE csf_alerts_pub AUTHID CURRENT_USER AS
2 /*$Header: csfAlerts.pls 120.5 2011/01/05 12:51:15 cmgandhi ship $*/
3 
4 -- to store task detail for notification content
5 type task_asgn_record is record
6 (
7   task_number     jtf_tasks_b.task_number%type,
8   task_name       jtf_tasks_vl.task_name%type,
9   task_desc       jtf_tasks_vl.description%type,
10   sch_st_date     jtf_tasks_b.scheduled_start_date%type,
11   old_sch_st_date     jtf_tasks_b.scheduled_start_date%type,
12   sch_end_date    jtf_tasks_b.scheduled_end_date%type,
13   old_sch_end_date    jtf_tasks_b.scheduled_end_date%type,
14   planned_effort  varchar2(100),
15   priority        jtf_task_priorities_vl.name%type,
16   asgm_sts_name   jtf_task_statuses_vl.name%type,
17   sr_number       cs_incidents_all_b.incident_number%type,
18   sr_summary      cs_incidents_all_tl.summary%type,
19   product_nr      mtl_system_items_vl.concatenated_segments%type,
20   item_serial     cs_customer_products_all.current_serial_number%type,
21   item_description  mtl_system_items_vl.description%type,
22   cust_name       hz_parties.party_name%type,
23   cust_address    varchar2(1000),
24   contact_name    varchar2(100),
25   contact_phone   varchar2(100),
26   contact_email   varchar2(250)
27 );
28 
29 -- to store contact details for notification content
30 type contact_record is record
31 (
32   contact_name    varchar2(100),
33   contact_phone   varchar2(100),
34   contact_email   varchar2(250)
35 );
36 
37 -- procedure to check event type
38 procedure checkEvent (itemtype in varchar2,
39                         itemkey in varchar2,
40                         actid in number,
41                         funcmode in varchar2,
42                         resultout out nocopy varchar2);
43 
44 -- procedure to check task precondition
45 -- before generating reminder notification
46 procedure check_again (itemtype in varchar2,
47                         itemkey in varchar2,
48                         actid in number,
49                         funcmode in varchar2,
50                         resultout out nocopy varchar2);
51 
52 -- check CSF: Alert Auto Reject profile is set or not
53 procedure check_auto_reject (itemtype in varchar2,
54                         itemkey in varchar2,
55                         actid in number,
56                         funcmode in varchar2,
57                         resultout out nocopy varchar2);
58 
59 -- Procedure to change task assignment status to default Accepted profile
60 procedure accept_assgn (itemtype in varchar2,
61                         itemkey in varchar2,
62                         actid in number,
63                         funcmode in varchar2,
64                         resultout out nocopy varchar2);
65 
66 -- Procedure to change task assignment status to default Rejected profile
67 procedure cancel_assgn (itemtype in varchar2,
68                         itemkey in varchar2,
69                         actid in number,
70                         funcmode in varchar2,
71                         resultout out nocopy varchar2);
72 
73 -- subscription function for oracle.apps.csf.alerts.sendNotification event
74 function sendNotification (p_subscription_guid in raw,
75                            p_event in out nocopy WF_EVENT_T) return varchar2;
76 
77 -- generates Send Date for CSF event based on profile values
78 function getSendDate (p_resource_id number,
79                       p_resource_type_code varchar2,
80                       p_scheduled_start_date date,
81                       p_scheduled_end_date date) return date;
82 
83 -- Returns user_id for a given ersource
84 function getUserId (p_resource_id number,
85                     p_resource_type varchar2) return number;
86 
87 -- Returns user_name for a given resource
88 function getUserName (p_resource_id number,
89                     p_resource_type varchar2) return varchar2;
90 
91 -- Returns Category type for resource type
92 function category_type ( p_rs_category varchar2 ) return varchar2;
93 
94 -- Generated item_key for workflow
95 function getItemKey (p_event_type varchar2,
96                     p_resource_id number,
97                     p_resource_type_code varchar2,
98                     p_task_assignment_id varchar2,
99                     p_old_event_id varchar2) return varchar2;
100 
101 -- Check profile for a given resource
102 function checkAlertsEnabled(p_resource_id number,
103                               p_resource_type_code varchar2) return boolean;
104 
105 -- Generates Assigned notification content
106 procedure getAssignedMessage(document_id varchar2,
107                             display_type varchar2,
108                             document in out nocopy varchar2,
109                             document_type in out nocopy varchar2);
110 
111 -- Generates Reminder notification content
112 procedure getReminderMessage(document_id varchar2,
113                             display_type varchar2,
114                             document in out nocopy varchar2,
115                             document_type in out nocopy varchar2);
116 
117 -- Generates Cancelled notification content
118 procedure getDeleteMessage(document_id varchar2,
119                             display_type varchar2,
120                             document in out nocopy varchar2,
121                             document_type in out nocopy varchar2);
122 
123 -- Generates Rescheduled notification content
124 procedure getRescheduleMessage(document_id varchar2,
125                             display_type varchar2,
126                             document in out nocopy varchar2,
127                             document_type in out nocopy varchar2);
128 
129 -- Returns contact details for SR
130 function getContactDetail(p_incident_id number,
131                             p_contact_type varchar2,
132                             p_party_id number) return contact_record;
133 
134 -- Returns all the required task details to generate notification content
135 function getTaskDetails(p_task_id number,
136                             p_task_asgn_id number,
137                             p_task_audit_id number) return task_asgn_record;
138 
139 -- Subscription function for task assignemnt events
140 function checkForAlerts (p_subscription_guid in raw,
141                            p_event in out nocopy WF_EVENT_T) return varchar2;
142 
143 -- Returns date in client timezone
144 function getClientTime (p_server_time date, p_user_id number) return date;
145 
146 -- Returns translated prompt
147 function getPrompt (p_name varchar2) return varchar2;
148 
149 -- Returns WF ROLE NAME
150 function getWFRole (p_resource_id number) return varchar2;
151 
152 END csf_alerts_pub;