1 PACKAGE WMS_DEVICE_INTEGRATION_WCS AS
2 /* $Header: WMSDVPBS.pls 120.0 2005/05/24 18:06:40 appldev noship $ */
3
4 --
5 -- Name
6 -- PROCEDURE SYNC_DEVICE_REQUEST
7 --
8 -- Purpose
9 -- This procedure is meant to initiate a request to a WMS Device.
10 -- It is expected that 3rd party device vendors would extend this
11 -- package to implement the actual logic required to interface with
12 -- the device.
13 -- The primary source of input to this package would be the Temporary
14 -- table WMS_DEVICE_REQUEST. Depending on the level of details desired,
15 -- the records in this table will be 'join'ed with other tables.
16 --
17 -- MTL_SYSTEM_ITEMS - Item
18 -- MTL_ITEM_LOCATIONS - Location
19 -- MTL_PARAMETERS - Organization
20 -- WMS_LICENSE_PLATE_NUMBERS - LPN
21 --
22 -- Input Parameters
23 -- p_request_id : Request Id
24 -- p_device_id : Device ID of the device this request is initiated for
25 -- p_resubmit_flag : N - Invoked in conjunction with processing transaction
26 -- Y - Invoked to resubmit a request to device
27 --
28 -- Output Parameters
29 -- x_status_code : Status of request. ( S = Success, E = Error)
30 -- x_status_msg : Optional status message related to this specific request
31 -- x_device_status: Optional status message related to the device
32 --
33 -- Implementation Example
34 -- A short example of an implementation of this Stub API is given below.
35 -- This example procedure opens a cursor to WMS_DEVIVE_REQUESTS and join
36 -- of other tables to retrieve details of the request. Each request
37 -- record is then packed and send across a database-pipe. A receiving
38 -- program could then wait on this Pipe and pass the data to
39 -- the actual device.
40 --
41 -- PROCEDURE SYNC_DEVICE_REQUEST(
42 -- p_request_id IN NUMBER,
43 -- p_device_id IN NUMBER,
44 -- p_resubmit_flag IN VARCHAR2,
45 -- x_status_code OUT VARCHAR2,
46 -- x_status_msg OUT VARCHAR2,
47 -- x_device_status OUT VARCHAR2 ) IS
48 -- cursor crs_wdr is
49 -- select wd.name,
50 -- ml1.meaning business_event,
51 -- wdr.subinventory_code ,
52 -- mil.CONCATENATED_SEGMENTS locator,
53 -- WLPN.license_plate_number lpn,
54 -- msi.segment1 item,
55 -- wdr.transaction_quantity quantity
56 -- from wms_devices wd,
57 -- mfg_lookups ml1,
58 -- wms_device_requests wdr,
59 -- mtl_item_locations_kfv mil, WMS_license_plate_numbers WLPN,
60 -- mtl_system_items msi
61 -- where
62 -- ml1.LOOKUP_TYPE = 'WMS_BUS_EVENT_TYPES'
63 -- and ml1.LOOKUP_CODE = wdr.business_event_id
64 -- and wd.device_id = wdr.device_id
65 -- and mil.ORGANIZATION_ID (+) = wdr.organization_id
66 -- and mil.SUBINVENTORY_CODE(+) = wdr.SUBINVENTORY_CODE
67 -- and mil.INVENTORY_LOCATION_ID(+) = wdr.LOCATOR_ID
68 -- and WLPN.lpn_id(+) = wdr.lpn_id
69 -- and msi.organization_id(+) = wdr.organization_id
70 -- and msi.inventory_item_id(+) = wdr.inventory_item_id
71 -- and wdr.device_id = p_device_id;
72 -- l_stat number;
73 -- l_pipename varchar2(32) := 'devoutpipe';
74 -- l_packedonce boolean := false;
75 --BEGIN
76 -- for curreq in crs_wdr loop
77 -- dbms_output.put_line('** start of Line **');
78 -- if ( l_packedonce != true ) then
79 -- dbms_pipe.pack_message(curreq.name);
80 -- l_packedonce := true;
81 -- end if;
82 -- dbms_pipe.pack_message(curreq.business_event);
83 -- dbms_pipe.pack_message(curreq.subinventory_code);
84 -- dbms_pipe.pack_message(substr(curreq.locator, 1, 15));
85 -- dbms_pipe.pack_message(curreq.lpn);
86 -- dbms_pipe.pack_message(curreq.item);
87 -- dbms_pipe.pack_message(curreq.quantity);
88 -- end loop;
89 -- dbms_pipe.pack_message('_STOP_');
90 -- l_stat := dbms_pipe.send_message(l_pipename);
91 -- if l_stat != 0 then
92 -- inv_trx_util_pub.trace('Error in sending to pipe', 'DEVINT', 1);
93 -- x_status_code := 'E';
94 -- else
95 -- inv_trx_util_pub.trace('OK in sending to pipe', 'DEVINT', 6);
96 -- x_status_code := 'S';
97 -- end if;
98 --END;
99 --
100 ---
101 ------------------------------------------------------------------------
102 PROCEDURE sync_device_request (
103 p_request_id IN NUMBER,
104 p_device_id IN NUMBER,
105 p_resubmit_flag IN VARCHAR2,
106 x_status_code OUT NOCOPY VARCHAR2,
107 x_status_msg OUT NOCOPY VARCHAR2,
108 x_device_status OUT NOCOPY VARCHAR2
109 );
110
111 --
112 -- Name
113 -- UPDATE_REQUEST
114 --
115 -- Purpose
116 -- This procedure is provided to update the status of a request
117 -- from a transaction cycle seperate from the one in which the
118 -- request was initiated. This is meant to update a device request
119 -- in an asynchronous mode.
120 --
121 -- Input Parameters
122 -- p_request_id : Request Id
123 -- p_device_id : Device Identifier, if data comprising this request was
124 -- directed to multiple devices
125 -- p_status_code : Status of request. ( S = Success, E = Error)
126 -- p_status_msg : Optional status message related to this specific request
127 --
128 --
129 PROCEDURE update_request (
130 p_request_id IN NUMBER,
131 p_device_id IN NUMBER := NULL,
132 p_status_code IN VARCHAR2,
133 p_status_msg IN VARCHAR2 := NULL
134 );
135
136 -- Name
137 -- PROCEDURE: SYNC_DEVICE
138 -- Package Name: WMS_DEVICE_INTEGRATION_PUB
139 -- Purpose
140 -- This procedure is meant to invoke or terminate a WMS Device.
141 -- It is expected that 3rd party device vendors would extend this
142 -- package to implement the actual logic required to interface with
143 -- the device.
144 --
145 -- Input Parameters
146 -- p_organization_id : Request ID
147 -- p_device_id : Device ID of the device
148 -- p_employee_id : Employee ID of the employee who invokes or
149 -- terminates the device.
150 -- p_sign_on_flag : 'Y' when signing on
151 -- 'N' when signing off
152 --
153 -- Output Parameters
154 -- x_status_code : Return Status. ( S = Success, E = Error)
155 -- x_device_status: Optional status message related to the device
156 --
157 --
158 PROCEDURE sync_device (
159 p_organization_id IN NUMBER,
160 p_device_id IN NUMBER,
161 p_employee_id IN NUMBER,
162 p_sign_on_flag IN VARCHAR2,
163 x_status_code OUT NOCOPY VARCHAR2,
164 x_device_status OUT NOCOPY VARCHAR2
165 );
166
167 PROCEDURE signoff_msg_to_out_pipe (
168 p_device_id IN VARCHAR2,
169 p_message IN VARCHAR2,
170 x_pipe_name OUT NOCOPY VARCHAR2,
171 x_message_code OUT NOCOPY NUMBER,
172 x_return_status OUT NOCOPY VARCHAR2,
173 x_msg_count OUT NOCOPY NUMBER,
174 x_msg_data OUT NOCOPY VARCHAR2
175 );
176
177 END WMS_DEVICE_INTEGRATION_WCS;