DBA Data[Home] [Help]

PACKAGE BODY: APPS.ECX_OXTA_PKG

Source


1 package body ECX_OXTA_PKG as
2 /* $Header: ECXOXTAB.pls 120.2 2005/06/30 11:17:27 appldev ship $ */
3 
4 procedure oxta_dequeue
5 (
6      p_queue_name          in varchar2,
7      p_message_type        out nocopy varchar2,
8      p_message_standard	   out nocopy varchar2,
9      p_transaction_type    out nocopy varchar2,
10      p_transaction_subtype out nocopy varchar2,
11      p_document_number     out nocopy varchar2,
12      p_partyid             out nocopy varchar2,
13      p_party_site_id       out nocopy varchar2,
14      p_party_type          out nocopy varchar2,
15      p_protocol_type		   out nocopy varchar2,
16      p_protocol_address		 out nocopy varchar2,
17      p_username		         out nocopy varchar2,
18      p_password		         out nocopy varchar2,
19      p_attribute1		       out nocopy varchar2,
20      p_attribute2		       out nocopy varchar2,
21      p_attribute3		       out nocopy varchar2,
22      p_attribute4		       out nocopy varchar2,
23      p_attribute5		       out nocopy varchar2,
24      p_payload		         out nocopy clob,
25      p_msgid               out nocopy raw,
26      p_org_msgid           out nocopy varchar2
27 )  is
28 v_message	        system.ecxmsg;
29 v_dequeueoptions	dbms_aq.dequeue_options_t;
30 v_messageproperties	dbms_aq.message_properties_t;
31 l_password              varchar2(500);
32 l_errmsg		varchar2(2000);
33 l_retcode		pls_integer;
34 no_messages           exception;
35 pragma exception_init (no_messages, -25228);
36 
37 begin
38     	v_dequeueoptions.navigation := dbms_aq.FIRST_MESSAGE;
39     	v_dequeueoptions.wait := dbms_aq.NO_WAIT;
40     	v_dequeueoptions.correlation := 'OXTA';
41 
42 
43 		dbms_aq.dequeue
44 		(
45 		queue_name=>p_queue_name,
46 		dequeue_options=>v_dequeueoptions,
47 		message_properties=>v_messageproperties,
48 		payload=>v_message,
49 		msgid=>p_msgid
50 		);
51 
52 
53      		p_message_type        	:= v_message.message_type;
54      		p_message_standard	:= v_message.message_standard;
55      		p_transaction_type      := v_message.transaction_type;
56      		p_transaction_subtype   := v_message.transaction_subtype;
57      		p_document_number       := v_message.document_number;
58      		p_partyid	        := v_message.partyid;
59      		p_party_site_id	        := v_message.party_site_id;
60      		p_party_type	        := v_message.party_type;
61      		p_protocol_type	        := v_message.protocol_type;
62      		p_protocol_address	:= v_message.protocol_address;
63      		p_username		:= v_message.username;
64      		p_password		:= v_message.password;
65      		p_attribute1	   	:= v_message.attribute1;
66      		p_attribute2	   	:= v_message.attribute2;
67      		p_attribute3	   	:= v_message.attribute3;
68      		p_attribute4	   	:= v_message.attribute4;
69      		p_attribute5	   	:= v_message.attribute5;
70      		p_payload		:= v_message.payload;
71      		p_org_msgid           	:= v_message.attribute5;
72 
73 
74 exception
75 when no_messages then
76 	raise no_messages;
77 end oxta_dequeue;
78 
79 procedure oxta_enqueue
80 (
81      p_queue_name          in varchar2,
82      p_message_type        in varchar2,
83      p_message_standard	   in varchar2,
84      p_transaction_type    in varchar2,
85      p_transaction_subtype in varchar2,
86      p_document_number     in varchar2,
87      p_partyid	           in varchar2,
88      p_party_site_id       in varchar2,
89      p_party_type          in varchar2,
90      p_protocol_type		   in varchar2,
91      p_protocol_address		 in varchar2,
92      p_username		         in varchar2,
93      p_password		         in varchar2,
94      p_attribute1		       in varchar2,
95      p_attribute2		       in varchar2,
96      p_attribute3		       in varchar2,
97      p_attribute4		       in varchar2,
98      p_attribute5		       in varchar2,
99      p_payload		         in clob,
100      p_org_msgid           in varchar2,
101      p_delay               in number,
102      p_msgid               out nocopy raw
103 )  is
104 v_message	        system.ecxmsg;
105 v_enqueueoptions	dbms_aq.enqueue_options_t;
106 v_messageproperties	dbms_aq.message_properties_t;
107 begin
108 
109     v_message := system.ecxmsg( p_message_type,
110                          p_message_standard,
111                          p_transaction_type,
112                          p_transaction_subtype,
113                          p_document_number,
114                          p_partyid,
115                          p_party_site_id,
116                          p_party_type,
117                          p_protocol_type,
118                          p_protocol_address,
119                          p_username,
120                          p_password,
121                          p_payload,
122                          p_attribute1,
123                          p_attribute2,
124                          p_attribute3,
125                          p_attribute4,
126                          p_org_msgid);
127 
128     v_messageproperties.correlation := 'OXTA';
129     v_messageproperties.delay := p_delay;
130 
131 		dbms_aq.enqueue
132 			(
133 			queue_name=>p_queue_name,
134 			enqueue_options=>v_enqueueoptions,
135 			message_properties=>v_messageproperties,
136 			payload=>v_message,
137 			msgid=>p_msgid
138 			);
139 
140 end oxta_enqueue;
141 
142 end ECX_OXTA_PKG;