DBA Data[Home] [Help]

PACKAGE: APPS.JTF_BRM_PVT

Source


1 PACKAGE JTF_BRM_PVT AUTHID CURRENT_USER AS
2 /* $Header: jtfvbrms.pls 120.3 2005/07/05 07:44:59 abraina ship $ */
3 /*#
4  * Bussiness Rule Monitor (BRM) API that intergrates with WF to run BRM
5  * @rep:scope private
6  * @rep:product JTA
7  * @rep:displayname JTF BRM Private API
8  * @rep:lifecycle active
9  * @rep:compatibility S
10  * @rep:category BUSINESS_ENTITY JTA_BUSINESS_RULE
11  */
12 
13 -----------------------------------------------------------------------------
14 --
15 -- PROCEDURE selector
16 --
17 -- Selector function for the Business Rule Monitor.
18 --
19 -- IN
20 --   itemtype  - type of the current item
21 --   itemkey   - key of the current item
22 --   actid     - process activity instance id
23 --   funcmode  - function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
24 -- OUT
25 --   result    - name of Workflow process to run
26 --
27 /*#
28  * Selector function for the Business Rule Monitor.
29  * @param itemtype - Type of the current item
30  * @param itemkey - Key of the current item
31  * @param actid - Process activity instance id
32  * @param funcmode - Function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
33  * @param result - Name of Workflow process to run
34  * @rep:scope public
35  * @rep:lifecycle active
36  * @rep:displayname Selector
37  */
38 PROCEDURE selector(
39     itemtype  IN     VARCHAR2,
40     itemkey   IN     VARCHAR2,
41     actid     IN     NUMBER,
42     funcmode  IN     VARCHAR2,
43     result    IN OUT NOCOPY VARCHAR2);
44 -----------------------------------------------------------------------------
45 --
46 -- FUNCTION init_monitor
47 --
48 -- Create an instance of the Business Rule Monitor, initialize it, and
49 -- start the instance.  Return TRUE if successful; otherwise return FALSE.
50 --
51 -- IN
52 --   itemkey     - key of the current item
53 --   uom_type    - unit of measure type for timer interval
54 --   uom_code    - unit of measure code for timer interval
55 --   timer_units - number of units for timer interval
56 -- OUT
57 --   TRUE        - success
58 --   FALSE       - failure
59 --
60 /*#
61  * Create an instance of the Business Rule Monitor, initialize it, and
62  * start the instance.  Return TRUE if successful; otherwise return FALSE.
63  * @param itemkey - Key of the current item
64  * @param uom_type - Unit of measure type for timer interval
65  * @param uom_code - Unit of measure code for timer interval
66  * @param timer_units - Number of units for timer interval
67  * @rep:scope public
68  * @rep:lifecycle active
69  * @rep:displayname Initialize Monitor
70  */
71 FUNCTION init_monitor(
72     itemkey       IN NUMBER,
73     uom_type      IN VARCHAR2,
74     uom_code      IN VARCHAR2,
75     timer_units   IN NUMBER)
76     RETURN BOOLEAN;
77 -----------------------------------------------------------------------------
78 --
79 -- PROCEDURE start_monitor
80 --
81 -- Set the START command and PROCESS_ID item attributes and update the
82 -- record in the JTF_BRM_PARAMETERS table to indicate the start of the
83 -- Business Rule Monitor.  The WORKFLOW_PROCESS_ID is set to be the same
84 -- as the itemkey.
85 --
86 -- IN
87 --   itemtype  - type of the current item
88 --   itemkey   - key of the current item
89 --   actid     - process activity instance id
90 --   funcmode  - function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
91 -- OUT
92 --   result    - activity has completed with the indicated result:
93 --
94 --               COMPLETE:No error
95 --               COMPLETE:Non-critical error
96 --               COMPLETE:Critical error
97 --
98 /*#
99  * Set the START command and PROCESS_ID item attributes and update the
100  * record in the JTF_BRM_PARAMETERS table to indicate the start of the
101  * Business Rule Monitor.  The WORKFLOW_PROCESS_ID is set to be the same
102  * as the itemkey.
103  * @param itemtype - Type of the current item
104  * @param itemkey - Key of the current item
105  * @param actid - Process activity instance id
106  * @param funcmode - Function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
107  * @param result - activity has completed with the indicated result:
108  *                 COMPLETE:No error
109  *                 COMPLETE:Non-critical error
110  *                 COMPLETE:Critical error
111  * @rep:scope public
112  * @rep:lifecycle active
113  * @rep:displayname Start Monitor
114  */
115 PROCEDURE start_monitor(
116     itemtype  IN VARCHAR2,
117     itemkey   IN VARCHAR2,
118     actid     IN NUMBER,
119     funcmode  IN VARCHAR2,
120     result    IN OUT NOCOPY VARCHAR2);
121 -----------------------------------------------------------------------------
122 --
123 -- PROCEDURE calculate_interval
124 --
125 -- Calculate the timer interval for the Business Rule Monitor.
126 --
127 -- IN
128 --   itemtype  - type of the current item
129 --   itemkey   - key of the current item
130 --   actid     - process activity instance id
131 --   funcmode  - function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
132 -- OUT
133 --   result    - activity has completed with the indicated result:
134 --
135 --               COMPLETE:No error
136 --               COMPLETE:Non-critical error
137 --               COMPLETE:Critical error
138 --
139 /*#
140  * Calculate the timer interval for the Business Rule Monitor.
141  * @param itemtype - Type of the current item
142  * @param itemkey - Key of the current item
143  * @param actid - Process activity instance id
144  * @param funcmode - Function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
145  * @param result - activity has completed with the indicated result:
146  *                 COMPLETE:No error
147  *                 COMPLETE:Non-critical error
148  *                 COMPLETE:Critical error
149  * @rep:scope public
150  * @rep:lifecycle active
151  * @rep:displayname Calculate Interval
152  */
153 PROCEDURE calculate_interval(
154     itemtype  IN VARCHAR2,
155     itemkey   IN VARCHAR2,
156     actid     IN NUMBER,
157     funcmode  IN VARCHAR2,
158     result    IN OUT NOCOPY VARCHAR2);
159 -----------------------------------------------------------------------------
160 --
161 -- PROCEDURE process_rules
162 --
163 -- Get the active business rules and process them.
164 --
165 -- IN
166 --   itemtype  - type of the current item
167 --   itemkey   - key of the current item
168 --   actid     - process activity instance id
169 --   funcmode  - function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
170 -- OUT
171 --   result    - activity has completed with the indicated result:
172 --
173 --               COMPLETE:No error
174 --               COMPLETE:Non-critical error
175 --               COMPLETE:Critical error
176 --
177 /*#
178  * Get the active business rules and process them.
179  * @param itemtype - Type of the current item
180  * @param itemkey - Key of the current item
181  * @param actid - Process activity instance id
182  * @param funcmode - Function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
183  * @param result - activity has completed with the indicated result:
184  *                 COMPLETE:No error
185  *                 COMPLETE:Non-critical error
186  *                 COMPLETE:Critical error
187  * @rep:scope public
188  * @rep:lifecycle active
189  * @rep:displayname Process Rules
190  */
191 PROCEDURE process_rules(
192     itemtype  IN VARCHAR2,
193     itemkey   IN VARCHAR2,
194     actid     IN NUMBER,
195     funcmode  IN VARCHAR2,
196     result    IN OUT NOCOPY VARCHAR2);
197 -----------------------------------------------------------------------------
198 --
199 -- PROCEDURE check_interval
200 --
201 -- Check the difference between the timer interval and the actual interval
202 -- needed to process the current set of active business rules.  A negative
203 -- difference stops the Business Rule Monitor so that the timer interval can
204 -- be increased.  No difference or a positive difference sets the time to
205 -- wait before the next set of rules is processed.
206 --
207 -- IN
208 --   itemtype  - type of the current item
209 --   itemkey   - key of the current item
210 --   actid     - process activity instance id
211 --   funcmode  - function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
212 -- OUT
213 --   result    - activity has completed with the indicated result:
214 --
215 --               COMPLETE:No error
216 --               COMPLETE:Non-critical error
217 --               COMPLETE:Critical error
218 --
219 /*#
220  * Check the difference between the timer interval and the actual interval
221  * needed to process the current set of active business rules.  A negative
222  * difference stops the Business Rule Monitor so that the timer interval can
223  * be increased.  No difference or a positive difference sets the time to
224  * wait before the next set of rules is processed.
225  * @param itemtype - Type of the current item
226  * @param itemkey - Key of the current item
227  * @param actid - Process activity instance id
228  * @param funcmode - Function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
229  * @param result - activity has completed with the indicated result:
230  *                 COMPLETE:No error
231  *                 COMPLETE:Non-critical error
232  *                 COMPLETE:Critical error
233  * @rep:scope public
234  * @rep:lifecycle active
235  * @rep:displayname Check Interval
236  */
237 PROCEDURE check_interval(
238     itemtype  IN VARCHAR2,
239     itemkey   IN VARCHAR2,
240     actid     IN NUMBER,
241     funcmode  IN VARCHAR2,
242     result    IN OUT NOCOPY VARCHAR2);
243 -----------------------------------------------------------------------------
244 --
245 -- PROCEDURE get_brm_command
246 --
247 -- Get the current Business Rule Monitor command.
248 --
249 -- IN
250 --   itemtype  - type of the current item
251 --   itemkey   - key of the current item
252 --   actid     - process activity instance id
253 --   funcmode  - function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
254 -- OUT
255 --   result    - activity has completed with the indicated result:
256 --
257 --               COMPLETE:No error
258 --               COMPLETE:Non-critical error
259 --               COMPLETE:Critical error
260 --
261 /*#
262  * Get the current Business Rule Monitor command.
263  * @param itemtype - Type of the current item
264  * @param itemkey - Key of the current item
265  * @param actid - Process activity instance id
266  * @param funcmode - Function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
267  * @param result - activity has completed with the indicated result:
268  *                 COMPLETE:No error
269  *                 COMPLETE:Non-critical error
270  *                 COMPLETE:Critical error
271  * @rep:scope public
272  * @rep:lifecycle active
273  * @rep:displayname Get BRM Command
274  */
275 PROCEDURE get_brm_command(
276     itemtype  IN VARCHAR2,
277     itemkey   IN VARCHAR2,
278     actid     IN NUMBER,
279     funcmode  IN VARCHAR2,
280     result    IN OUT NOCOPY VARCHAR2);
281 -----------------------------------------------------------------------------
282 --
283 -- PROCEDURE stop_monitor
284 --
285 -- Check if there is a request to stop the Business Rule Monitor.
286 --
287 -- IN
288 --   itemtype  - type of the current item
289 --   itemkey   - key of the current item
290 --   actid     - process activity instance id
291 --   funcmode  - function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
292 -- OUT
293 --   result    - activity has completed with the indicated result:
294 --
295 --               COMPLETE:True
296 --               COMPLETE:False
297 --
298 /*#
299  * Check if there is a request to stop the Business Rule Monitor.
300  * @param itemtype - Type of the current item
301  * @param itemkey - Key of the current item
302  * @param actid - Process activity instance id
303  * @param funcmode - Function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
304  * @param result - activity has completed with the indicated result:
305  *                 COMPLETE:No error
306  *                 COMPLETE:Non-critical error
307  *                 COMPLETE:Critical error
308  * @rep:scope public
309  * @rep:lifecycle active
310  * @rep:displayname Stop Monitor
311  */
312 PROCEDURE stop_monitor(
313     itemtype  IN VARCHAR2,
314     itemkey   IN VARCHAR2,
315     actid     IN NUMBER,
316     funcmode  IN VARCHAR2,
317     result    IN OUT NOCOPY VARCHAR2);
318 -----------------------------------------------------------------------------
319 --
320 -- PROCEDURE commit_wf
321 --
322 -- commits all runtime WF-data for the complete scan cycle and resets the
323 -- wf_savepoint. This will prevent the rollback segments from growing to
324 -- rediculous size
325 --
326 -- IN
327 --   itemtype  - type of the current item
328 --   itemkey   - key of the current item
329 --   actid     - process activity instance id
330 --   funcmode  - function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
331 -- OUT
332 --   result    - activity has completed with the indicated result:
333 --
334 --               COMPLETE:True
335 --               COMPLETE:False
336 --
337 /*#
338  * Commits all runtime WF-data for the complete scan cycle and resets the
339  * wf_savepoint. This will prevent the rollback segments from growing to
340  * rediculous size
341  * @param itemtype - Type of the current item
342  * @param itemkey - Key of the current item
343  * @param actid - Process activity instance id
344  * @param funcmode - Function execution mode ('RUN', 'CANCEL', 'TIMEOUT')
345  * @param result - activity has completed with the indicated result:
346  *                 COMPLETE:No error
347  *                 COMPLETE:Non-critical error
348  *                 COMPLETE:Critical error
349  * @rep:scope public
350  * @rep:lifecycle active
351  * @rep:displayname Commit WF
352  */
353 PROCEDURE commit_wf(
354     itemtype  IN VARCHAR2,
355     itemkey   IN VARCHAR2,
356     actid     IN NUMBER,
357     funcmode  IN VARCHAR2,
358     result    IN OUT NOCOPY VARCHAR2);
359 -----------------------------------------------------------------------------
360 
361 END JTF_BRM_PVT;