We’ve created a Task under ‘email Table’ that will send email & document as an attachment to the Receiver email id when over email_status=’open’ in the Email table.
When we Start that task to send email - In The process Flow Monitor 1st time the process action are Excutes in this way start_tab_task → decision → decision_attachment_to_disk → write_file,
After the write_file Process Action ,an infinite loop will run which always then Go to process action (decision_attachment_to_disk → write_file) from where the process flow Nevers Go to the Process Action SMTP_Connector.
Need Some Suggestions from some expert who can help to complete this Task.
If this information is not sufficient ,Please free to reach me .
Best answer by Erwin EkkelView original
I send you a teams meeting request to have a look together, i think that will be more efficient. If you are not available then please suggest a date and time by denying the request.
-2 - Unsuccessful (no path specified)
The File location does not get calculated correctly, Both file data and the file location should have a valid value when writing a File; maybe empty files could be written but most likely that is not the requirement.
Getting Error in Process Monitor for write file Process Action
That would then means the else will never be entered unless both file_data and file_location are both empty for the given email_id, which I suspect would never be the case:
Either this IF statement has to be different, or another column/value has to decide that the Process flow should continue to the SMTP connector
Will there every be a situation where @email_id is empty/NULL? That seems to be the issue here for what I can see.
Yes my code cycle through @email_id
Does your code cycle through @email_id's or is this value never changed? If it never changes, the writing will happen again and again for the same email
I have set null value for both the variables @file_data &@file_location at Top/Upper
But Still getting the same infinite loop between process action(write_file & decision_attachent_to_disk) while trying to executes Through Process Monitor…
Needs some suggestions from you
Looks like for the other decision you have emptied the variable, but I was talking about the decision_attachment_to_disk code
Thanks for the lightning speed reaction. I do see the issue. The variables for File data and File location are never emptied. When filling them initially, the values will stay there until overwritten. But the select query that sets these variables does not reset them if there's no email to send.
Due to the 1 = 0 where clause, no result will come out of the first query, thus not resetting the variable. The second one will as there will be a result. This works the same with join clauses.
My advice is to reset the variables in the upper region of your code like, so the value is no longer there upon the query that will set these variables once again:
Hope this helps!
Here we have written Code for 4 Process Action .Above attachment code to Retrive/Fetch File_Data(or File_Name) & File_Location from document & document_reference Table .
Your Decision process action should have a process procedure with code. This code must decide which way the Process flow should go in every situation, otherwise it will always choose the first step in its list - which may cause the infinite loop as you described.
The decision_attachment_to_disk has to decide when go to write a file, or when to go send an email. As I don't see any word describing this process action and what it does, brings me to believe it doesn't function as intended. Could you share some code fragments?