Skip to main content

Hi

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.

 

Task(send_status_email) which sends email with attachment

 

Process Flow Design Page

 

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.

process Monitor window
SMTP_Connector Input Parameters
Procee Action - Write_disk file input Parameters

 

Need Some Suggestions from some expert who can help to complete this Task.

If this information is not sufficient ,Please free to reach me .

Regards, 

Sujit

Hi Sujit,

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?


Process Actions Functionaly code

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 .

 

 

 

Regards,

Sujit


Hi Sujit,

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.

Example query

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:

set @file_data = null
set @file_location = null

Hope this helps!


Functionality code for Decision & SMTP_CONNECTOR

 


Looks like for the other decision you have emptied the variable, but I was talking about the decision_attachment_to_disk code


Code for attachment to disk

I have set null value for both the variables @file_data &@file_location at Top/Upper

Procees Monitor Window

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


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 


Yes my code cycle through @email_id

 

Regards,

Sujit


Will there every be a situation where @email_id is empty/NULL? That seems to be the issue here for what I can see.


@Mark Jongeling  in my case, @email_id will not be Null/Empty,

 


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


Condition code with’

Getting Error in Process Monitor for write file Process Action


-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.


Hi,

Code Responsible to send SMTP_Connector Process action
Have Declared both the Variables under Process action attachment to disk

 


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.