Loop workflow activities [message #179415] |
Tue, 27 June 2006 05:53  |
ying
Messages: 143 Registered: May 2002
|
Senior Member |
|
|
Hi,
Attached herewith a workflow process diagram, as I need to bring up my problem base on the workflow process diagram.
This is just a small portion of my entire workflow process. Due to the number of recipients are dynamic (as its depend on user's selection), so I have a procedure call "Get CC Email List" which will get all the recipients email address and send the notification to each of them one by one. Both the activities (Get CC Email List and Notification of E-Transfer Official Latter) will loop as long as there is valid recipient (will return "T" (True).
Well, the flow run well, and all the recipients managed to receive their notification via worklist, but they fail to receive via Email (We do implement notification mailer), as the status of the notification will be automatically changed to "Cancelled".
So, my questions are :
1.)How can I solve this problem?
2.)Is the way that I used for looping my activities acceptable? I did face problem in my program logic whereby it keep on return True and cause the activities cannot be stop.
pls advise.....
|
|
|
Re: Loop workflow activities [message #179487 is a reply to message #179415] |
Tue, 27 June 2006 11:44   |
adragnes
Messages: 241 Registered: February 2005 Location: Oslo, Norway
|
Senior Member |
|
|
Ying,
Why not just send the notification to all the recipients at the same time instead of looping? Create an ad hoc role, assign the recipients to it, send the notification to that role.
--
Aleksander Dragnes
|
|
|
Re: Loop workflow activities [message #179537 is a reply to message #179487] |
Tue, 27 June 2006 20:23   |
ying
Messages: 143 Registered: May 2002
|
Senior Member |
|
|
Thanks again for your reply. Ya, I know that it can be solved by creating an add hoc role. But the problem now is base on our User Requirements, they want the notification to be sent by displaying recipient's "Display Name" in the notification To field -means the full name of the recipient. By using role, every recipient share the same name.
pls advise.....
|
|
|
Re: Loop workflow activities [message #179574 is a reply to message #179537] |
Wed, 28 June 2006 01:48   |
adragnes
Messages: 241 Registered: February 2005 Location: Oslo, Norway
|
Senior Member |
|
|
Ying,
Your requirements seem a little odd. You have checked expand roles, right?
Anyway, if you do not want the activities to be reset upon revisit, go to the Details page on the activity properties dialogue and choose "Loop" instead of "Reset" in the On Revisit pulldown.
--
Aleksander Dragnes
|
|
|
Re: Loop workflow activities [message #179681 is a reply to message #179537] |
Wed, 28 June 2006 07:22   |
Art Metzer
Messages: 2480 Registered: December 2002
|
Senior Member |
|
|
Perhaps your requirement can be met using Oracle Workflow's master/detail functionality.
In the master/detail arrangement, you will have two processes: a master process (the parent) with an activity that will spawn your subprocesses, and the detail subprocess (the one that you'd like to call repeatedly for every individual in your CC list).
Warning: untested code:PROCEDURE activity_to_spawn_subprocesses (
itemtype IN VARCHAR2
, itemkey IN VARCHAR2
, actid IN NUMBER
, funcmode IN VARCHAR2
, resultout OUT VARCHAR2
)
IS
l_subprocess_itemtype applsys.wf_item_types.name%TYPE;
l_subprocess_itemkey applsys.wf_items.item_key%TYPE;
l_subprocess_process_name applsys.wf_activities.name%TYPE;
BEGIN
IF (funcmode = apps.wf_engine.eng_run) THEN
-- l_subprocess_itemtype is the item type where your subprocess
-- lives.
l_subprocess_itemtype := 'XXDETAIL';
-- l_subprocess_process_name is the internal name of the process
-- you are going to be calling for each individual on your CC list.
l_subprocess_process_name := 'PROCESS_EMAIL_CCLIST_MEMBER';
FOR cur IN (SELECT email_address FROM cc_list)
LOOP
-- For your subprocess, you need to generate an itemkey.
-- Since an item key has to be unique for any given item
-- type, this subprocess item key should probably be
-- derived from your E-mail address or some other primary
-- key somehow. Note, I've provided no code for this
-- generate_item_key_from_email function. That's up
-- to you.
l_subprocess_itemkey := generate_item_key_from_email (
cur.email_address);
-- Now you need to call this "create process" procedure.
apps.wf_engine.createprocess (
itemtype => l_subprocess_itemtype
, itemkey => l_subprocess_itemkey
, process => l_subprocess_process_name);
-- Here, you define the master/detail relationship between
-- your item types/item keys.
apps.wf_engine.setitemparent (
itemtype => l_subprocess_itemtype
, itemkey => l_subprocess_itemkey
, parent_itemtype => itemtype -- from this proc's input parameter
, parent_itemkey => itemkey -- from this proc's input parameter
, parent_context => NULL);
-- This procedure call actually kicks off the process.
apps.wf_engine.startprocess (
itemtype => l_subprocess_itemtype
, itemkey => l_subprocess_itemkey);
END LOOP;
END IF;
END activity_to_spawn_subprocesses; If you have Workflow for Oracle Applications, you can also have a look at $FND_TOP/patch/115/sql/WFEVPNGB.pls for an example of the master/detail Workflow relationship that Oracle provides.
|
|
|
Re: Loop workflow activities [message #179898 is a reply to message #179574] |
Thu, 29 June 2006 04:25   |
ying
Messages: 143 Registered: May 2002
|
Senior Member |
|
|
Hi,
Thanks Art Metzer for your reply, I don't think I will use your suggestion as I have no time to explore.
Aleksander Dragnes, I have not checked expand roles as I didn't use add hoc role even I managed to do so because like what I have mentioned in my previous post, our user required individual recipient's name to display in the notification's TO field.
So, I decided to go ahead with my method and set the maksimum looping base on the number of email addresses so that I can solve my problem ( I did face problem in my program logic whereby it keep on return True and cause the activities cannot be stop).
|
|
|
|