Hi,

during the creation of a business process, and adding a script task process element (C# code) to it to link a record to an activity section, causes the business process to run several times longer than without C# code.  How can I speed up this process?

I need to speed up the process of sending a notification to the email.  Is there any way to see what slows down this process?

is used Servis enterprise 7.16.3.1473, Interaction with mail by exchange listener.

var EmailSender = new Terrasoft.Configuration.EmailWithMacrosManager(userConnection);
EmailSender.SendEmailFromTo(caseId, templateId, sender0, ContactMail);
return true;

Thank you, 

Elena

Like 0

Like

3 comments

Hi Elena,

 

Most time (up to 10 seconds) will be taken by the actual email sending. This can be only optimized by making the template weight lighter. Additionally you can try running the process in the background (start element should have the enabled "Run process in the background" checkbox) so it couldn't load the page when it's executed.

Oscar Dylan,

The template uses minimal text and macros, there are no images. Runs in the background. It was tested and revealed that when using a process element “send email”, the business process works much faster, but it is not tied to the details of the email. Can I somehow view why it takes so long or view the execution trace?

Gabrielyan Elena Vageevna,

 

If you need to log how much time did the script-task that calls the method takes time to execute then you can display the "Duration, seconds" column in the "Process elements" detail of the process log record. If you need to track the code lines execution time than you need to add additional lines of code between each original code line that will track the current time and log it somewhere (for example using DateTime.Now.ToString("h:mm:ss tt") and logging the result to a string parameter that can be then viewed or in the process trace or can be displayed in the autogenerated page).

Show all comments