1 PACKAGE EDR_ERES_EVENT_PVT AUTHID CURRENT_USER AS
2 /* $Header: EDRVEVTS.pls 120.0.12000000.1 2007/01/18 05:56:13 appldev ship $*/
3
4 /* Global Constants */
5 G_PKG_NAME CONSTANT varchar2(30) := 'EDR_ERES_EVENT_PVT';
6
7 -- Start of comments
8 -- API name : RAISE_EVENT
9 -- Type : Private.
10 -- Function : Raise an Event and return its status and erecord id
11 -- back
12 -- Pre-reqs : None.
13 -- Parameters :
14 -- IN :p_api_version IN NUMBER Required
15 -- p_init_msg_list IN VARCHAR2 Optional
16 -- Default = FND_API.G_FALSE
17 -- p_validation_level IN NUMBER Optional
18 -- Default = FND_API.G_VALID_LEVEL_FULL
19 -- p_mode IN VARCHAR2(20) Optional
20 -- Default NULL
21 -- The mode of validation. This can have two possible
22 -- values 'STRICT' or null. This parameter is used
23 -- only if the payload contains the parameters for
24 -- interevent processing. In that case STRICT is used
25 -- in the case where PARENT_ERECORD_ID NEEDS to be
26 -- passed
27 --
28 -- p_parameter_list IN FND_WF_EVENT.PARAM_TABLE OPTIONAL
29 -- If this variable is set then the parameters set on the x_event
30 -- variable is ignored and the this list is used instead while raising the event.
31 --
32 -- OUT :x_return_status OUT VARCHAR2
33 -- x_msg_count OUT NUMBER
34 -- x_msg_data OUT VARCHAR2
35 -- x_event IN OUT ERES_EVENT_REC_TYPE
36 -- Eres event structure with event name, event key
37 -- and payload supplied by the caller. At end the
38 -- erecord id and status would be populated
39 -- Status can be: ERROR, PENDING, NOACTION
40 -- x_is_child_event OUT BOOLEAN
41 -- Set to true if this event is a child event in the
42 -- context of an inter event transaction
43 --
44 -- Version :Current version 1.0
45 -- Initial version 1.0
46 --
47 -- Notes :Can be used to raise an ERES event.
48 --
49 -- End of comments
50
51 PROCEDURE RAISE_EVENT
52 ( p_api_version IN NUMBER,
53 p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
54 p_validation_level IN NUMBER default FND_API.G_VALID_LEVEL_FULL,
55 x_return_status OUT NOCOPY VARCHAR2,
56 x_msg_count OUT NOCOPY NUMBER,
57 x_msg_data OUT NOCOPY VARCHAR2,
58 p_mode IN VARCHAR2 DEFAULT NULL,
59 x_event IN OUT NOCOPY EDR_ERES_EVENT_PUB.ERES_EVENT_REC_TYPE,
60 x_is_child_event OUT NOCOPY BOOLEAN,
61 --Bug 4122622: Start
62 p_parameter_list IN FND_WF_EVENT.PARAM_TABLE default EDR_CONSTANTS_GRP.G_EMPTY_PARAM_LIST
63 --Bug 4122622: End
64 );
65
66 /** Use to get the GUID of the subscription of a business event
67 ** returns the guid or null depending on whether the event is
68 ** valid or not
69 ** added following comments as part of bug fix 3355468
70 ** This function returns valid Subscription GUID for following cases
71 ** 1. only one ERES subscription present
72 ** 2. Only one ERES subscription is enabled when multiple
73 ** ERES subscriptions are present for the event
74 **
75 ** in all other cases it will return "Null"
76 **
77 **/
78
79 FUNCTION GET_SUBSCRIPTION_GUID
80 ( p_event_name IN VARCHAR2)
81 RETURN RAW;
82
83 PROCEDURE CREATE_PAYLOAD
84 ( p_event IN EDR_ERES_EVENT_PUB.ERES_EVENT_REC_TYPE ,
85 p_starting_position IN NUMBER DEFAULT 1 ,
86 x_payload OUT NOCOPY FND_WF_EVENT.PARAM_TABLE
87 );
88
89 -- Start of comments
90 -- API name : GET_EVENT_APPROVERS
91 -- Type : Private.
92 -- Function : Get the fnd user name and the role name (from wf directory
93 -- services) of the users who are defined as potential approvers
94 -- of the eres event in AME
95 -- Pre-reqs : None.
96 -- Parameters :
97 -- IN :p_api_version IN NUMBER Required
98 -- p_init_msg_list IN VARCHAR2 Optional
99 -- Default = FND_API.G_FALSE
100 -- p_event_name IN VARCHAR2 Required
101 -- The name of the ERES event for which we need to fetch approvers
102 -- p_event_key IN VARCHAR2 Required
103 -- The event key for the event. This would also be the transaction
104 -- ID in the AME
105 --
106 -- OUT :x_return_status OUT VARCHAR2
107 -- x_msg_count OUT NUMBER
108 -- x_msg_data OUT VARCHAR2
109 -- x_approver_count OUT NUMBER
110 -- The number of approvers, defaulted to 0.
111 -- x_approvers_name OUT FND_TABLE_OF_VARCHAR2_255
112 -- A table of varchar2 that would store the approver's fnd user name
113 -- x_approvers_role_name OUT FND_TABLE_OF_VARCHAR2_255
114 -- A table of varchar2 that would store the approver's wf role name
115 -- x_overriding_details OUT FND_TABLE_OF_VARCHAR2_255
116 -- A table of varchar2 containing the details of routing rules used
117 -- by the user currently (if any)
118 --
119 -- x_approvers_sequence OUT FND_TABLE_OF_VARCHAR2_255
120 -- A table of varchar2 that out store the approver
121 -- sequence number as returned from AME
122 --
123 -- Version :Current version 1.0
124 -- Initial version 1.0
125 --
126 -- Notes :The event should have subscription parameter EDR_AME_TRANSACTION_TYPE
127 -- defined in the BES system according to ERES Cookbook otherwise the
128 -- event name is defaulted as the ame txn name when getting approvers
129 -- from AME
130 -- End of comments
131
132 -- Bug 2674799: start
133
134 PROCEDURE GET_EVENT_APPROVERS
135 ( p_api_version IN NUMBER ,
136 p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE ,
137 x_return_status OUT NOCOPY VARCHAR2 ,
138 x_msg_count OUT NOCOPY NUMBER ,
139 x_msg_data OUT NOCOPY VARCHAR2 ,
140 p_event_name IN VARCHAR2 ,
141 p_event_key IN VARCHAR2 ,
142 x_approver_count OUT NOCOPY NUMBER ,
143 x_approvers_name OUT NOCOPY FND_TABLE_OF_VARCHAR2_255 ,
144 x_approvers_role_name OUT NOCOPY FND_TABLE_OF_VARCHAR2_255 ,
145 x_overriding_details OUT NOCOPY FND_TABLE_OF_VARCHAR2_255 ,
146 x_approvers_sequence OUT NOCOPY FND_TABLE_OF_VARCHAR2_255
147 );
148 -- Bug 2674799: end
149
150 --Bug 3667036: Start
151
152 -- Start of comments
153 -- API name : CREATE_MANAGER_PROCESS
154 -- Type : Private
155 -- Function : Insert a row into the EDR_ERESMANAGER_T table
156 --
157 -- Pre-reqs : None.
158 -- Parameters :
159 -- IN :P_RETURN_URL IN VARCHAR2 - The URL of the product teams page
160 -- :P_OVERALL_STATUS IN VARCHAR2 - The overall status of the erecords
161 -- to which this manager refers to
162 -- :P_CREATION_DATE IN DATE
163 -- :P_CREATED_BY IN NUMBER
164 -- :P_LAST_UPDATE_DATE IN DATE
165 -- :P_LAST_UPDATED_BY IN NUMBER
166 -- :P_LAST_UPDATE_LOGIN IN NUMBER ---- WHO COLUMNS
167 --
168 -- OUT :X_PROCESS_ID VARCHAR2 - The unique process ID that identifies this ERES MANAGER
169 --
170 -- Version :Current version 1.0
171 -- Initial version 1.0
172 --
173 --
174 -- End of comments
175
176 PROCEDURE CREATE_MANAGER_PROCESS(P_RETURN_URL IN VARCHAR2,
177 P_RETURN_FUNCTION IN VARCHAR2,
178 P_OVERALL_STATUS IN VARCHAR2,
179 P_CREATION_DATE IN DATE,
180 P_CREATED_BY IN NUMBER,
181 P_LAST_UPDATE_DATE IN DATE,
182 P_LAST_UPDATED_BY IN NUMBER,
183 P_LAST_UPDATE_LOGIN IN NUMBER,
184 X_ERES_PROCESS_ID OUT NOCOPY NUMBER);
185
186
187 -- Start of comments
188 -- API name : DELETE_ERECORDS
189 -- Type : Private.
190 -- Function : DELETE the rows from EDR_ERESMANAGER_T and EDR_PROCESS_ERECORDS_T
191 -- for the given eres_process_id or if the process_id is not provided
192 -- delete all the e-records which are x days old. x is based on the profile
193 -- option EDR_TEMP_DATA_LIFE
194 --
195 -- Pre-reqs : None.
196 -- Parameters :
197 -- IN : P_ERES_PROCESSID VARCHAR2 IN - The process_id of the eres manager
198 -- and erecords to be delete.
199 --
200 -- OUT : NONE
201 --
202 -- Version : Current version 1.0
203 -- Initial version 1.0
204 --
205 -- Notes :If p_eres_process_id is null then a profile value indicating
206 -- the maximum age of a temporary erecord viz. EDR_TEMP_DATA_LIFE is read.
207 -- All those rows whose age are this value are deleted.
208 -- End of comments
209
210 PROCEDURE DELETE_ERECORDS(P_ERES_PROCESS_ID IN NUMBER DEFAULT NULL);
211 --Bug 3667036: End
212
213
214
215 --Bug 3207385: Start
216 PROCEDURE RAISE_TABLE (P_EVENT_NAME IN VARCHAR2,
217 P_EVENT_KEY IN VARCHAR2,
218 P_EVENT_DATA IN CLOB DEFAULT NULL,
219 P_PARAM_TABLE IN OUT NOCOPY FND_WF_EVENT.PARAM_TABLE,
220 P_NUMBER_PARAMS IN NUMBER,
221 P_SEND_DATE IN DATE DEFAULT NULL);
222 --Bug 3207385: End
223
224
225 --Bug 4122622: Start
226 -- Start of comments
227 -- API name : GET_EVENT_DETAILS
228 -- Type : Private.
229 -- Function : Returns the event name and event key for the specified e-record ID.
230 --
231 -- Pre-reqs : None.
232 -- Parameters :
233 -- IN : P_ERECORD_ID NUMBER IN - The e-record ID of the e-record whose event details
234 -- are to be fetched.
235 --
236 -- OUT : X_EVENT_NAME VARCHAR2 OUT - The corresponding event name.
237 -- X_EVENT_KEY VARCHAR2 OUT - The corresponding event key.
238 --
239 -- Version : Current version 1.0
240 -- Initial version 1.0
241 --
242 -- End of comments
243
244 PROCEDURE GET_EVENT_DETAILS(P_ERECORD_ID IN NUMBER,
245 X_EVENT_NAME OUT NOCOPY VARCHAR2,
246 X_EVENT_KEY OUT NOCOPY VARCHAR2);
247 --Bug 4122622: End
248
249 end EDR_ERES_EVENT_PVT;