SOLVED: Too many emails generated when using SEARCH_COUNT

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
bwalk
Posts: 54
Joined: Thu May 10, 2018 12:10 am

SOLVED: Too many emails generated when using SEARCH_COUNT

Post by bwalk »

Good Day Devs,
I'm working on a process that sends out an email for each 'task' BO that is DUE but does not have an Overseer assigned.
I have 3 such DUE tasks and in debug I get those 3 records put in context. But when the emails are sent I get 6 emails, not the 3 that I'm expecting.
I get 3 emails for 1 task, 2 emails for the 2nd task and 1 email for the last task.
Any ideas what I'm doing wrong? Thx
Attachments
2024-04-11_08-02-48.jpg
2024-04-11_08-02-48.jpg (29.35 KiB) Viewed 220 times
Last edited by bwalk on Fri Apr 12, 2024 4:05 am, edited 1 time in total.
kklosson
Posts: 1628
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: Too many emails generated when using SEARCH_COUNT

Post by kklosson »

I recommend using the test log to see how many records are found by the FIND action. That will point you a bit.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
bwalk
Posts: 54
Joined: Thu May 10, 2018 12:10 am

Re: Too many emails generated when using SEARCH_COUNT

Post by bwalk »

Thank you kklosson ,
I have used the 'debug' feature and I can see that the FIND does find the 3 records that are DUE.
hpl123
Posts: 2604
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Too many emails generated when using SEARCH_COUNT

Post by hpl123 »

It is my experience that Aware sometimes executes processes 2 times even though it shouldn't and I can't see it in any logs. This could possibly be something similar i.e the process runs 2 times. Try splitting the sends up e.g do find in batches of processing instead and see if that works as it should.
Henrik (V8 Developer Ed. - Windows)
bwalk
Posts: 54
Joined: Thu May 10, 2018 12:10 am

SOLVED Re: Too many emails generated when using SEARCH_COUNT

Post by bwalk »

hpl123, thank you for your response,
I added 'IN BATCHES OF 1' to the end of my FIND and IT WORKS! I get the correct number of emails!
Cant' say that I understand it but it fixes the problem.
Thank you all for your comments, been working on this for days and days!
?? Should this be reported to Vladimir as a bug? ?
hpl123
Posts: 2604
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: SOLVED Re: Too many emails generated when using SEARCH_COUNT

Post by hpl123 »

bwalk wrote: Fri Apr 12, 2024 3:31 am hpl123, thank you for your response,
I added 'IN BATCHES OF 1' to the end of my FIND and IT WORKS! I get the correct number of emails!
Cant' say that I understand it but it fixes the problem.
Thank you all for your comments, been working on this for days and days!
?? Should this be reported to Vladimir as a bug? ?
Sure, no worries and Aware acts in mysterious ways sometimes and regarding some of these issues, they are more or less impossible to reproduce as they happen sporadically etc. + some of it is a "blackbox" e.g Java etc. running and we have limited if any insight into what is happening behind the scenes. I usually report something if I have experienced it many times and can somewhat reproduce it and these issues with process running 2 times is reported sometime in the past by me and/or others but I can´t remember the specifics. Another thing is, the question is also always if it really is a bug. Sometimes the rule engine does things that makes sense from the rule engines perspective but we don´t understand it and can´t see everything in the logs or we use functions and we think we know how it works but it works differently etc. so then we have to more look at what exactly is happening instead i.e what is the result and then work around it instead e.g use the IN BATCHES OF 1 thing you did now if we can´t get it working the way it "should" according to AwareIM, the manual etc..
Henrik (V8 Developer Ed. - Windows)
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: SOLVED: Too many emails generated when using SEARCH_COUNT

Post by aware_support »

There was a bug in 9.0 that has been fixed in the latest build 3249
Aware IM Support Team
Post Reply