1 PACKAGE as_sales_meth_wf AUTHID CURRENT_USER AS
2 /* $Header: asxsmtws.pls 115.15 2003/12/23 10:10:49 sumahali ship $ */
3 TYPE tasktbl IS TABLE OF jtf_tasks_b.task_id%TYPE
4 INDEX BY BINARY_INTEGER;
5 g_task_tab tasktbl;
6 empty_tbl tasktbl;
7 -- n BINARY_INTEGER := 0;
8 -- PROCEDURE start methodology
9 -- DESCRIPTION This procedure is called to start standard sales methodology workflow*/
10 PROCEDURE start_methodology (p_source_object_type_code IN VARCHAR2,
11 p_source_object_id IN NUMBER,
12 p_source_object_name IN VARCHAR2,
13 p_owner_id IN NUMBER,
14 p_owner_type_code IN VARCHAR2,
15 p_object_type_code IN VARCHAR2,
16 p_current_stage_id IN NUMBER,
17 p_next_stage_id IN NUMBER,
18 p_template_group_id IN VARCHAR2,
19 item_type IN VARCHAR2,
20 workflow_process IN VARCHAR2,
21 x_return_status OUT NOCOPY VARCHAR2,
22 x_msg_count OUT NOCOPY NUMBER,
23 x_msg_data OUT NOCOPY VARCHAR2,
24 x_warning_message OUT NOCOPY VARCHAR2
25 ) ;
26 /* PROCEDURE check_task_for_current
27 --
28 -- Description checks for any mandatory tasks for current stage
29 --
30 -- IN
31 -- itemtype - type of the current item
32 -- itemkey - key of the current item
33 -- actid - process activity instance id
34 -- funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...)
35 -- OUT
36 -- result
37 -- - COMPLETE[:<result>]
38 -- activity has completed with the indicated result
39 -- - WAITING
40 -- activity is waiting for additional transitions
41 -- - DEFERED
42 -- execution should be defered to background
43 -- - NOTIFIED[:<notification_id>:<assigned_user>]
44 -- activity has notified an external entity that this
45 -- step must be performed. A call to wf_engine.CompleteActivty
46 -- will signal when this step is complete. Optional
47 -- return of notification ID and assigned user.
48 -- - ERROR[:<error_code>]
49 -- function encountered an error. */
50 PROCEDURE Check_task_for_current ( itemtype IN VARCHAR2,
51 itemkey IN VARCHAR2,
52 actid IN NUMBER,
53 funcmode IN VARCHAR2,
54 result OUT NOCOPY VARCHAR2 ) ;
55 /* PROCEDURE check_task_for_next
56 --
57 -- Description checks for any tasks created for next stage
58 --
59 -- IN
60 -- itemtype - type of the current item
61 -- itemkey - key of the current item
62 -- actid - process activity instance id
63 -- funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...)
64 -- OUT
65 -- result
66 -- - COMPLETE[:<result>]
67 -- activity has completed with the indicated result
68 -- - WAITING
69 -- activity is waiting for additional transitions
70 -- - DEFERED
71 -- execution should be defered to background
72 -- - NOTIFIED[:<notification_id>:<assigned_user>]
73 -- activity has notified an external entity that this
74 -- step must be performed. A call to wf_engine.CompleteActivty
75 -- will signal when this step is complete. Optional
76 -- return of notification ID and assigned user.
77 -- - ERROR[:<error_code>]
78 -- function encountered an error.*/
79 PROCEDURE Check_task_exist_for_next ( itemtype IN VARCHAR2,
80 itemkey IN VARCHAR2,
81 actid IN NUMBER,
82 funcmode IN VARCHAR2,
83 result OUT NOCOPY VARCHAR2 ) ;
84 /* PROCEDURE create_tasks
85 --
86 -- Description create tasks from templates and create references for those tasks
87 --
88 -- IN
89 -- itemtype - type of the current item
90 -- itemkey - key of the current item
91 -- actid - process activity instance id
92 -- funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...)
93 -- OUT
94 -- result
95 -- - COMPLETE[:<result>]
96 -- activity has completed with the indicated result
97 -- - WAITING
98 -- activity is waiting for additional transitions
99 -- - DEFERED
100 -- execution should be defered to background
101 -- - NOTIFIED[:<notification_id>:<assigned_user>]
102 -- activity has notified an external entity that this
103 -- step must be performed. A call to wf_engine.CompleteActivty
104 -- will signal when this step is complete. Optional
105 -- return of notification ID and assigned user.
106 -- - ERROR[:<error_code>]
107 -- function encountered an error.*/
108 PROCEDURE Create_tasks ( itemtype IN VARCHAR2,
109 itemkey IN VARCHAR2,
110 actid IN NUMBER,
111 funcmode IN VARCHAR2,
112 result OUT NOCOPY VARCHAR2 ) ;
113 PROCEDURE Check_duration ( itemtype IN VARCHAR2,
114 itemkey IN VARCHAR2,
115 actid IN NUMBER,
116 funcmode IN VARCHAR2,
117 result OUT NOCOPY VARCHAR2 ) ;
118 /* PROCEDURE create note for duration
119 --
120 -- Description create note based on previous node in the workflow.
121 --
122 -- IN
123 -- itemtype - type of the current item
124 -- itemkey - key of the current item
125 -- actid - process activity instance id
126 -- funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...)
127 -- OUT
128 -- result
129 -- - COMPLETE[:<result>]
130 -- activity has completed with the indicated result
131 -- - WAITING
132 -- activity is waiting for additional transitions
133 -- - DEFERED
134 -- execution should be defered to background
135 -- - NOTIFIED[:<notification_id>:<assigned_user>]
136 -- activity has notified an external entity that this
137 -- step must be performed. A call to wf_engine.CompleteActivty
138 -- will signal when this step is complete. Optional
139 -- return of notification ID and assigned user.
140 -- - ERROR[:<error_code>]
141 -- function encountered an error.*/
142 PROCEDURE Create_note_for_duration ( itemtype IN VARCHAR2,
143 itemkey IN VARCHAR2,
144 actid IN NUMBER,
145 funcmode IN VARCHAR2,
146 result OUT NOCOPY VARCHAR2 ) ;
147 /* PROCEDURE create note
148 --
149 -- Description create note based on previous node in the workflow.
150 --
151 -- IN
152 -- itemtype - type of the current item
153 -- itemkey - key of the current item
154 -- actid - process activity instance id
155 -- funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...)
156 -- OUT
157 -- result
158 -- - COMPLETE[:<result>]
159 -- activity has completed with the indicated result
160 -- - WAITING
161 -- activity is waiting for additional transitions
162 -- - DEFERED
163 -- execution should be defered to background
164 -- - NOTIFIED[:<notification_id>:<assigned_user>]
165 -- activity has notified an external entity that this
166 -- step must be performed. A call to wf_engine.CompleteActivty
167 -- will signal when this step is complete. Optional
168 -- return of notification ID and assigned user.
169 -- - ERROR[:<error_code>]
170 -- function encountered an error.*/
171 PROCEDURE Create_note ( itemtype IN VARCHAR2,
172 itemkey IN VARCHAR2,
173 actid IN NUMBER,
174 funcmode IN VARCHAR2,
175 result OUT NOCOPY VARCHAR2 ) ;
176 ---------------
177 /* PROCEDURE create note for failure
178 --
179 -- Description create note if create task node fails.
180 --
181 -- IN
182 -- itemtype - type of the current item
183 -- itemkey - key of the current item
184 -- actid - process activity instance id
185 -- funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...)
186 -- OUT
187 -- result
188 -- - COMPLETE[:<result>]
189 -- activity has completed with the indicated result
190 -- - WAITING
191 -- activity is waiting for additional transitions
192 -- - DEFERED
193 -- execution should be defered to background
194 -- - NOTIFIED[:<notification_id>:<assigned_user>]
195 -- activity has notified an external entity that this
196 -- step must be performed. A call to wf_engine.CompleteActivty
197 -- will signal when this step is complete. Optional
198 -- return of notification ID and assigned user.
199 -- - ERROR[:<error_code>]
200 -- function encountered an error.*/
201 PROCEDURE Create_note_for_tasks_failure ( itemtype IN VARCHAR2,
202 itemkey IN VARCHAR2,
203 actid IN NUMBER,
204 funcmode IN VARCHAR2,
205 result OUT NOCOPY VARCHAR2 ) ;
206 ---------------
207 END as_sales_meth_wf;
208