SOLVED: BPM keep sending the same emails over and over again (Loop issue)

We have one BPM that huse to send email alerts under certain conditions. For some reason, after some of the code was chagned, it caused a loop and now users are flooded with emails coming from E10.

We have reverted the BPM to the old code, we have restarted both app servers but as soon as they come back online, the emails starts again.

Is there a queue somewhere we can look at? How can we stop this?

Thanks,

What’s the code?

The BPM is now turned off but the email flood continues. I don’t think the problem is with the code… we are trying to find the source of where the email are coming from.

Well, if it’s on a BPM, the BPM must be getting triggered from something. Is it a data directive or method?

Its a method.

What method? You’re not giving me much to go on here :slight_smile:
Sharing your code would be helpful, because as you stated, there was a code change and then this problem happened.

My programmer is extracting the code, I will send it soon.

When a BPM send an email alert, is the email queued somewhere in the database?

Code:

callContextBpmData.Character01 = β€œβ€;
callContextBpmData.Character02 = β€œβ€;
callContextBpmData.Character03 = β€œβ€;
callContextBpmData.Character04 = β€œβ€;
callContextBpmData.Character05 = β€œβ€;
callContextBpmData.Character06 = β€œβ€;
callContextBpmData.Character14 = β€œβ€;
callContextBpmData.Character15 = β€œβ€;
callContextBpmData.Character16 = β€œβ€;
callContextBpmData.Character17 = β€œβ€;
callContextBpmData.Character18 = β€œβ€;
callContextBpmData.Checkbox01 = false;

string strSalesRepCode = β€œβ€;
string strCompany = β€œβ€;
string strTaskDesc = β€œβ€;
string strCustomer = β€œβ€;
int intHDCaseNum = 0;
string strProjectID = β€œβ€;
string strComment = β€œβ€;
string strPMName = β€œβ€;
string strUserID = callContextClient.CurrentUserId;
bool blEmailShouldBeSent = true;
string strEmlSubject="";
string strEmlBody="";

int intCounter = -1;
bool blnGotIn = false;

foreach(var rowTask in ttTask)
{
intCounter++;
if (intCounter == callContextBpmData.Number01)
{
blnGotIn = true;

	strSalesRepCode = rowTask.SalesRepCode;
	strCompany = rowTask.Company;
	intHDCaseNum = Convert.ToInt32(rowTask.Key1);
	strTaskDesc = rowTask.TaskDescription;
	strComment = rowTask.TaskComment;				

	/////////////////////////////////////////////////////////...do more stuff//////////////////////////////////////////////
}

}

if (!blnGotIn)
{
callContextBpmData.Number01 = -1;
}
else
{
callContextBpmData.Number01++;
}

To answer your first question, it does not queue in the database. The BPM Send Mail action creates a mail client within the code. The β€œCustom Code Block” object in the BPM is simply a class.
Ok so you are setting some stuff inside a foreach loop based on ttTask. Have you verified the contents of the ttTask object?
Secondly, do you know what part of this code changed from before?

SOLUTION: All the emails created by a loop inside a BPM were queued inside these 2 tables:

ice.MailQueue
ice.MailQueueBody

There was 1994000 emails still waiting to be processed. We cleared it up and we were able to stop the flood of emails.

Thanks to Joe Grafner from E10 Support that pointed us where to look.

2 Likes

Crazy! Great info thought.

Thanks for your help today Jose!

1 Like