DBA Data[Home] [Help]

PACKAGE: APPS.FUN_WF_COMMON

Source


1 PACKAGE FUN_WF_COMMON AUTHID CURRENT_USER AS
2 /* $Header: FUN_WF_COMMON_S.pls 120.7 2011/08/12 07:54:01 srampure ship $ */
3 
4 
5 /*-----------------------------------------------------
6  * FUNCTION generate_event_key
7  * ----------------------------------------------------
8  * Get the attributes for the recipient WF.
9  * ---------------------------------------------------*/
10 
11 FUNCTION generate_event_key (
12     batch_id IN number,
13     trx_id IN number) RETURN varchar2;
14 
15 
16 /*-----------------------------------------------------
17  * FUNCTION concat_msg_stack
18  * ----------------------------------------------------
19 y * Pop <p_depth> messages off the fnd_message stack and
20  * concat them, separated by '\n'.
21  *
22  * If there are not enough messages in the stack, then
23  * all the messages are popped.
24  *
25  * Returns null when there are no messages.
26  * Delete the returned messages iff p_flush.
27  * ---------------------------------------------------*/
28 
29 FUNCTION concat_msg_stack (
30     p_depth IN number,
31     p_flush IN boolean DEFAULT TRUE) RETURN varchar2;
32 
33 
34 /*-----------------------------------------------------
35  * PROCEDURE get_contact_role
36  * ----------------------------------------------------
37  * Get the contact for this party into an item attr
38  * called CONTACT.
39  * It assumes there is an item attr called PARTY_ID.
40  * ---------------------------------------------------*/
41 
42 FUNCTION get_contact_role (p_party_id IN number) RETURN varchar2;
43 
44 
45 /*-----------------------------------------------------
46  * PROCEDURE is_arap_batch_mode
47  * ----------------------------------------------------
48  * Check whether AR/AP transfer is in batch mode.
49  * ---------------------------------------------------*/
50 
51 PROCEDURE is_arap_batch_mode (
52     itemtype    IN varchar2,
53     itemkey     IN varchar2,
54     actid       IN number,
55     funcmode    IN varchar2,
56     resultout   IN OUT NOCOPY varchar2);
57 
58 
59 /*-----------------------------------------------------
60  * PROCEDURE raise_complete
61  * ----------------------------------------------------
62  * Raise the complete event.
63  * ---------------------------------------------------*/
64 
65 PROCEDURE raise_complete (
66     itemtype    IN varchar2,
67     itemkey     IN varchar2,
68     actid       IN number,
69     funcmode    IN varchar2,
70     resultout   IN OUT NOCOPY varchar2);
71 
72 
73 /*-----------------------------------------------------
74  * PROCEDURE update_status_error
75  * ----------------------------------------------------
76  * Update status to error.
77  * ---------------------------------------------------*/
78 
79 PROCEDURE update_status_error (
80     itemtype    IN varchar2,
81     itemkey     IN varchar2,
82     actid       IN number,
83     funcmode    IN varchar2,
84     resultout   IN OUT NOCOPY varchar2);
85 
86 
87 /*-----------------------------------------------------
88  * PROCEDURE update_status_received
89  * ----------------------------------------------------
90  * Update status to received.
91  * ---------------------------------------------------*/
92 
93 PROCEDURE update_status_received (
94     itemtype    IN varchar2,
95     itemkey     IN varchar2,
96     actid       IN number,
97     funcmode    IN varchar2,
98     resultout   IN OUT NOCOPY varchar2);
99 
100 
101 /*-----------------------------------------------------
102  * PROCEDURE update_status_complete
103  * ----------------------------------------------------
104  * Update status to complete.
105  * ---------------------------------------------------*/
106 
107 PROCEDURE update_status_complete (
108     itemtype    IN varchar2,
109     itemkey     IN varchar2,
110     actid       IN number,
111     funcmode    IN varchar2,
112     resultout   IN OUT NOCOPY varchar2);
113 
114 
115 /*-----------------------------------------------------
116  * PROCEDURE raise_wf_bus_event
117  * ----------------------------------------------------
118  * Raise workflow business event
119  * ---------------------------------------------------*/
120 
121 PROCEDURE raise_wf_bus_event (
122     batch_id   IN number,
123     trx_id     IN number default null,
124     event_key  IN varchar2 default null,
125     event_name IN varchar2 default null);
126 
127 /* Start of changes for AME Uptake, 3671923. 07 Jun 2004 */
128 
129 /* ---------------------------------------------------------------------------
130 Name      : get_ame_contacts
131 Pre-reqs  : None.
132 Modifies  : None.
133 Function  : This function is called by the various intercompany workflows
134             to get the contact list to whom FYI notifications need to be
135             sent out.
136 Parameters:
137     IN    : itemtype  - Workflow Item Type
138             itemkey   - Workflow Item Key
139             actid     - Workflow Activity Id
140             funcmode  - Workflow Function Mode
141     OUT   : resultout - Result of the workflow function
142 Notes     : None.
143 Testing   : This function will be tested via workflows FUNARINT, FUNAPINT,
144             FUNGLINT, FUNRTVAL, FUNIMAIN
145 ------------------------------------------------------------------------------*/
146 PROCEDURE get_ame_contacts (itemtype   IN VARCHAR2,
147                             itemkey    IN VARCHAR2,
148                             actid      IN NUMBER,
149                             funcmode   IN VARCHAR2,
150                             resultout  OUT NOCOPY VARCHAR2 );
151 
152 /* Bug:11722204-----------------------------------------------------------------
153 Name      : get_ame_admin
154 Pre-reqs  : None.
155 Modifies  : None.
156 Function  : This function is called by FUNRMAIN to get the workflow admin
157             to whom FYI notifications need to be sent out.
158 Parameters:
159     IN    : itemtype  - Workflow Item Type
160             itemkey   - Workflow Item Key
161             actid     - Workflow Activity Id
162             funcmode  - Workflow Function Mode
163     OUT   : resultout - Result of the workflow function
164             'Y' indicates contacts were found, 'N' indicates no contacts
165 Notes     : None.
166 Testing   : This function will be tested via workflows FUNRMAIN
167 ------------------------------------------------------------------------------*/
168 PROCEDURE get_ame_admin (itemtype   IN VARCHAR2,
169                             itemkey    IN VARCHAR2,
170                             actid      IN NUMBER,
171                             funcmode   IN VARCHAR2,
172                             resultout  OUT NOCOPY VARCHAR2 );
173 
174 /* ---------------------------------------------------------------------------
175 Name      : get_ame_approvers
176 Pre-reqs  : None.
177 Modifies  : None.
178 Function  : This function is called by the Recipient Main workflow
179             to get the contact list to whom request for approval notfications
180             are sent out.
181 Parameters:
182     IN    : itemtype  - Workflow Item Type
183             itemkey   - Workflow Item Key
184             actid     - Workflow Activity Id
185             funcmode  - Workflow Function Mode
186     OUT   : resultout - Result of the workflow function
187 Notes     : None.
188 Testing   : This function will be tested via workflow FUNRMAIN
189 ------------------------------------------------------------------------------*/
190 PROCEDURE get_ame_approvers (itemtype   IN VARCHAR2,
191                             itemkey    IN VARCHAR2,
192                             actid      IN NUMBER,
193                             funcmode   IN VARCHAR2,
194                             resultout  OUT NOCOPY VARCHAR2 );
195 
196 /* ---------------------------------------------------------------------------
197 Name      : get_ame_role_list
198 Pre-reqs  : None.
199 Modifies  : None.
200 Function  : This function is called by get_ame_contacts() and
201             get_ame_approvers functions. It returns the name of the wflow
202             role to whom FYI or approval notifications are sent out.
203 Parameters:
204     IN    : p_transaction_id   - fun_trx_headers.trx_id
205             p_fyi_notification - 'Y' or 'N' indicating if its FYI notification
206             p_contact_type     - 'I'- Initiator or 'R'- Recipient
207     OUT   : x_approvers_found  - 'Y'or 'N' indicating approvers found
208             x_process_complete - 'Y'or 'N' indicating process complete
209             x_role             - workflow role name
210             x_ame_admin_user   - Ame Administrator
211             x_error_message    - Error Message
212 Notes     : None.
213 Testing   : This function will be tested via the various intercompany
214             workflows
215 ------------------------------------------------------------------------------*/
216 PROCEDURE get_ame_role_list(itemkey            IN  VARCHAR2,
217                             p_transaction_id   IN  NUMBER,
218                             p_fyi_notification IN  VARCHAR2,
219                             p_contact_type     IN  VARCHAR2,
220                             x_approvers_found  OUT NOCOPY VARCHAR2,
221                             x_process_complete OUT NOCOPY VARCHAR2,
222                             x_role             OUT NOCOPY VARCHAR2,
223                             x_return_status    OUT NOCOPY VARCHAR2,
224                             x_ame_admin_user   OUT NOCOPY VARCHAR2,
225                             x_error_message    OUT NOCOPY VARCHAR2) ;
226 
227 /* ---------------------------------------------------------------------------
228 Name      : is_user_valid_approver
229 Pre-reqs  : None.
230 Modifies  : None.
231 Function  : This function is called from the Inbound Transaction UI
232             to check if the user is a valid approver before enabling
233             the 'Approve' and 'Reject' button.
234             This function is also called from within workflow to decide
235             whether or not the user the notification is going to be sent to
236             is a valid user or not.
237 Parameters:
238     IN    : p_transaction_id   - fun_trx_headers.trx_id
239             p_user_id          - fnd_user.userid of the person navigating
240                                  to the Inbound Trx UI.
241             p_role_name        - wf_roles.name of the person the notification
242                                  is being sent to or forwarded to.
243             p_org_type         - 'I'-  Initating, R - Recipient
244             p_mode             - UI - called from the UI
245                                  WF - called from the workflow.
246 
247     OUT   : Varchat2 - 'Y' implies user has access, 'N' means no access
248 Notes     : None.
249 Testing   : This function will be tested via the inbound trx UI
250 ------------------------------------------------------------------------------*/
251 FUNCTION is_user_valid_approver (p_transaction_id      IN VARCHAR2,
252 				 p_user_id             IN NUMBER,
253                                  p_role_name           IN VARCHAR2,
254                                  p_org_type            IN VARCHAR2,
255                                  p_mode                IN VARCHAR2)
256 RETURN VARCHAR2 ;
257 
258 /* End of changes for AME Uptake, 3671923. 07 Jun 2004 */
259 
260 
261 
262 -- 6995183 START
263 /* ---------------------------------------------------------------------------
264 Name      : validate_approver
265 Pre-reqs  : None.
266 Modifies  : None.
267 Function  : This function is called to check if the user is a valid approver before enabling
268             the 'Approve' and 'Reject' button.
269 
270 Parameters:
271     IN    : p_transaction_id   - fun_trx_headers.trx_id
272     OUT   : Varchar2 - 'Y' implies user has access, 'N' means no access
273 Notes     : None.
274 Testing   : This function will be tested via the inbound trx UI
275 ------------------------------------------------------------------------------*/
276 
277 FUNCTION validate_approver (p_transaction_id      IN VARCHAR2 )
278 RETURN VARCHAR2;
279 
280 -- 6995183 END
281 
282 
283 PROCEDURE set_invoice_reqd_flag(p_batch_id             IN NUMBER,
284                                 x_return_status        OUT NOCOPY VARCHAR2);
285 
286 
287 /*-----------------------------------------------------
288  * PROCEDURE wf_abort
289  * ----------------------------------------------------
290  * Abort the workflow events running for the given batch_id and trx_id.
291  * ---------------------------------------------------*/
292 PROCEDURE wf_abort (p_batch_id IN NUMBER,
293                     p_trx_id IN NUMBER);
294 
295 /*-----------------------------------------------------
296  * PROCEDURE wf_abort
297  * ----------------------------------------------------
298  * Bug: 12703241. Abort the workflow events running for
299  * the given batch_id, trx_id and item_type.
300  * ---------------------------------------------------*/
301 PROCEDURE wf_abort (p_batch_id   IN NUMBER,
302                     p_trx_id     IN NUMBER,
303 		    p_item_type  IN VARCHAR2);
304 END;
305