Creating Role and attaching role in Oracle Workflow


If there is requirement that you have to send a notification to some users in a group you can use this AdHocRole concept so you can stitch a group of users and attach to one role.

In the below code wf_directory.CreateAdHocRole creates a new role and we loop the users and send it to wf_directory.AddUsersToAdHocRole so that users will b attached to the particular role

lc_adhoc_role3 := ‘DPC_MAITENANCE_SUPERVISOR’||itemkey;
wf_directory.CreateAdHocRole(       role_name                 => lc_adhoc_role3,
role_display_name         => lc_adhoc_role3);

for i in c1(‘DPC Maintenance Engineer’) loop
wf_directory.AddUsersToAdHocRole(   role_name                 => lc_adhoc_role3,
role_users                => i.USER_NAME
);
end loop;
wf_engine.setitemattrtext (itemtype   => itemtype,itemkey    => itemkey,aname      => ‘DPC_MAITENANCE_SUPERVISOR’,avalue     => lc_adhoc_role3);

Make sure the attribute type is ROLE instead of text and call the above line to assign the role programmatically

About pacesettergraam

A good and realistic person

Posted on October 21, 2015, in oracle apps and tagged , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: