39: workflowprocess VARCHAR2(30);
40: TaskName VARCHAR2(256);
41:
42: issue_msg fnd_new_messages.message_text%TYPE;
43: textVarNameArray Wf_Engine.NameTabTyp; -- Array of Text Attribute Names
44: textVarValArray Wf_Engine.TextTabTyp; -- Text Array of Item Attribute Values
45: numVarNameArray Wf_Engine.NameTabTyp; -- Array of Numeric Attribute Names
46: numVarValArray Wf_Engine.NumTabTyp; -- Number Array of Item Attribute Values
47:
40: TaskName VARCHAR2(256);
41:
42: issue_msg fnd_new_messages.message_text%TYPE;
43: textVarNameArray Wf_Engine.NameTabTyp; -- Array of Text Attribute Names
44: textVarValArray Wf_Engine.TextTabTyp; -- Text Array of Item Attribute Values
45: numVarNameArray Wf_Engine.NameTabTyp; -- Array of Numeric Attribute Names
46: numVarValArray Wf_Engine.NumTabTyp; -- Number Array of Item Attribute Values
47:
48:
41:
42: issue_msg fnd_new_messages.message_text%TYPE;
43: textVarNameArray Wf_Engine.NameTabTyp; -- Array of Text Attribute Names
44: textVarValArray Wf_Engine.TextTabTyp; -- Text Array of Item Attribute Values
45: numVarNameArray Wf_Engine.NameTabTyp; -- Array of Numeric Attribute Names
46: numVarValArray Wf_Engine.NumTabTyp; -- Number Array of Item Attribute Values
47:
48:
49: CURSOR c_tasks is
42: issue_msg fnd_new_messages.message_text%TYPE;
43: textVarNameArray Wf_Engine.NameTabTyp; -- Array of Text Attribute Names
44: textVarValArray Wf_Engine.TextTabTyp; -- Text Array of Item Attribute Values
45: numVarNameArray Wf_Engine.NameTabTyp; -- Array of Numeric Attribute Names
46: numVarValArray Wf_Engine.NumTabTyp; -- Number Array of Item Attribute Values
47:
48:
49: CURSOR c_tasks is
50: select *
55:
56: BEGIN
57: resultout :='COMPLETE:N';
58: -- Get current global attributes to run next WF task!
59: CurrtaskSeq := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
60: Itemkey => ItemKey,
61: aname => 'TASKSEQ');
62: ACID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
63: Itemkey => ItemKey,
58: -- Get current global attributes to run next WF task!
59: CurrtaskSeq := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
60: Itemkey => ItemKey,
61: aname => 'TASKSEQ');
62: ACID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
63: Itemkey => ItemKey,
64: aname => 'ACID');
65: ACNAME := wf_engine.GetItemAttrText(Itemtype => ItemType,
66: Itemkey => ItemKey,
61: aname => 'TASKSEQ');
62: ACID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
63: Itemkey => ItemKey,
64: aname => 'ACID');
65: ACNAME := wf_engine.GetItemAttrText(Itemtype => ItemType,
66: Itemkey => ItemKey,
67: aname => 'ACNAME');
68: ownerID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
69: Itemkey => ItemKey,
64: aname => 'ACID');
65: ACNAME := wf_engine.GetItemAttrText(Itemtype => ItemType,
66: Itemkey => ItemKey,
67: aname => 'ACNAME');
68: ownerID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
69: Itemkey => ItemKey,
70: aname => 'OWNERID');
71: respID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
72: Itemkey => ItemKey,
67: aname => 'ACNAME');
68: ownerID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
69: Itemkey => ItemKey,
70: aname => 'OWNERID');
71: respID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
72: Itemkey => ItemKey,
73: aname => 'RESPID');
74: respAppID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
75: Itemkey => ItemKey,
70: aname => 'OWNERID');
71: respID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
72: Itemkey => ItemKey,
73: aname => 'RESPID');
74: respAppID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
75: Itemkey => ItemKey,
76: aname => 'RESPAPPID');
77: owner := wf_engine.GetItemAttrText(Itemtype => ItemType,
78: Itemkey => ItemKey,
73: aname => 'RESPID');
74: respAppID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
75: Itemkey => ItemKey,
76: aname => 'RESPAPPID');
77: owner := wf_engine.GetItemAttrText(Itemtype => ItemType,
78: Itemkey => ItemKey,
79: aname => 'FNDUSERNAM');
80: InstanceID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
81: Itemkey => ItemKey,
76: aname => 'RESPAPPID');
77: owner := wf_engine.GetItemAttrText(Itemtype => ItemType,
78: Itemkey => ItemKey,
79: aname => 'FNDUSERNAM');
80: InstanceID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
81: Itemkey => ItemKey,
82: aname => 'INSTANCEID');
83: TaskID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
84: Itemkey => ItemKey,
79: aname => 'FNDUSERNAM');
80: InstanceID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
81: Itemkey => ItemKey,
82: aname => 'INSTANCEID');
83: TaskID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
84: Itemkey => ItemKey,
85: aname => 'TASKID');
86:
87: WorkflowProcess := 'PUBLISH_WORKFLOW';
89: charDate := to_char(sysdate, 'MM/DD/YYYY-HH24-MI-SS');
90: newItemKey := rtrim(substr(ACName, 1, 50), ' ') || '-' || to_char(ACID) || '-' || to_char(CurrtaskSeq+1) || '-' || workflowprocess || '-' || charDate;
91: -- +============================================================+
92: -- Create WF start process instance
93: wf_engine.CreateProcess(ItemType => ItemType,
94: itemKey => newItemKey,
95: process => WorkflowProcess);
96:
97: -- Get the short text from fnd messages
109:
110: textVarNameArray(4) := 'FNDUSERNAM';
111: textVarValArray(4) := owner;
112:
113: Wf_Engine.SetItemAttrTextArray(Itemtype => ItemType,
114: Itemkey => newItemKey,
115: aname => textVarNameArray,
116: avalue => textVarValArray);
117:
129:
130: numVarNameArray(5) := 'TASKID';
131: numVarValArray(5) := TaskID;
132:
133: Wf_Engine.SetItemAttrNumberArray(Itemtype => ItemType,
134: Itemkey => newItemKey,
135: aname => numVarNameArray,
136: avalue => numVarValArray);
137:
138: --If the session has been interrupted, reset the Context.
139:
140: -- +============================================================+
141: -- Now that all is created and set START the PROCESS!
142: wf_engine.StartProcess(ItemType => ItemType,
143: ItemKey => newItemKey);
144:
145: resultout := 'COMPLETE:Y';
146: EXCEPTION
197:
198: issue_msg fnd_new_messages.message_text%TYPE;
199: no_issue_msg fnd_new_messages.message_text%TYPE;
200:
201: textVarNameArray Wf_Engine.NameTabTyp; -- Array of Text Attribute Names
202: textVarValArray Wf_Engine.TextTabTyp; -- Text Array of Item Attribute Values
203:
204: CURSOR c_recipient is
205: select NAME, value
198: issue_msg fnd_new_messages.message_text%TYPE;
199: no_issue_msg fnd_new_messages.message_text%TYPE;
200:
201: textVarNameArray Wf_Engine.NameTabTyp; -- Array of Text Attribute Names
202: textVarValArray Wf_Engine.TextTabTyp; -- Text Array of Item Attribute Values
203:
204: CURSOR c_recipient is
205: select NAME, value
206: from ZPB_TASK_PARAMETERS
215:
216: v_datasources c_datasources%ROWTYPE;
217:
218: BEGIN
219: l_owner := wf_engine.GetItemAttrText(Itemtype => ItemType,
220: Itemkey => ItemKey,
221: aname => 'FNDUSERNAM');
222: l_resp_id := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
223: Itemkey => ItemKey,
218: BEGIN
219: l_owner := wf_engine.GetItemAttrText(Itemtype => ItemType,
220: Itemkey => ItemKey,
221: aname => 'FNDUSERNAM');
222: l_resp_id := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
223: Itemkey => ItemKey,
224: aname => 'RESPID');
225: l_user_id := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
226: Itemkey => ItemKey,
221: aname => 'FNDUSERNAM');
222: l_resp_id := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
223: Itemkey => ItemKey,
224: aname => 'RESPID');
225: l_user_id := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
226: Itemkey => ItemKey,
227: aname => 'OWNERID');
228: l_respapp_id := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
229: Itemkey => ItemKey,
224: aname => 'RESPID');
225: l_user_id := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
226: Itemkey => ItemKey,
227: aname => 'OWNERID');
228: l_respapp_id := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
229: Itemkey => ItemKey,
230: aname => 'RESPAPPID');
231: l_ACNAME := wf_engine.GetItemAttrText(Itemtype => ItemType,
232: Itemkey => ItemKey,
227: aname => 'OWNERID');
228: l_respapp_id := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
229: Itemkey => ItemKey,
230: aname => 'RESPAPPID');
231: l_ACNAME := wf_engine.GetItemAttrText(Itemtype => ItemType,
232: Itemkey => ItemKey,
233: aname => 'ACNAME');
234: InstanceID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
235: Itemkey => ItemKey,
230: aname => 'RESPAPPID');
231: l_ACNAME := wf_engine.GetItemAttrText(Itemtype => ItemType,
232: Itemkey => ItemKey,
233: aname => 'ACNAME');
234: InstanceID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
235: Itemkey => ItemKey,
236: aname => 'INSTANCEID');
237: TaskID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
238: Itemkey => ItemKey,
233: aname => 'ACNAME');
234: InstanceID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
235: Itemkey => ItemKey,
236: aname => 'INSTANCEID');
237: TaskID := wf_engine.GetItemAttrNumber(Itemtype => ItemType,
238: Itemkey => ItemKey,
239: aname => 'TASKID');
240:
241: l_start_pos := 1;
334: textVarValArray(8) := l_owner;
335: call_status := FND_REQUEST.add_notification(l_owner);
336: END IF;
337:
338: Wf_Engine.SetItemAttrTextArray(Itemtype => ItemType,
339: Itemkey => ItemKey,
340: aname => textVarNameArray,
341: avalue => textVarValArray);
342: