DBA Data[Home] [Help]

PACKAGE: APPS.WSH_WF_STD

Source


1 PACKAGE WSH_WF_STD AS
2 /* $Header: WSHWSTDS.pls 120.2 2005/10/26 02:04:22 rahujain noship $ */
3 
4 -- This global determines whether we use the item attributes stored in the
5 -- wf item to reset application context.
6 G_RESET_APPS_CONTEXT BOOLEAN DEFAULT FALSE;
7 
8 ---------------------------------------------------------------------------------------
9 --
10 -- Procedure:       Start_Wf_Process
11 -- Parameters:      p_entity_type - 'TRIP','DELIVERY'
12 --		            p_entity_id   - TRIP_ID or DELIVERY_ID
13 --                  p_organization_id - The Organization Id
14 --
15 --                  x_process_started - 'Y' Process started; 'N' Process not started
16 --                  x_return_status - Returns WSH_UTIL_CORE.G_RET_STS_SUCCESS if Success
17 
18 -- Description:     This Procedure selects and starts a Tracking Workflow process
19 --                  for an entity - Trip/Delivery after checking if it is eligible.
20 --                  i.e.1) No Process exists already for the Entity
21 --                      2) Global and Shipping parameters for the entity admits
22 --                  Finally updates the WSH_NEW_DELIVERIES or WSH_TRIPS with the
23 --                  Process name that was launched.
24 --
25 ---------------------------------------------------------------------------------------
26 
27 PROCEDURE Start_Wf_Process(
28 		p_entity_type IN VARCHAR2,
29 		p_entity_id IN	NUMBER,
30                 p_organization_id IN NUMBER DEFAULT NULL,
31                 x_process_started OUT NOCOPY VARCHAR2,
32 		x_return_status OUT NOCOPY VARCHAR2);
33 
34 ---------------------------------------------------------------------------------------
35 --
36 -- Procedure:       Start_Scpod_C_Process
37 -- Parameters:      p_entity_id   - DELIVERY_ID (Entity is always Delivery)
38 --                  p_organization_id - The Organization Id
39 --
40 --                  x_process_started - 'Y' Process started; 'N' Process not started
41 --                  x_return_status - Returns WSH_UTIL_CORE.G_RET_STS_SUCCESS if Success
42 --
43 -- Description:     This Procedure starts the 'Ship to Deliver' controlling
44 --                  Workflow process for the Delivery after checking
45 --                  if it is eligible.
46 --                  i.e.1) No Process exists already for the Delivery
47 --                      2) Global and Shipping parameters for the entity admits
48 --
49 --
50 ---------------------------------------------------------------------------------------
51 
52 PROCEDURE Start_Scpod_C_Process(
53 		p_entity_id IN	NUMBER,
54                 p_organization_id IN NUMBER,
55                 x_process_started OUT NOCOPY VARCHAR2,
56 		x_return_status OUT NOCOPY VARCHAR2) ;
57 ---------------------------------------------------------------------------------------
58 --
59 -- Procedure:       process_selector
60 -- Parameters:      p_entity_type - 'TRIP','DELIVERY'
61 --  		        p_entity_id   - TRIP_ID or DELIVERY_ID
62 --                  p_organization_id - The Organization Id
63 --
64 --                  x_wf_process - Returns the process selected for the Entity
65 --                  x_return_status - Returns WSH_UTIL_CORE.G_RET_STS_SUCCESS if Success
66 --
67 -- Description:     This Procedure selects the process for the entities based on the
68 --                  various criteria
69 --                  Delivery:
70 --                  1) FTE Installed
71 --                  2) Picking Required
72 --                  3) Export Screening Required
73 --                  4) TPW enabled organization
74 --                  5) Shipment direction (Inbound/Outbound)
75 --                  6) If Inbound - Buyer/Supplier Managed
76 --                  Trip:
77 --                  1) FTE Installed
78 ---------------------------------------------------------------------------------------
79 
80 PROCEDURE process_selector(
81 		p_entity_type IN VARCHAR2,
82 		p_entity_id IN	NUMBER,
83 		p_organization_id IN NUMBER,
84 		x_wf_process OUT NOCOPY VARCHAR2,
85                 x_return_status OUT NOCOPY VARCHAR2) ;
86 ---------------------------------------------------------------------------------------
87 --
88 -- Procedure:       Raise_Event
89 -- Parameters:      p_entity_type - 'TRIP','DELIVERY'
90 --  		        p_entity_id   - TRIP_ID or DELIVERY_ID
91 --                  p_event       - The Event to be raised
92 --                  p_event_data  - Optional Event data to be sent while raising the event
93 --                  p_parameters  - Optional Parameters to be sent while raising the event
94 --                  p_send_date   - Optional date to indicate when the event should
95 --                                  become available for subscription processing.
96 --                  p_organization_id - The Organization Id
97 --
98 --                  x_return_status - Returns WSH_UTIL_CORE.G_RET_STS_SUCCESS if Success
99 --
100 -- Description:     This Procedure raises the event in the following scenario
101 --                  1) If a Process already exists for this Entity
102 --                  2) If no process exists, checks the Global and Shipping parameters
103 --                     for raising events and raises accordingly
104 ---------------------------------------------------------------------------------------
105 
106 PROCEDURE Raise_Event(
107 		p_entity_type IN VARCHAR2,
108 		p_entity_id IN VARCHAR2,
109 		p_event IN VARCHAR2,
110                 p_event_data IN CLOB DEFAULT NULL,
111                 p_parameters IN wf_parameter_list_t DEFAULT NULL,
112                 p_send_date IN DATE DEFAULT SYSDATE,
113 		p_organization_id IN NUMBER DEFAULT NULL,
114 		x_return_status OUT NOCOPY VARCHAR2) ;
115 
116 ---------------------------------------------------------------------------------------
117 -- Procedure:       confirm_start_wf_process
118 -- Parameters:      p_entity_type - 'TRIP','DELIVERY'
119 --                  p_organization_id - The Organization Id
120 --
121 --                  x_start_wf_process - Returns 'Y' if process can be started, else 'N'
122 --                  x_return_status - Returns WSH_UTIL_CORE.G_RET_STS_SUCCESS if Success
123 --
124 -- Description:     This Procedure obtains the Global and Shipping parameter
125 --                  values for 'Enable Tracking Workflows' and determines
126 --                  if a process can be started by,
127 --                  Global-TW	Shipping-TW Eligible Workflow Entity
128 --                  ---------   ----------- -------------------------
129 --                  None	    Delivery	None
130 --                  None	    None	    None
131 --                  Trip	    Delivery	Trip
132 --                  Trip	    None	    Trip
133 --                  Delivery	Delivery	Delivery
134 --                  Delivery	None	    None
135 --                  Both	    Delivery	Both
136 --                  Both	    None	    Trip
137 ---------------------------------------------------------------------------------------
138 
139 
140 PROCEDURE confirm_start_wf_process(
141 		p_entity_type IN VARCHAR2,
142 		p_organization_id IN NUMBER,
143                 x_start_wf_process OUT NOCOPY VARCHAR2,
144 		x_return_status OUT NOCOPY VARCHAR2) ;
145 ---------------------------------------------------------------------------------------
146 -- Procedure:       Check_Wf_Exists
147 -- Parameters:      p_entity_type - 'TRIP','DELIVERY'
148 --  		        p_entity_id   - TRIP_ID or DELIVERY_ID
149 --
150 --                  x_wf_process_exists - Returns 'Y' if Wf exists, else 'N'
151 --                  x_return_status - Returns WSH_UTIL_CORE.G_RET_STS_SUCCESS if Success
152 --
153 -- Description:     This Procedure checks from WSH_NEW_DELIVERIES or WSH_TRIPS
154 --                  if a workflow process has been started for this entity.
155 ---------------------------------------------------------------------------------------
156 
157 PROCEDURE Check_Wf_Exists(
158 		p_entity_type IN VARCHAR2,
159 		p_entity_id IN NUMBER,
160                 x_wf_process_exists OUT NOCOPY VARCHAR2,
161 		x_return_status OUT NOCOPY VARCHAR2) ;
162 
163 FUNCTION Wf_Exists(p_entity_type IN VARCHAR2,
164                    p_entity_id IN NUMBER)
165 RETURN BOOLEAN ;
166 
167 ---------------------------------------------------------------------------------------
168 -- Procedure:       Get_Custom_Wf_Process
169 -- Parameters:      p_wf_process - The Process selected for the enity
170 --          		p_org_code - The organization code
171 --
172 --                  x_wf_process - Returns the custom process name specified
173 --                                 with the lookups else the orginial process
174 --                  x_return_status - Returns WSH_UTIL_CORE.G_RET_STS_SUCCESS if Success
175 --
176 -- Description:     This Procedure queries from the WSH_LOOKUPS for any custom
177 --                  process name specified by the User through the lookups for
178 --                  a particular process else returns the original process
179 ---------------------------------------------------------------------------------------
180 
181 PROCEDURE Get_Custom_Wf_Process(
182 		p_wf_process IN VARCHAR2,
183 		p_org_code IN VARCHAR2,
184 		x_wf_process OUT NOCOPY VARCHAR2,
185                 x_return_status OUT NOCOPY VARCHAR2) ;
186 
187 Procedure Purge_Entity(
188                p_entity_type IN VARCHAR2,
189                p_entity_ids IN WSH_UTIL_CORE.column_tab_type,
190                p_action IN VARCHAR2 DEFAULT 'PURGE',
191                p_docommit IN BOOLEAN DEFAULT FALSE,
192 	       x_success_count OUT NOCOPY NUMBER,
193                x_return_status OUT NOCOPY VARCHAR2) ;
194 
195 PROCEDURE Log_Wf_Exception(p_entity_type IN VARCHAR2,
196                            p_entity_id IN NUMBER,
197                            p_ship_from_location_id IN NUMBER DEFAULT NULL,
198 			   p_logging_entity IN VARCHAR2,
199                            p_exception_name IN VARCHAR2,
200                            x_return_status OUT NOCOPY VARCHAR2);
201 
202 FUNCTION Instance_Default_Rule (p_subscription_guid IN RAW,
203 				p_event in OUT NOCOPY WF_EVENT_T)
204 RETURN VARCHAR2 ;
205 
206 PROCEDURE RESET_APPS_CONTEXT_ON;
207 
208 PROCEDURE RESET_APPS_CONTEXT_OFF;
209 
210 /* CURRENTLY NOT IN USE
211 PROCEDURE Get_Carrier(p_del_ids IN WSH_UTIL_CORE.ID_TAB_TYPE,
212                       x_del_old_carrier_ids OUT NOCOPY WSH_UTIL_CORE.ID_TAB_TYPE,
213                       x_return_status OUT NOCOPY VARCHAR2);
214 
215 PROCEDURE Handle_Trip_Carriers(p_trip_id IN NUMBER,
216 			       p_del_ids IN WSH_UTIL_CORE.ID_TAB_TYPE,
217 			       p_del_old_carrier_ids IN WSH_UTIL_CORE.ID_TAB_TYPE,
218 			       x_return_status OUT NOCOPY VARCHAR2);
219 
220 PROCEDURE Assign_Unassign_Carrier(p_delivery_id IN NUMBER,
221 			          p_old_carrier_id IN NUMBER,
222                                   p_new_carrier_id IN NUMBER,
223                                   x_return_status OUT NOCOPY VARCHAR2);
224 
225 PROCEDURE Get_Deliveries(p_trip_id IN NUMBER,
226                          x_del_ids OUT NOCOPY WSH_UTIL_CORE.ID_TAB_TYPE,
227 			 x_return_status OUT NOCOPY VARCHAR2);
228 */
229 
230 END WSH_WF_STD;