1 PACKAGE FUN_WF_COMMON AS
2 /* $Header: FUN_WF_COMMON_S.pls 120.4 2008/05/15 07:32:58 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 /* ---------------------------------------------------------------------------
153 Name : get_ame_approvers
154 Pre-reqs : None.
155 Modifies : None.
156 Function : This function is called by the Recipient Main workflow
157 to get the contact list to whom request for approval notfications
158 are sent out.
159 Parameters:
160 IN : itemtype - Workflow Item Type
161 itemkey - Workflow Item Key
162 actid - Workflow Activity Id
163 funcmode - Workflow Function Mode
164 OUT : resultout - Result of the workflow function
165 Notes : None.
166 Testing : This function will be tested via workflow FUNRMAIN
167 ------------------------------------------------------------------------------*/
168 PROCEDURE get_ame_approvers (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_role_list
176 Pre-reqs : None.
177 Modifies : None.
178 Function : This function is called by get_ame_contacts() and
179 get_ame_approvers functions. It returns the name of the wflow
180 role to whom FYI or approval notifications are sent out.
181 Parameters:
182 IN : p_transaction_id - fun_trx_headers.trx_id
183 p_fyi_notification - 'Y' or 'N' indicating if its FYI notification
184 p_contact_type - 'I'- Initiator or 'R'- Recipient
185 OUT : x_approvers_found - 'Y'or 'N' indicating approvers found
186 x_process_complete - 'Y'or 'N' indicating process complete
187 x_role - workflow role name
188 x_ame_admin_user - Ame Administrator
189 x_error_message - Error Message
190 Notes : None.
191 Testing : This function will be tested via the various intercompany
192 workflows
193 ------------------------------------------------------------------------------*/
194 PROCEDURE get_ame_role_list(itemkey IN VARCHAR2,
195 p_transaction_id IN NUMBER,
196 p_fyi_notification IN VARCHAR2,
197 p_contact_type IN VARCHAR2,
198 x_approvers_found OUT NOCOPY VARCHAR2,
199 x_process_complete OUT NOCOPY VARCHAR2,
200 x_role OUT NOCOPY VARCHAR2,
201 x_return_status OUT NOCOPY VARCHAR2,
202 x_ame_admin_user OUT NOCOPY VARCHAR2,
203 x_error_message OUT NOCOPY VARCHAR2) ;
204
205 /* ---------------------------------------------------------------------------
206 Name : is_user_valid_approver
207 Pre-reqs : None.
208 Modifies : None.
209 Function : This function is called from the Inbound Transaction UI
210 to check if the user is a valid approver before enabling
211 the 'Approve' and 'Reject' button.
212 This function is also called from within workflow to decide
213 whether or not the user the notification is going to be sent to
214 is a valid user or not.
215 Parameters:
216 IN : p_transaction_id - fun_trx_headers.trx_id
217 p_user_id - fnd_user.userid of the person navigating
218 to the Inbound Trx UI.
219 p_role_name - wf_roles.name of the person the notification
220 is being sent to or forwarded to.
221 p_org_type - 'I'- Initating, R - Recipient
222 p_mode - UI - called from the UI
223 WF - called from the workflow.
224
225 OUT : Varchat2 - 'Y' implies user has access, 'N' means no access
226 Notes : None.
227 Testing : This function will be tested via the inbound trx UI
228 ------------------------------------------------------------------------------*/
229 FUNCTION is_user_valid_approver (p_transaction_id IN VARCHAR2,
230 p_user_id IN NUMBER,
231 p_role_name IN VARCHAR2,
232 p_org_type IN VARCHAR2,
233 p_mode IN VARCHAR2)
234 RETURN VARCHAR2 ;
235
236 /* End of changes for AME Uptake, 3671923. 07 Jun 2004 */
237
238
239 PROCEDURE set_invoice_reqd_flag(p_batch_id IN NUMBER,
240 x_return_status OUT NOCOPY VARCHAR2);
241
242
243 /*-----------------------------------------------------
244 * PROCEDURE wf_abort
245 * ----------------------------------------------------
246 * Abort the workflow events running for the given batch_id and trx_id.
247 * ---------------------------------------------------*/
248 PROCEDURE wf_abort (p_batch_id IN NUMBER,
249 p_trx_id IN NUMBER);
250
251 END;
252