1 PACKAGE WIP_OP_RESOURCES_UTILITIES AUTHID CURRENT_USER AS
2 /* $Header: wiporuts.pls 115.8 2003/09/22 23:49:28 ccai ship $ */
3
4 --Raises an exception if an operation already exists with the same primary key
5 PROCEDURE Check_Unique(X_Wip_Entity_Id NUMBER,
6 X_Organization_Id NUMBER,
7 X_Operation_Seq_Num NUMBER,
8 X_Resource_Seq_Num NUMBER,
9 X_Repetitive_Schedule_Id NUMBER);
10
11 --Raises an error if trying to insert a second PO Move resource
12 PROCEDURE Check_One_Pomove(X_Wip_Entity_Id NUMBER,
13 X_Organization_Id NUMBER,
14 X_Operation_Seq_Num NUMBER,
15 X_Resource_Seq_Num NUMBER,
16 X_Repetitive_Schedule_Id NUMBER);
17
18 --Raises an error if trying to insert a second Prior resource
19 PROCEDURE Check_One_Prior(X_Wip_Entity_Id NUMBER,
20 X_Organization_Id NUMBER,
21 X_Operation_Seq_Num NUMBER,
22 X_Resource_Seq_Num NUMBER,
23 X_Repetitive_Schedule_Id NUMBER);
24
25 --Raises an error if trying to insert a second Next resource
26 PROCEDURE Check_One_Next(X_Wip_Entity_Id NUMBER,
27 X_Organization_Id NUMBER,
28 X_Operation_Seq_Num NUMBER,
29 X_Resource_Seq_Num NUMBER,
30 X_Repetitive_Schedule_Id NUMBER);
31
32 --Sets resource dates based on operation dates
33 PROCEDURE Set_Resource_Dates(X_Wip_Entity_Id NUMBER,
34 X_Organization_Id NUMBER,
35 X_Operation_Seq_Num NUMBER,
36 X_Resource_Seq_Num NUMBER,
37 X_Repetitive_Schedule_Id NUMBER,
38 X_First_Unit_Start_Date DATE,
39 X_Last_Unit_Completion_Date DATE);
40
41 --Returns TRUE if there are pending transactions otherwise FALSE
42 FUNCTION Pending_Transactions(
43 X_Wip_Entity_Id NUMBER,
44 X_Organization_Id NUMBER,
45 X_Operation_Seq_Num NUMBER,
46 X_Resource_Seq_Num NUMBER,
47 X_Line_Id NUMBER) RETURN BOOLEAN;
48
49 --Gets the class for a given UOM Code
50 FUNCTION Get_Uom_Class(X_Unit VARCHAR2) RETURN VARCHAR2;
51
52 /*=====================================================================+
53 | PROCEDURE
54 | Delete_Orphaned_Alternates
55 |
56 | PURPOSE
57 | When redefining the resource requirements for a wip entity, it is
58 | possible to delete/change the primary resource of a substitute
59 | group, such that alternate resources exist in
60 | wip_sub_operation_resources without a corresponding primary res in
61 | wor. Call this procedure after all changes are inserted in the
62 | database to remove the orphaned subs.
63 |
64 | ARGUMENTS
65 | IN
66 | p_wip_entity_id
67 | p_schedule_id
68 | OUT
69 | x_return_status
70 |
71 +=====================================================================*/
72 Procedure Delete_Orphaned_Alternates (p_wip_entity_id in number,
73 p_schedule_id in number,
74 x_return_status OUT NOCOPY varchar2);
75
76 /*=====================================================================+
77 | PROCEDURE
78 | Validate_Sub_Groups
79 |
80 | PURPOSE
81 | Substitute groups must be ordered by nvl(schedule_seq_num, resource
82 | seq_num), and simultaneous resources must be in the same sub group.
83 | Call this procedure after all changes are inserted in the
84 | database to check if these rules are violated
85 |
86 | ARGUMENTS
87 | IN
88 | p_wip_entity_id
89 | p_schedule_id
90 | OUT
91 | x_return_status
92 | x_msg_data: returns the error msg depending on which rule was
93 | violated
94 | x_operation_seq_num: returns the op seq at which the error
95 | occurred
96 |
97 +=====================================================================*/
98 Procedure Validate_Sub_Groups (p_wip_entity_id NUMBER,
99 p_schedule_id NUMBER,
100 x_return_status OUT NOCOPY VARCHAR2,
101 x_msg_data OUT NOCOPY VARCHAR2,
102 x_operation_seq_num OUT NOCOPY NUMBER);
103
104 /*=====================================================================+
105 | PROCEDURE
106 | Update_Resource_Instances
107 |
108 | PURPOSE
109 | If the job/op/resources are rescheduled from the infinite scheduler,
110 | the start/end date of these instances need to be updated to be the
111 | same as the resource start/end date.
112 |
113 | ARGUMENTS
114 | IN
115 | p_wip_entity_id
116 | p_org_id
117 |
118 | NOTES
119 | This procedure is being called from wicmex.opp for infinite
120 | scheduling
121 |
122 +=====================================================================*/
123 Procedure Update_Resource_Instances(p_wip_entity_id NUMBER,
124 p_org_id NUMBER);
125
126 END WIP_OP_RESOURCES_UTILITIES;