DBA Data[Home] [Help]

PACKAGE: APPS.CSF_RESOURCE_PUB

Source


1 PACKAGE csf_resource_pub AUTHID CURRENT_USER AS
2   /* $Header: CSFPRESS.pls 120.12 2011/04/26 10:46:30 vakulkar ship $ */
3 
4   /**
5    * PLSQL Record Type to contain information about a Single Territory Qualifier.
6    *
7    * Information stored are Qualifier Usage ID, Enabled (or not), Label,
8    * Value, Associated Value (in case of Qualifier having a second value)
9    * and Display Value (where ID's are converted into Names).
10    */
11  TYPE resource_qualifier_rec_type IS RECORD(
12     qual_usg_id        NUMBER          -- territories qualifier usage ID
13   , use_flag           VARCHAR2(1)     -- checked/unchecked by user
14   , label              VARCHAR2(60)    -- qualifier description for the UI
15   , value              VARCHAR2(360)   -- qualifier value
16   , associated_value   VARCHAR2(360)   -- value for qualifiers that occur in pairs
17                                        --  (inventory item id and organization id).
18   , display_value      VARCHAR2(360)   -- may be filled with a converted value
19                                        -- (ID to name) when scheduling is being traced
20   );
21 
22   /**
23    * PLSQL Table Type to contain information about many Territory Qualifiers
24    * where each element is of type RESOURCE_QUALIFIER_REC_TYPE.
25    */
26   TYPE resource_qualifier_tbl_type IS TABLE OF resource_qualifier_rec_type
27     INDEX BY BINARY_INTEGER;
28 
29   /**
30    * PLSQL Record Type to contain information about a Resource's Shift Definitions.
31    *
32    * Information stored are Shift Construct ID, Availability Type (not used), Shift Start
33    * and End Time.
34    */
35   TYPE shift_rec_type IS RECORD(
36     shift_construct_id  NUMBER
37   , start_datetime      DATE
38   , end_datetime        DATE
39   , availability_type   VARCHAR2(40)
40   );
41 
42   /**
43    * PLSQL Table Type to contain information about many Shift Definitions
44    * where each element is of type SHIFT_REC_TYPE.
45    */
46   TYPE shift_tbl_type IS TABLE OF shift_rec_type
47     INDEX BY BINARY_INTEGER;
48 
49   /**
50    * PLSQL Record Type to contain information about a Resource
51    *
52    */
53   TYPE resource_rec_type IS RECORD(
54     resource_id       NUMBER
55   , resource_type     jtf_objects_b.object_code%TYPE
56   , resource_name     jtf_rs_resource_extns_tl.resource_name%TYPE
57   , resource_number   jtf_rs_resource_extns.resource_number%TYPE
58   );
59 
60   /**
61    * PLSQL Table Type to contain information about many Resources
62    * where each element is of type RESOURCE_REC_TYPE.
63    */
64   TYPE resource_tbl_type IS TABLE OF resource_rec_type;
65 
66   /**
67    * Returns the Resource Type Code corresponding to a Resource Category.
68    * <br>
69    * In sync with the code done in JTF_RS_ALL_RESOURCES_VL
70    *
71    * @param   p_category    Resource Category
72    * @returns Resource Type Code (VARCHAR2).
73    */
74   FUNCTION rs_category_type (p_category VARCHAR2)
75     RETURN VARCHAR2;
76 
77   /**
78    * Returns the ID of the Resource tied to the given User (FND User).
79    * <br>
80    * If no User is passed in, then it will take the User who has logged in
81    * (FND_GLOBAL.USER_ID).
82    *
83    * @param   p_user_id   Identifier to the User desired (Optional)
84    * @returns Resource ID (NUMBER)
85    */
86   FUNCTION resource_id (p_user_id NUMBER DEFAULT NULL)
87     RETURN NUMBER;
88 
89   /**
90    * Returns the Resource Type of the Resource tied to the given user. (FND User)
91    * <br>
92    * If no User is passed in, then it will take the User who has logged in
93    * (FND_GLOBAL.USER_ID).
94    *
95    * @param   p_user_id   Identifier to the User desired (Optional)
96    * @returns Resource Type (VARCHAR2)
97    */
98   FUNCTION resource_type (p_user_id NUMBER DEFAULT NULL)
99     RETURN VARCHAR2;
100 
101   /**
102    * Returns the Resource Name given the Resource ID and Type.
103    *
104    * @param   p_res_id    Resource ID
105    * @param   p_res_type  Resource Type Code
106    * @returns Resource Name (VARCHAR2)
107    */
108   FUNCTION get_resource_name (p_res_id NUMBER, p_res_type VARCHAR2)
109     RETURN VARCHAR2;
110 
111   /**
112    * Returns the Resource Type Name corresponding to the Resource Type Code
113    *
114    * @param   p_res_type   Resource Type Code
115    * @returns Resource Type Name (VARCHAR2)
116    */
117   FUNCTION get_resource_type_name (p_res_type VARCHAR2)
118     RETURN VARCHAR2;
119 
120   /**
121    * Returns the Address of the Party created for the Resource as of the
122    * date passed.
123    *
124    * @param   p_res_id    Resource ID
125    * @param   p_res_type  Resource Type Code
126    * @param   p_date      Active Party Site for the given date
127    *
128    * @returns Party Address of the Resource
129    */
130   FUNCTION get_resource_party_address (
131     p_res_id    NUMBER
132   , p_res_type  VARCHAR2
133   , p_date      DATE
134   , p_res_shift_add VARCHAR2 DEFAULT NULL
135   )
136     RETURN csf_resource_address_pvt.address_rec_type;
137 
138   /**
139    * Returns the Complete Resource Information given the Resource ID and Type.
140    * The returned record includes Resource Number and Resource Name.
141    *
142    * @param   p_res_id    Resource ID
143    * @param   p_res_type  Resource Type Code
144    * @returns Resource Information filled in RESOURCE_REC_TYPE
145    */
146   FUNCTION get_resource_info(p_res_id NUMBER, p_res_type VARCHAR2)
147     RETURN resource_rec_type;
148 
149   /**
150    * Converts the given Time from Resource Timezone to Server Timezone
151    * or vice versa.
152    * <br>
153    * By default, the given date is assumed to be in Resource Timezone and the
154    * date returned is Server Timezone. Set p_server_to_resource parameter as
155    * 'T' (FND_API.G_TRUE) to make it return the other way round.
156    * <br>
157    * Note that the API doesnt support RS_TEAM or RS_GROUP resources.
158    *
159    * @param  p_api_version             API Version (1.0)
160    * @param  p_init_msg_list           Initialize Message List
161    * @param  x_return_status           Return Status of the Procedure.
162    * @param  x_msg_count               Number of Messages in the Stack.
163    * @param  x_msg_data                Stack of Error Messages.
164    * @param  p_resource_id             Resource ID
165    * @param  p_resource_type           Resource Type
166    * @param  p_datetime                Date to be converted
167    * @param  p_server_to_resource      Server to Resource Timezone
168    */
169   PROCEDURE convert_timezone (
170     p_api_version          IN              NUMBER
171   , p_init_msg_list        IN              VARCHAR2 DEFAULT NULL
172   , x_return_status        OUT NOCOPY      VARCHAR2
173   , x_msg_count            OUT NOCOPY      NUMBER
174   , x_msg_data             OUT NOCOPY      VARCHAR2
175   , p_resource_id          IN              NUMBER
176   , p_resource_type        IN              VARCHAR2
177   , x_datetime             IN OUT NOCOPY   DATE
178   , p_server_to_resource   IN              VARCHAR2 DEFAULT NULL
179   );
180 
181   /**
182    * Returns the Qualifier Table having the list of valid Qualifiers
183    * based on the Task Information of the given Task ID.
184    */
185   FUNCTION get_res_qualifier_table(p_task_id NUMBER)
186     RETURN resource_qualifier_tbl_type;
187 
188   /**
189    * Converts the given Qualifier Table to Assignment Manager API Record
190    * type.
191    * Assembles the selected Qualifiers for this Task from the Qualifier
192    * Table in to a Record Type understandable by JTF Assignment Manager.
193    * <br>
194    * Uses a Hard Coded Mapping between JTF_SEEDED_QUAL_USGS_V.QUAL_USG_ID
195    * and the fields in JTF_ASSIGN_PUB.JTF_SRV_TASK_REC_TYPE.
196    * <br>
197    * The Task and SR Number must be set by the caller and wont be set by
198    * this API. Moreover Qualifiers of type -1211, -1212 and -1218 have
199    * been disabled and therefore wont be set by this API.
200    *
201    * @param p_table   Qualifier Table having the list of Task Qualifiers
202    */
203   FUNCTION get_qualified_task_rec(p_table resource_qualifier_tbl_type)
204     RETURN jtf_assign_pub.jtf_srv_task_rec_type;
205 
206   /**
207    * Gets the Qualified Resources for a Task by calling JTF Assignment Manager
208    * and also making use of the Required Skills of the Task if Required to reduce
209    * the Resource List.
210    *
211    * <br>
212    *
213    * The reason for CSF to maintain its own Assignment Manager rather than
214    * completely relying on JTF Assignment Manager has two fold reasons.
215    * <br>
216    * <b>TQ is secondary for JTF Assignment Manager API.</b>
217    *    Suppose in Schedule Advise Window, all the Flags are checked... then
218    *    JTF Assignment Manager will give preference to Contracts and IB only.
219    *    Only when both of returns ZERO resources, then JTF will consider TQ.
220    *    But DC expects an intersection of the three results.
221    *    Moreover if both Contracts and IB are checked, then JTF will use
222    *    the profile "JTFAM: Resource Search Order (JTF_AM_PREF_RES_ORDER)" to
223    *    find out which one to return ultimately. If the value CONTRACTS, then
224    *      CONTRACTS - Only Contracts is returned. If None, IB is returned.
225    *      IB        - Only IB is returned. If None, Contracts is returned.
226    *      BOTH      - Intersection of Contracts and IB Resources are returned.
227    * <br>
228    * <b>JTF doesnt have the concept of Skills. </b>
229    *    Resources and Skills is completely a Field Service Functionality. A
230    *    Resource can be attached to a Skill with a particular Skill Level.
231    *    So can a Task be tied to a Skill with a particular Skill Level. If
232    *    Skill based Flag is checked, then the Resource needs to have the same
233    *    Skill Set with a Comparable Skill Level as required by the Task.
234    *    Comparable Skill Level !!! - What is that ?
235    *    The profile "CSF: Skill Level Match (CSF_SKILL_LEVEL_MATCH)" is used
236    *    to decide whether the Resource has the Required Skill Level as required
237    *    by the Task.
238    *      EQUAL TO OR SMALLER THAN - Resource should have a Skill Level equal to
239    *                                 or lesser than that of the Task.
240    *      EQUAL TO                 - Resource should have a Skill Level equal to
241    *                                 that of the Task.
242    *      EQUAL TO OR GREATER THAN - Resource should have a Skill Level equal to
243    *                                 or greater than that of the Task.
244    *    Note that the Task needs to have Skills. Otherwise the Flag wont be used
245    *    at all for getting the Qualified Resources.
246    *
247    * <br>
248    *
249    * Thus CSF Assignment Manager API will call JTF Assignment Manager separately
250    * for Contracts / IB and then for Territory. Do an intersection of the Resources
251    * obtained thru the two calls and pruned by Skill Sets. Note that it gets
252    * Contracts / IB Resources from JTF in one call and so the user should make use
253    * the profile JTF_AM_PREF_RES_ORDER to get intersected results.
254    *
255    * <br>
256    * <b>Still to Implement</b>
257    *    CSF Assignment Manager still doesnt pass the parameter P_FILTER_EXCLUDED_RESOURCE
258    *    so that JTF Assignment Manager doesnt return Excluded Resources.
259    *    CSF Assignment Manager still doesnt pass the parameter P_BUSINESS_PROCESS_ID
260    *    so that JTF Assignment Manager returns only those Resources who belong to
261    *    Field Service Business Process when Preferred Resources are entered in Contracts.
262    *
263    * @param   p_api_version             API Version (1.0)
264    * @param   p_init_msg_list           Initialize Message List
265    * @param   x_return_status           Return Status of the Procedure.
266    * @param   x_msg_count               Number of Messages in the Stack.
267    * @param   x_msg_data                Stack of Error Messages.
268    * @param   p_task_id                 Task Identifier
269    * @param   p_incident_id             Service Request ID
270    * @param   p_task_rec                Qualified Task Record (Can be Empty)
271    * @param   p_scheduling_mode         Scheduling Mode used. (A, I, W, X)
272    * @param   p_start                   Start Date of the Plan Window
273    * @param   p_end                     End Date of the Plan Window
274    * @param   p_duration                Duration of the Task (Used by JTF to find out Available Resources)
275    * @param   p_duration_uom            UOM of the above Duration
276    * @param   p_contracts_flag          Get Contracts Preferred Resources ('Y'/'N')
277    * @param   p_ib_flag                 Get IB Preferred Resources ('Y'/'N')
278    * @param   p_territory_flag          Get Winning Territory Resources ('Y'/'N')
279    * @param   p_skill_flag              Get Skilled Resources ('Y'/'N')
280    * @param   p_calendar_flag           Get only Available Resources. Passed to JTF ('Y'/'N')
281    * @param   p_sort_flag               Sort the Resources based on their distance from Task ('Y'/'N')
282    * @param   p_suggested_res_id_tbl    Suggested Resource ID Table
283    * @param   p_suggested_res_type_tbl  Suggested Resource Type Table
284    * @param   x_res_tbl                 Qualified Resource suitable for Scheduling
285    */
286   PROCEDURE get_resources_to_schedule(
287     p_api_version            IN              NUMBER
288   , p_init_msg_list          IN              VARCHAR2 DEFAULT NULL
289   , x_return_status          OUT NOCOPY      VARCHAR2
290   , x_msg_count              OUT NOCOPY      NUMBER
291   , x_msg_data               OUT NOCOPY      VARCHAR2
292   , p_task_id                IN              NUMBER
293   , p_incident_id            IN              NUMBER
294   , p_res_qualifier_tbl      IN              resource_qualifier_tbl_type
295   , p_scheduling_mode        IN              VARCHAR2
296   , p_start                  IN              DATE
297   , p_end                    IN              DATE
298   , p_duration               IN              NUMBER                 DEFAULT NULL
299   , p_duration_uom           IN              VARCHAR2               DEFAULT NULL
300   , p_contracts_flag         IN              VARCHAR2               DEFAULT NULL
301   , p_ib_flag                IN              VARCHAR2               DEFAULT NULL
302   , p_territory_flag         IN              VARCHAR2               DEFAULT NULL
303   , p_skill_flag             IN              VARCHAR2               DEFAULT NULL
304   , p_calendar_flag          IN              VARCHAR2               DEFAULT NULL
305   , p_sort_flag              IN              VARCHAR2               DEFAULT NULL
306   , p_suggested_res_id_tbl   IN              jtf_number_table       DEFAULT NULL
307   , p_suggested_res_type_tbl IN              jtf_varchar2_table_100 DEFAULT NULL
308   , x_res_tbl                OUT NOCOPY      jtf_assign_pub.assignresources_tbl_type
309   );
310 
311   /**
312    * Gets the Qualified Resources for a Task in a format understood by Request Model.
313    * <br>
314    * In turn calls the GET_RESOURCES_TO_SCHEDULE which gets the Resources in JTF
315    * Assignment Manager Format.
316    */
317   PROCEDURE get_resources_to_schedule(
318     p_api_version            IN              NUMBER
319   , p_init_msg_list          IN              VARCHAR2 DEFAULT NULL
320   , x_return_status          OUT NOCOPY      VARCHAR2
321   , x_msg_count              OUT NOCOPY      NUMBER
322   , x_msg_data               OUT NOCOPY      VARCHAR2
323   , p_task_id                IN              NUMBER
324   , p_incident_id            IN              NUMBER
325   , p_res_qualifier_tbl      IN              resource_qualifier_tbl_type
326   , p_scheduling_mode        IN              VARCHAR2
327   , p_start                  IN              DATE
328   , p_end                    IN              DATE
329   , p_duration               IN              NUMBER                 DEFAULT NULL
330   , p_duration_uom           IN              VARCHAR2               DEFAULT NULL
331   , p_contracts_flag         IN              VARCHAR2               DEFAULT NULL
332   , p_ib_flag                IN              VARCHAR2               DEFAULT NULL
333   , p_territory_flag         IN              VARCHAR2               DEFAULT NULL
334   , p_skill_flag             IN              VARCHAR2               DEFAULT NULL
335   , p_calendar_flag          IN              VARCHAR2               DEFAULT NULL
336   , p_sort_flag              IN              VARCHAR2               DEFAULT NULL
337   , p_suggested_res_id_tbl   IN              jtf_number_table       DEFAULT NULL
338   , p_suggested_res_type_tbl IN              jtf_varchar2_table_100 DEFAULT NULL
339   , x_res_tbl                IN OUT NOCOPY   csf_requests_pvt.resource_tbl_type
340   );
341 
342   /**
343    * Gets the Qualified Resources for a Task by calling JTF Assignment Manager
344    * and also making use of the Required Skills of the Task if Required to reduce
345    * the Resource List.
346    *
347    * This is nothing but a very simplified version on top of the existing
348    * GET_QUALIFIED_RESOURCES. The output is in a different format
349    * though. It returns Territory ID, Resource Source, Resource
350    * Name also.
351    * <br>
352    *
353    * @param   p_api_version             API Version (1.0)
354    * @param   p_init_msg_list           Initialize Message List
355    * @param   x_return_status           Return Status of the Procedure.
356    * @param   x_msg_count               Number of Messages in the Stack.
357    * @param   x_msg_data                Stack of Error Messages.
358    * @param   p_task_id                 Task Identifier
359    * @param   p_incident_id             Service Request ID
360    * @param   p_contracts_flag          Get Contracts Preferred Resources ('Y'/'N')
361    * @param   p_ib_flag                 Get IB Preferred Resources ('Y'/'N')
362    * @param   p_territory_flag          Get Winning Territory Resources ('Y'/'N')
363    * @param   p_skill_flag              Get Skilled Resources ('Y'/'N')
364    * @param   p_calendar_flag           Get only Available Resources. Passed to JTF ('Y'/'N')
365    * @param   x_res_tbl                 Qualified Resource suitable for Scheduling
366    */
367   PROCEDURE get_resources_to_schedule(
368     p_api_version            IN              NUMBER
369   , p_init_msg_list          IN              VARCHAR2 DEFAULT NULL
370   , x_return_status          OUT NOCOPY      VARCHAR2
371   , x_msg_count              OUT NOCOPY      NUMBER
372   , x_msg_data               OUT NOCOPY      VARCHAR2
373   , p_task_id                IN              NUMBER
374   , p_contracts_flag         IN              VARCHAR2               DEFAULT NULL
375   , p_ib_flag                IN              VARCHAR2               DEFAULT NULL
376   , p_territory_flag         IN              VARCHAR2               DEFAULT NULL
377   , p_skill_flag             IN              VARCHAR2               DEFAULT NULL
378   , x_res_tbl                OUT NOCOPY      csf_resource_tbl
379   );
380 
381   /**
382    * Gets the Qualified Resources for a Task by calling JTF Assignment Manager
383    * and also making use of the Required Skills of the Task if Required to reduce
384    * the Resource List.
385    *
386    * This is nothing but a very simplified version on top of the existing
387    * GET_QUALIFIED_RESOURCES. The output is in a different format
388    * though. It returns Territory ID, Resource Source, Resource
389    * Name also.
390    * <br>
391    *
392    * @param   p_task_id                 Task Identifier
393    * @param   p_incident_id             Service Request ID
394    * @param   p_contracts_flag          Get Contracts Preferred Resources ('Y'/'N')
395    * @param   p_ib_flag                 Get IB Preferred Resources ('Y'/'N')
396    * @param   p_territory_flag          Get Winning Territory Resources ('Y'/'N')
397    * @param   p_skill_flag              Get Skilled Resources ('Y'/'N')
398    */
399   FUNCTION get_resources_to_schedule(
400       p_task_id                IN              NUMBER
401     , p_contracts_flag         IN              VARCHAR2               DEFAULT NULL
402     , p_ib_flag                IN              VARCHAR2               DEFAULT NULL
403     , p_territory_flag         IN              VARCHAR2               DEFAULT NULL
404     , p_skill_flag             IN              VARCHAR2               DEFAULT NULL
405     ) RETURN csf_resource_tbl;
406 
407   FUNCTION get_resources_to_schedule_pvt(
408       p_task_id                IN              NUMBER
409     , p_contracts_flag         IN              VARCHAR2               DEFAULT NULL
410     , p_ib_flag                IN              VARCHAR2               DEFAULT NULL
411     , p_territory_flag         IN              VARCHAR2               DEFAULT NULL
412     , p_skill_flag             IN              VARCHAR2               DEFAULT NULL
413     ) RETURN csf_resource_tbl;
414 
415   /**
416    * Gets the Shift Definitions of the given Resource between the two given Dates.
417    *
418    * CSF has its own "Get Resource Shifts" API in addition to JTF providing it is
419    * because CSF is still calling JTF Calendar API rather than JTF Calendar 24 API.
420    * Going forward, we should be calling JTF_CALENDAR24_PUB rather than
421    * JTF_CALENDAR_PUB.
422    * Because of this the following Shift Definition is returned as two Shifts.
423    * <br>
424    * Shift Construct #101: Start = 1-JAN-2005 18:00:00 to 2-JAN-2005 07:00:00
425    *    is returned as
426    *       Shift Record #1
427    *           Shift Construct = 101
428    *           Shift Date      = 1-JAN-2005
429    *           Start Time      = 18:00
430    *           End Time        = 23:59
431    *
432    *       Shift Record #2
433    *           Shift Construct = 101
434    *           Shift Date      = 2-JAN-2005
435    *           Start Time      = 00:00
436    *           End Time        = 07:00
437    * <br>
438    * Note that Shift Record#1 and Shift Record#2 are adjacent in the returned
439    * Shifts Table. Morever both has the same Shift Construct ID and the difference
440    * between End Time of the first record and the start time of the second is
441    * One Minute (1/1440 days).
442    *
443    * This feature is being used by this API to merge those shifts in a single
444    * record structure.
445    *
446    * Note this API requires JTF_CALENDAR_PUB to be of version 115.86 as the issue
447    * with respect to Sorting of Shifts has been fixed in that version.
448    *
449    * @param   p_api_version           API Version (1.0)
450    * @param   p_init_msg_list         Initialize Message List
451    * @param   x_return_status         Return Status of the Procedure.
452    * @param   x_msg_count             Number of Messages in the Stack.
453    * @param   x_msg_data              Stack of Error Messages.
454    * @param   p_resource_id           Resource Identifier for whom Shifts are required.
455    * @param   p_resource_type         Resource Type of the above Resource.
456    * @param   p_start_date            Start of the Window between which Shifts are required.
457    * @param   p_end_date              End of the Window between which Shifts are required.
458    * @param   x_shifts                Shift Definitions
459    */
460   PROCEDURE get_resource_shifts(
461     p_api_version           IN              NUMBER
462   , p_init_msg_list         IN              VARCHAR2 DEFAULT NULL
463   , x_return_status         OUT NOCOPY      VARCHAR2
464   , x_msg_count             OUT NOCOPY      NUMBER
465   , x_msg_data              OUT NOCOPY      VARCHAR2
466   , p_resource_id           IN              NUMBER
467   , p_resource_type         IN              VARCHAR2
468   , p_start_date            IN              DATE
469   , p_end_date              IN              DATE
470   , p_shift_type            IN              VARCHAR2 DEFAULT NULL
471   , x_shifts                OUT NOCOPY      shift_tbl_type
472   );
473 
474   PROCEDURE get_location(
475       x_return_status             OUT NOCOPY VARCHAR2
476     , x_msg_count                 OUT NOCOPY NUMBER
477     , x_msg_data                  OUT NOCOPY VARCHAR2
478     , p_resource_id                IN        NUMBER
479     , p_resource_type              IN        VARCHAR2
480     , p_date                       IN        DATE      DEFAULT SYSDATE
481     , x_creation_date             OUT NOCOPY DATE
482     , x_feed_time                 OUT NOCOPY DATE
483     , x_status_code               OUT NOCOPY VARCHAR2
484     , x_latitude                  OUT NOCOPY NUMBER
485     , x_longitude                 OUT NOCOPY NUMBER
486     , x_speed                     OUT NOCOPY NUMBER
487     , x_direction                 OUT NOCOPY VARCHAR2
488     , x_parked_time               OUT NOCOPY NUMBER
489     , x_address                   OUT NOCOPY VARCHAR2
490     , x_device_tag                OUT NOCOPY VARCHAR2
491     , x_status_code_meaning       OUT NOCOPY VARCHAR2
492     );
493 
494   PROCEDURE get_location(
495       x_return_status             OUT NOCOPY VARCHAR2
496     , x_msg_count                 OUT NOCOPY NUMBER
497     , x_msg_data                  OUT NOCOPY VARCHAR2
498     , p_resource_id                IN        NUMBER
499     , p_resource_type              IN        VARCHAR2
500     , p_date                       IN        DATE      DEFAULT SYSDATE
501     , x_latitude                  OUT NOCOPY NUMBER
502     , x_longitude                 OUT NOCOPY NUMBER
503     , x_address                   OUT NOCOPY VARCHAR2
504     , x_status_meaning            OUT NOCOPY VARCHAR2
505     , x_device_tag                OUT NOCOPY VARCHAR2
506     );
507 
508   FUNCTION get_location (
509       p_resource_id                IN        NUMBER
510     , p_resource_type              IN        VARCHAR2
511     , p_date                       IN        DATE      DEFAULT SYSDATE
512     )
513     RETURN MDSYS.SDO_POINT_TYPE;
514 
515   FUNCTION get_location_attributes(
516       p_resource_id                IN        NUMBER
517     , p_resource_type              IN        VARCHAR2
518     , p_date                       IN        DATE      DEFAULT SYSDATE
519     )
520     RETURN VARCHAR2;
521 
522   /**
523   * Returns the Distance between two locations on the globe in KMs.
524   *
525   * @param   p_lon1           Longitude of a from-Location.
526   * @param   p_lat1           Latitude of a from-Location.
527   * @param   p_lon2           Longitude of a to-Location.
528   * @param   p_lat2           Latitude of a to-Location.
529   */
530   FUNCTION geo_distance(p_lon1 NUMBER, p_lat1 NUMBER, p_lon2 NUMBER, p_lat2 NUMBER)
531     RETURN NUMBER;
532 
533   FUNCTION get_third_party_role(
534     p_resource_id        IN              NUMBER
535   , p_resource_type      IN              VARCHAR2
536   ) RETURN VARCHAR2;
537 
538 END csf_resource_pub;
539