Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


srilatha
2021-04-13T23:52:45Z
Hi,

I have a job where it has file trigger with 3 different filenames. when the user drops the files in the source folder the job get triggered and uploads the file in destination folder and sends email to the user as success. The problem is if the user drops 3 files the job gets triggered 3 times and user gets 3 mails after the upload. Is there is a way to get only one email after the 3 files are uploaded successfully?

Thanks in advance
Sponsor
Forum information
thomas
2021-04-15T10:18:39Z
As far as I know, there is no easy way of solving this problem. It may be possible to do it with some custom logic, but I think it will get ugly very quickly.
In the flow section, we have onSuccess and onComplete, but they will fire after each job run (3 times in your case). There should be a OnTriggerComplete event or something like that for these kind of problems

Gary_W
2021-04-15T18:29:20Z
Check out the condition tab on the e-mail task. Depending on how you have tasks set up, perhaps you can set a condition on the e-mail that it will only send if all 3 files have been received and uploaded. I'm not sure how you will know that though in order to satisfy the condition. Perhaps the files are archived so the condition can check for the existence of the archived files? only send e-mail if all 3 expected files are present. Something like that.
Joey S
2021-04-19T22:32:20Z
Do you ONLY want one email when all three files have arrived?

or asked another way (to stress another part of the question)...Do you ONLY want one email when all THREE files have arrived?

Scenario 1
If you want the software to send one email/file if the files are spaced out by X sec but send one email when they are not, then you can accomplish that with a trigger deactivation.
Trigger on, for example, *.txt and Under the "Expires" tab you set the trigger to expire after one time

Then have a Task (probably at the end of your job) to re-enable the Trigger but with a "Wait" as the task right before that
It would run like this
Files Dropped
Trigger Fires once and becomes inactive
Task 1 - Email
Task 2 = Copy task
Task 3 = Email
Task 4= Wait for 60 seconds
Task 5 = Copy Task (again, because more files may have shown up in the 60 seconds)
Task 6 = Reactivate the trigger

Now when multiple files are dropped in any one minute period only one email and one set of tasks are run. If more files come in within that 60 seconds they still get copied

Scenario #2
You want to ONLY copy and email and whatever else WHEN all 3 files exist

That is much easier. You set the dependency on 3 files to exist. The job will not run UNTIL all three show up
Go into your trigger, set the THREE triggers for the three specific files and then click on "Dependencies"



MSchwartz
2021-04-21T19:53:59Z
Another way to do this:

  • Instead of a file trigger, have a time trigger that runs every five minutes.
  • For the first task, disable erroring if no files are found. Add a flow that stops the job if no files are found.
  • The job will now upload all files every five minutes and send a single email.
Support
2021-04-22T11:45:18Z
Originally Posted by: srilatha 

Hi,

I have a job where it has file trigger with 3 different filenames. when the user drops the files in the source folder the job get triggered and uploads the file in destination folder and sends email to the user as success. The problem is if the user drops 3 files the job gets triggered 3 times and user gets 3 mails after the upload. Is there is a way to get only one email after the 3 files are uploaded successfully?

Thanks in advance



There are some excellent suggestions in this thread, did you manage to get it working using any of them?
Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
Scroll to Top