Since the suggestions here seem to involve overwriting data to the same file by every Work Unit for a process, isn't there danger that another Work Unit for the same process running concurrently could pickup the file that was written by, and therefore intended to be picked up by, a different concurrent Work Unit? Or vice versa, that another Work Unit for the same process running concurrently could write to the file before the other process had picked up the file it had written to, resulting in data being overwritten before it was picked up? Shouldn't there be some safeguard to ensure that the file written by the FileAccess node for that Work Unit was the same file picked up by only that same Work Unit? If so, how can this be done when the Email Node > Browse only allows you to specify the location of the attached file.
In other words, process A has Work Unit A and writes to file A, process A has Work Unit B writes to file A. Both Work Units get kicked off at the same time and try to write to file A, then try to pick up file A.
It errors. So I've done as you suggested, which actually involves two email nodes, one for a file that had no errors (and therefore no attachment) and one for a file that had errors (and therefore picks up the error file attachment). Once again, thanks very much for your help!
Email Email8310: Email failed with error javax.mail.SendFailedException: Attachment: \\win1362\data\General_Ledger\ErrorEmails\HCHB_GL_Errors_DateTime20165117125147_WorkUnit366.csv does not exist. at com.lawson.bpm.processflow.workFlow.flowGraph.FgaEmail.sendMailDirect(FgaEmail.java:681) at com.lawson.bpm.processflow.workFlow.flowGraph.FgaEmail.startActivity(FgaEmail.java:518) at com.lawson.bpm.processflow.workFlow.flowGraph.FgActivity.execute(FgActivity.java:845) at com.lawson.bpm.processflow.workFlow.flowGraph.FgProcess.run(FgProcess.java:2182) at com.lawson.bpm.eprocessserver.grid.ExecuteFlowImpl.executeFlow(ExecuteFlowImpl.java:374) at com.lawson.bpm.eprocessserver.grid.ExecuteFlowImpl.executeFlow(ExecuteFlowImpl.java:137) at com.lawson.bpm.eprocessserver.grid.ExecuteFlowImpl.executeFlow(ExecuteFlowImpl.java:123) at com.lawson.bpm.eprocessserver.ProcessFlowEngine.execute(ProcessFlowEngine.java:150) at com.lawson.bpm.eprocessserver.ProcessFlowEngine.startProcessAt(ProcessFlowEngine.java:101) at com.lawson.bpm.eprocessserver.KBConnection.startProcess(KBConnection.java:125) at com.lawson.bpm.eprocessserver.KBConnection.execute(KBConnection.java:95) at com.lawson.bpm.eprocessserver.KBConnection.run(KBConnection.java:75) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)