1 2 Previous Next 24 Replies Latest reply: Jul 31, 2013 11:09 PM by jagadekara Go to original post RSS
      • 15. Re: Sending the same Notification to multiple users
        675082
        Done ,
        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

        shashnk
        • 16. Re: Sending the same Notification to multiple users
          Alejandro Sosa
          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.
          • 17. Re: Sending the same Notification to multiple users
            675082
            Hi Alendrao

            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.

            Regards

            Shask
            • 18. Re: Sending the same Notification to multiple users
              Alejandro Sosa
              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.
              • 19. Re: Sending the same Notification to multiple users
                675082
                Hi ,

                Is this a bug in adhoc role related workflow. in metalink issues raised for this don't seem to be answered .
                Caan we dyanmically created adhoc role each time we submit within the worklflow .

                Regards,
                Shask
                • 20. Re: Sending the same Notification to multiple users
                  797795
                  Hi
                  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)


                  Rupali
                  • 21. Re: Sending the same Notification to multiple users
                    NoLongerActive
                    Hi,

                    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.

                    HTH,

                    Matt
                    -----
                    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
                    • 22. Re: Sending the same Notification to multiple users
                      675082
                      Yeah ,

                      the issue is resolved . Thanks for the continous support.

                      Regards,
                      Skg
                      • 23. Re: Sending the same Notification to multiple users
                        883543
                        Hi,
                        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?

                        Please help.

                        Thanks,
                        Gowthami.
                        • 24. Re: Sending the same Notification to multiple users
                          jagadekara

                          Hai,

                           

                          comment below code then it will not give any error.

                           

                                                        wf_directory.CreateAdHocRole(role_name => ,

                                                                                                      role_display_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.

                          1 2 Previous Next