cancel
Showing results for 
Search instead for 
Did you mean: 

Howto disable the Invitation workflow?

max12
Champ in-the-making
Champ in-the-making
I need to avoid that the invitation workflow is started when a user gets invited to a site.
For the user to be able to contribute to the site will be handled programmaticaly.

So how can I deactivate this built in workflow?

Thanks
5 REPLIES 5

mrogers
Star Contributor
Star Contributor
I don't think there is any "easy" configuration option that you can simply turn off.   It will require some code changes.

croc
Champ in-the-making
Champ in-the-making
just like mrogers said. i am sure starting a workflow is a separate functionality, that you just call functions or methods when you want to use it. So in some of the file you just need to comment out, where that is called. It is possible, but you need to edit the right files.

gric
Champ in-the-making
Champ in-the-making
Hi,
  thanks for sharing your thoughts, but more than saying it's not easy, is it possible to have some clues ?
I mean, I think this functionality (invite users to Share Sites) must be customizable. It seems quite obvious this workflow should be customer oriented.
So, even if it needs code changes, can someone give basic first steps on how to hook this workflow :mrgreen: ?

Thanks.

gric
Champ in-the-making
Champ in-the-making
Concerning the original problem, I propose here one solution.
As you may have noticed it, "inviting" groups to Share Sites does not produce any workflow, it actually just set the membership of the whole group to the site. Inviting users uses another webscript, named invitations. It consists in triggering a jBPM workflow, which I am - unfortunately - unable to edit.

Hence, my solution to max12 problem is very basic : it consists in using the same webscript 'groups' use (FYI, basically it just calls this).
In '/components/invite/invitationlist.js', replace :
Alfresco.util.Ajax.request(
         {
            url: Alfresco.constants.PROXY_URI + "api/sites/" + this.options.siteId + "/invitations",
            method: "POST",
            requestContentType: "application/json",
            responseContentType: "application/json",
            dataObj:
            {
               invitationType: "NOMINATED",
               inviteeUserName: record.getData('userName') || "",
               inviteeRoleName: record.getData('role'),
               inviteeFirstName: record.getData('firstName'),
               inviteeLastName: record.getData('lastName'),
               inviteeEmail: record.getData('email'),
               serverPath: serverPath,
               acceptURL: 'page/accept-invite',
               rejectURL: 'page/reject-invite'
            },
            successCallback:
            {
               fn: success,
               scope: this
            },
            failureCallback:
            {
               fn: failure,
               scope: this
            }
         });

with this :
Alfresco.util.Ajax.request(
         {
           url: Alfresco.constants.PROXY_URI + "api/sites/" + this.options.siteId + "/memberships",
            method: "POST",
            requestContentType: "application/json",
            responseContentType: "application/json",
            dataObj:
            {
               person:
               {
                  userName: record.getData('userName')
               },
               role: record.getData('role')
            },
            successCallback:
            {
               fn: success,
               scope: this
            },
            failureCallback:
            {
               fn: failure,
               scope: this
            }
         });

And, using the yui compressor, generate your "-min.js" equivalent (java -jar yuicompressor.jar myfile.js > myfile-min.js).
Override the original JS script the way you want (ugly override, AMP, or JAR) - that did the trick for me.
I just hope the invitation process is planned to be editable.

Regards.

sofia
Champ in-the-making
Champ in-the-making
Thank you Grlc your answer is very helpful , I ve tried it , and it works fine