This discussion is archived
6 Replies Latest reply: Dec 9, 2012 9:19 PM by AlejandroSosa RSS

Workflow Role Issue

vishm8 Newbie
Currently Being Moderated
Hi,

I'm currently working on an issue where credit memo approval notification is being sent to a role whose value is being set at runtime based upon value retrieved by a select query.

The workflow attribute is of the type Role and the value being set is also a role name.

Now the user requires an additional user be setup who would recieve the approval notification also.

But the role name being retrieved is Global Application role not an adhoc role, hence i cannot add further users to the same role.

Can i assign two role names to the workflow attribute of the type role, which are separated by comma(,).
Would the two notification be sent out or the workflow would error out ?

Else do i need to retrieve the user assoiated with the intial role name and create a new ad-hoc using the two user-names who are to be able to view the approval notification.

My instance details are as follows,

Database Server
----------------------------------------
RDBMS : 9.2.0.4.0
Oracle Applications : 11.5.9

Regards,
Vishal
  • 1. Re: Workflow Role Issue
    SarojaKandepuneni Journeyer
    Currently Being Moderated
    You cannot assign multiple roles separated by commas to the notification recipient. You need to assign the users/role to a single role and specify the same.
    The workflow code treats the specified value as a single user/role.
  • 2. Re: Workflow Role Issue
    AlejandroSosa Journeyer
    Currently Being Moderated
    You can at runtime also add the other recipient to the original group and remove it afterwards. Or you can also modify your workflow process and add another notification activity for the other recipient.

    Regards.
  • 3. Re: Workflow Role Issue
    vishm8 Newbie
    Currently Being Moderated
    I have resolved the issue by creating an adhoc role and assigned the user from the original role along with the additional recipient to the adhoc role.

    Now i'm able to send the notification to both the end-users as requested.
  • 4. Re: Workflow Role Issue
    vishm8 Newbie
    Currently Being Moderated
    As per the advise i have incorporated the logic to create an adhoc-role to which i assign the two users who are to recieve the notification.

    But when i test run the workflow, the notification is assigned the performer the value of the adhoc-role i created.

    But only one user receives the notification. But when i check the wf_notifications table the status = 'CLOSED' and Mail_Status = 'SENT'.

    I have checked the mail preference as well the e-mail setup for both the users. Everything is setup as it should be.

    Please advise as to what else could be wrong with the adhoc-role solution to my issue.

    The following is the logic through which i create an adhoc-role,
    wf_directory.createadhocrole(role_name,role_display_name);
    wf_directory.adduserstoadhocrole(user_name1);
    wf_directory.adduserstoadhocrole(user_name2);
    Any help is much appreciated !!

    Regards,
    Vishal

    Edited by: vishm8 on Dec 7, 2012 6:07 PM
  • 5. Re: Workflow Role Issue
    SarojaKandepuneni Journeyer
    Currently Being Moderated
    looks like 'user_name2' is overriding the 'user_name1'.

    The following is the way to add multiple users to a adhoc role

    declare
    l_users varchar2(100):='user_name1 user_name2' ;
    begin

    WF_DIRECTORY.AddUsersToAdHocRole (
    role_name => 'TESTROLE1',
    role_users => l_users
         );
    commit;
    end;

    role_name --> ad hoc role name for which users has to be added
    role_users --> individual user names to be added to the role separated with space.
  • 6. Re: Workflow Role Issue
    AlejandroSosa Journeyer
    Currently Being Moderated
    In Workflow builder check the Notification properties. Ensure the check box Expand Roles is checked.

    Regards.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points