32
Views
4
Comments
Solved
Processes: send mail when everything is done
Application Type
Traditional Web
Service Studio Version
11.10.9 (Build 38312)
Platform Version
11.11.0.26979

Hi all !


I'm using the PROCESSES for the first time and I'm using them to print some PDF reports.


This is my situation:


- FIRST PROCESS > contains the query "SELECT customer_code FROM ..." (more then 400 records) >  for every customer I run the second process


- SECOND PROCESS > create a PDF report and save it in a folder


The system works great running 400 PROCESSES at the same time: the time of PDF creation is awesome !


Now ... I miss the last "step": I would like to send an email when ALL MY 400 ACTIVE INSTANCES are done. Which is the best way to control it ?

I tried to create a "Callback action" (On Activity Close) on my SECOND PROCESS but it's now working ...


Any suggestion ?

Thanks !

Rank: #245
Solution

If i understand correct you have a main process that starts 400 other processes. and you want to send a mail when al those processes are done.


Since you don't know howmany processes the main process will start in design time, i would recommend you build in a wait. 

1- You can have this wait wait a given amount of time after which you can check if all processes are done. If not wait another nr of seconds/minutes and try again. when successfull: send the mail.

2 - you can have the wait respond to a record creation or update. How you build this in your application is up to you, but i am sure you will find a way. If not, let me know.


Good luck!


Hi Luca,

I hope you are well!

I see this is for a traditional web application so it is therefore pretty straight forward :) 

Create an email on the interface tab (you don't have to use the Email flow) and fill in your desired html content.

Then create a server action which sends off the email to the desired recipients. Use the send email action available in the left hand pane and specify your email which you previously created as the email you would like to send.


Now add this server action to your process and it should be good to go! 

Hope this helps.

Nicholas

Rank: #245
Solution

If i understand correct you have a main process that starts 400 other processes. and you want to send a mail when al those processes are done.


Since you don't know howmany processes the main process will start in design time, i would recommend you build in a wait. 

1- You can have this wait wait a given amount of time after which you can check if all processes are done. If not wait another nr of seconds/minutes and try again. when successfull: send the mail.

2 - you can have the wait respond to a record creation or update. How you build this in your application is up to you, but i am sure you will find a way. If not, let me know.


Good luck!


Rank: #4317

Thank you Stefano !!! It works like a charm !


I put a wait of 1 minute: every minute I make the count the processes with Process_Def_Id = X ... when the number of rows is 0 I send the email


Grazie mille !

Rank: #245

No problem. Happy coding.


You could also consider doing that check after finishing each pdf creation and when its the last one, send a signal (record update or create) that gets picked up by the timer.


Please mark my post as solution so others can use it in time.