38: BEGIN
39:
40: -- dbms_output.put_line ('Startprocess ');
41:
42: WF_ENGINE.CreateProcess(
43: itemtype => l_item_type,
44: itemkey => l_item_key,
45: process => workflowprocess);
46:
44: itemkey => l_item_key,
45: process => workflowprocess);
46:
47:
48: WF_ENGINE.SetItemAttrNumber(
49: itemtype => l_item_type,
50: itemkey => l_item_key,
51: aname => 'SALES_LEAD_ID',
52: avalue => p_sales_lead_id);
50: itemkey => l_item_key,
51: aname => 'SALES_LEAD_ID',
52: avalue => p_sales_lead_id);
53:
54: WF_ENGINE.SetItemAttrNumber(
55: itemtype => l_item_type,
56: itemkey => l_item_key,
57: aname =>'DAYS_TO_ACCEPT',
58: avalue => p_aging_days_noact);
56: itemkey => l_item_key,
57: aname =>'DAYS_TO_ACCEPT',
58: avalue => p_aging_days_noact);
59:
60: WF_ENGINE.SetItemAttrNumber(
61: itemtype => l_item_type,
62: itemkey => l_item_key,
63: aname =>'DAYS_TO_ABANDON',
64: avalue => p_aging_days_abandon);
62: itemkey => l_item_key,
63: aname =>'DAYS_TO_ABANDON',
64: avalue => p_aging_days_abandon);
65:
66: WF_ENGINE.SetItemAttrText(
67: itemtype => l_item_type,
68: itemkey => l_item_key,
69: aname =>'AGING_ABANDON_ACTIONS',
70: avalue => p_aging_abandon_actions);
68: itemkey => l_item_key,
69: aname =>'AGING_ABANDON_ACTIONS',
70: avalue => p_aging_abandon_actions);
71:
72: WF_ENGINE.SetItemAttrText (
73: itemtype => l_item_type,
74: itemkey => l_item_key,
75: aname =>'AGING_NOACT_ACTIONS',
76: avalue => p_aging_noact_actions);
74: itemkey => l_item_key,
75: aname =>'AGING_NOACT_ACTIONS',
76: avalue => p_aging_noact_actions);
77:
78: wf_engine.SetItemAttrNumber (
79: itemtype => l_item_type,
80: itemkey => l_item_key,
81: aname => 'ASSIGN_ID',
82: avalue => p_assigned_resource_id);
80: itemkey => l_item_key,
81: aname => 'ASSIGN_ID',
82: avalue => p_assigned_resource_id);
83:
84: wf_engine.AddItemAttr(
85: itemtype => l_item_type,
86: itemkey => l_item_key,
87: aname => 'ORIG_RESOURCE_ID',
88: number_value => p_assigned_resource_id);
86: itemkey => l_item_key,
87: aname => 'ORIG_RESOURCE_ID',
88: number_value => p_assigned_resource_id);
89:
90: wf_engine.AddItemAttr(
91: itemtype => l_item_type,
92: itemkey => l_item_key,
93: aname => 'RESOURCE_ID',
94: number_value => p_assigned_resource_id);
92: itemkey => l_item_key,
93: aname => 'RESOURCE_ID',
94: number_value => p_assigned_resource_id);
95:
96: wf_engine.AddItemAttr(
97: itemtype => l_item_type,
98: itemkey => l_item_key,
99: aname => 'BUSINESS_GROUP_ID',
100: number_value => 0);
98: itemkey => l_item_key,
99: aname => 'BUSINESS_GROUP_ID',
100: number_value => 0);
101:
102: WF_ENGINE.StartProcess (
103: itemtype => l_item_type,
104: itemkey => l_item_key );
105:
106: -- Remove the Background() call when finished testing...
104: itemkey => l_item_key );
105:
106: -- Remove the Background() call when finished testing...
107: /*
108: wf_engine.Background (
109: itemtype => l_item_type,
110: minthreshold => null,
111: maxthreshold => null,
112: process_deferred => TRUE,
111: maxthreshold => null,
112: process_deferred => TRUE,
113: process_timeout => TRUE);
114:
115: wf_engine.Background (
116: itemtype => 'ASXLABDW',
117: minthreshold => null,
118: maxthreshold => null,
119: process_deferred => TRUE,
119: process_deferred => TRUE,
120: process_timeout => TRUE);
121: */
122:
123: WF_ENGINE.ItemStatus(
124: itemtype => l_item_type,
125: itemkey => l_item_key,
126: status => l_status,
127: result => l_result);
173: -- dbms_output.put_line('DetermineStartFromProcess: '|| funcmode);
174:
175: IF (funcmode = 'RUN') THEN
176:
177: l_sales_lead_id := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey,
178: 'SALES_LEAD_ID');
179:
180: l_aging_days_noact := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey,
181: 'DAYS_TO_ACCEPT');
176:
177: l_sales_lead_id := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey,
178: 'SALES_LEAD_ID');
179:
180: l_aging_days_noact := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey,
181: 'DAYS_TO_ACCEPT');
182:
183: l_aging_days_abandon := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey,
184: 'DAYS_TO_ABANDON');
179:
180: l_aging_days_noact := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey,
181: 'DAYS_TO_ACCEPT');
182:
183: l_aging_days_abandon := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey,
184: 'DAYS_TO_ABANDON');
185: l_aging_abandon_actions := WF_ENGINE.GetItemAttrText(itemtype, itemkey,
186: 'AGING_ABANDON_ACTIONS');
187:
181: 'DAYS_TO_ACCEPT');
182:
183: l_aging_days_abandon := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey,
184: 'DAYS_TO_ABANDON');
185: l_aging_abandon_actions := WF_ENGINE.GetItemAttrText(itemtype, itemkey,
186: 'AGING_ABANDON_ACTIONS');
187:
188: l_aging_noact_actions := WF_ENGINE.GetItemAttrText(itemtype, itemkey,
189: 'AGING_NOACT_ACTIONS');
184: 'DAYS_TO_ABANDON');
185: l_aging_abandon_actions := WF_ENGINE.GetItemAttrText(itemtype, itemkey,
186: 'AGING_ABANDON_ACTIONS');
187:
188: l_aging_noact_actions := WF_ENGINE.GetItemAttrText(itemtype, itemkey,
189: 'AGING_NOACT_ACTIONS');
190:
191: OPEN c_sales_lead(l_sales_lead_id);
192: FETCH c_sales_lead INTO