Now able to intiate the workflow to the submiiter and approver with the same message.
but When I am submitting the worlflow again I am getting the follwoing error.
Error Name WF_DUP_ROLE
Error Message 395: Duplicate role DISPLAYROLE_Sk2 ('TESTROLE_SK2')
Error Stack Wf_Directory.CreateAdHocRole2() Wf_Directory.CreateAdHocRole() Wf_Engine_Util.Function_Call(XX_Shipg_WF.XX_Adhocusers, XXSHP, 76969, 279770, RUN)
please guide me
That happens because the activity is re-executed, you are attempting to create a duplicate. You need to validate if the role exists already or the user does have the role assigned already. This means you need to add a condition to the block to handle this scenario.
You might want to use functions WF_DIRECTORY.RoleActive('RECIPIENT') or WF_DIRECTORY.IsPerformer(<user_name>, 'RECIPIENT') to determine that and depending on the result create the role or not.
how to go about it ?
would like to create a standard role and assign users to that role . now when ever the workflow is submitted again it refers to the same role which is already available in the wf_roles and to which the users are assigned in wf_local_roles .
ex: TESTROLE_SK2 has 2 users assigne to it .
once the wf is kicked off if I want to re-submit then I see it going in to error Wf_Dup_Err.
You may want to leave the creation of the role separate from this workflow process, and maybe the assignment to the users too. It depends on your business needs: is this a do-it once only activity then use a SQL Script to create the role and assign users to role, and remove the WF_DIRECTORY calls from your plsql code.
For the error message that you have specified, this error is coming because u have not attached performer to the notification.
For this open the process where u hav attached this notification. Go to the fourth tab "Node" in the ntf.
There in the end we have Performer, select the type as "item attribute" and attach your attribute here of type role (which contains all the users whom to notified)
No, it's not a bug. You are trying to create an ad-hoc user when that username already exists.
If you are re-using a username (bad idea!), then you should check whether it exists or not before trying to create it again. If you are not, then you need to look at what you are using to ensure that the username is unique, and why that isn't working.
WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
Have you read the blog at http://www.workflowfaq.com/blog ?
WorkflowFAQ support forum: http://forum.workflowfaq.com
I am facing the same issue as above. My requirement is to send a notification to multiple users through workflow. And these users will be dynamic(pl/sql fetches these users each time the workflow is triggered). I have created an adhoc role and assigned the users to the role. When the workflow is run for the second time, got the error 'WF_DUP_ROLE'. Please guide me as to how I can avoid this error and what code should I include in the code?
As mentioned in the thread, I think I can use WF_DIRECTORY.roleActive for checking if the role is active. However, what needs to be done to assign fresh users to the role and not the old users?
comment below code then it will not give any error.
wf_directory.CreateAdHocRole(role_name => ,
wf_directory.AddUsersToAdHocRole(role_name => ' '
, role_users => ' ' );
because once you created role and assigned to user then no need to do it again and again. so comment that code and check it.