DBA Data[Home] [Help]

PACKAGE BODY: APPS.IRC_ASG_STATUS_BE2

Source


1 package body irc_asg_status_be2 as 
2 --Code generated on 27/11/2012 03:53:06
3 /* $Header: hrapiwfe.pkb 120.11 2011/12/24 13:28:35 vboggava ship $*/
4 procedure update_irc_asg_status_a (
5 p_status_change_reason         varchar2,
6 p_status_change_date           date,
7 p_assignment_status_id         number,
8 p_object_version_number        number,
9 p_status_change_comments       varchar2) is
10   l_event_key number;
11   l_event_data clob;
12   l_event_name varchar2(250);
13   l_text varchar2(2000);
14   l_message varchar2(10);
15   --
16   cursor get_seq is
17   select per_wf_events_s.nextval from dual;
18   --
19   l_proc varchar2(72):='  irc_asg_status_be2.update_irc_asg_status_a';
20 begin
21   hr_utility.set_location('Entering: '||l_proc,10);
22   -- check the status of the business event
23   l_event_name:='oracle.apps.per.irc.api.asg_status.update_irc_asg_status';
24   l_message:=wf_event.test(l_event_name);
25   --
26   if (l_message='MESSAGE') then
27     hr_utility.set_location(l_proc,20);
28     --
29     -- get a key for the event
30     --
31     open get_seq;
32     fetch get_seq into l_event_key;
33     close get_seq;
34     --
35     -- build the xml data for the event
36     --
37     dbms_lob.createTemporary(l_event_data,false,dbms_lob.call);
38     l_text:='<?xml version =''1.0'' encoding =''ASCII''?>';
39     dbms_lob.writeAppend(l_event_data,length(l_text),l_text);
40     l_text:='<asg_status>';
41     dbms_lob.writeAppend(l_event_data,length(l_text),l_text);
42     --
43     l_text:='<status_change_reason>';
44     l_text:=l_text||irc_utilities_pkg.removeTags(p_status_change_reason);
45     l_text:=l_text||'</status_change_reason>';
46     dbms_lob.writeAppend(l_event_data,length(l_text),l_text);
47     l_text:='<status_change_date>';
48     l_text:=l_text||fnd_date.date_to_canonical(p_status_change_date);
49     l_text:=l_text||'</status_change_date>';
50     dbms_lob.writeAppend(l_event_data,length(l_text),l_text);
51     l_text:='<assignment_status_id>';
52     l_text:=l_text||fnd_number.number_to_canonical(p_assignment_status_id);
53     l_text:=l_text||'</assignment_status_id>';
54     dbms_lob.writeAppend(l_event_data,length(l_text),l_text);
55     l_text:='<object_version_number>';
56     l_text:=l_text||fnd_number.number_to_canonical(p_object_version_number);
57     l_text:=l_text||'</object_version_number>';
58     dbms_lob.writeAppend(l_event_data,length(l_text),l_text);
59     l_text:='<status_change_comments>';
60     l_text:=l_text||irc_utilities_pkg.removeTags(p_status_change_comments);
61     l_text:=l_text||'</status_change_comments>';
62     dbms_lob.writeAppend(l_event_data,length(l_text),l_text);
63     l_text:='</asg_status>';
64     --
65     dbms_lob.writeAppend(l_event_data,length(l_text),l_text);
66     --
67     -- raise the event with the event data
68     wf_event.raise(p_event_name=>l_event_name
69                   ,p_event_key=>l_event_key
70                   ,p_event_data=>l_event_data);
71   elsif (l_message='KEY') then
72     hr_utility.set_location(l_proc,30);
73     -- get a key for the event
74     open get_seq;
75     fetch get_seq into l_event_key;
76     close get_seq;
77     -- this is a key event, so just raise the event
78     -- without the event data
79     wf_event.raise(p_event_name=>l_event_name
80                   ,p_event_key=>l_event_key);
81   elsif (l_message='NONE') then
82     hr_utility.set_location(l_proc,40);
83     -- no event is required, so do nothing
84     null;
85   end if;
86     hr_utility.set_location('Leaving: '||l_proc,50);
87 end update_irc_asg_status_a;
88 end irc_asg_status_be2;