-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathek_event_logic_api.pck
63 lines (57 loc) · 1.93 KB
/
ek_event_logic_api.pck
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
CREATE OR REPLACE PACKAGE ek_event_logic_api IS
------------------------------------------------------------
-- Author : OAPGARTH
-- Created : 03/07/2015 15:24:01
-- Purpose : To manage custom even logic
-------------------------------------
-- Triggered when an inventory part status
-- is changed to or from "S - Product Stopped"
PROCEDURE Park_Shop_Order (
part_no_ IN VARCHAR2,
contract_ IN VARCHAR2,
new_status_ IN VARCHAR2,
old_status_ IN VARCHAR2 );
END ek_event_logic_api;
/
CREATE OR REPLACE PACKAGE BODY ek_event_logic_api IS
/*************************************************
* Author : OAPGARTH
* Created : 03/07/2015 15:24:01
*
* Triggered when an inventory part status
* is changed to or from "S - Product Stopped"
*/
PROCEDURE Park_Shop_Order (
part_no_ IN VARCHAR2,
contract_ IN VARCHAR2,
new_status_ IN VARCHAR2,
old_status_ IN VARCHAR2 )
IS
attr_ VARCHAR2(2000);
CURSOR get_part_rel_shop_orders IS
SELECT *
FROM shop_ord_tab s
WHERE s.rowstate IN ('Planned','Released')
AND s.contract = contract_
AND s.part_no = part_no_;
CURSOR get_part_parked_shop_orders IS
SELECT *
FROM shop_ord_tab s
WHERE s.rowstate IN ('Parked')
AND s.contract = contract_
AND s.part_no = art_no_;
BEGIN
IF new_status_ = 'S' THEN
FOR s_ IN get_part_rel_shop_orders LOOP
Client_SYS.Clear_Attr (attr_);
Shop_Ord0_API.Finite_State_Machine___ (s_, 'Park', attr_);
END LOOP;
ELSIF old_status_ = 'S' THEN
FOR s_ IN get_part_parked_shop_orders LOOP
Client_SYS.Clear_Attr (attr_);
Shop_Ord0_API.Finite_State_Machine___ (s_, 'Release', attr_);
END LOOP;
END IF;
END Park_Shop_Order;
END ek_event_logic_api;
/