Hi,
We built a document management workflow logic using event receivers and web parts. In the custom build approval web part when a document is approved following activities happen:
1. The corresponding document is published to a major version
2. Several metadata are updated
3. Email notifications are sent to various users
4. The document is converted to a PDF or in its native format is copied into another library. All metadata in that library is set exactly same as the original one.
All the above activities now take almost a maximum of 30-40 secs. During this time the web part has an update progress running and after when these activities are completed, page is redirected to the original library. We build this solution on VS 2013 (C#) for a SharePoint 2013 Foundation site.
I am now analyzing if we can really reduce the time on these activities to say 10-15 secs. Possible code optimization were done and bottlenecks were already removed. I am thinking of a concept where all simple activities like metadata update and notifications sending happen quickly and the page is redirected to the library. The complex activities like PDF conversion, copy to another library could happen in the background and execute itself.
Any ideas on how the background execution could be achieved (may be work item timer job could be used, but not sure)? Any alternate plans could be helpful as well.
Thanks in advance
Satheesh Vijayan