How to process multiple attachments from the Mail source activity in the process flow.
We can process Multiple attachments from Email by using complex event and Gateway condition, mail source activity in process flow designer. Following are the steps to achieve the above scenario:-
- Copy the attached jar in ext folder of AdeptiaSuite (mail-attachment-list.jar). After placing the jar, restart the Adeptia services(Kernel.exe, webrunner.exe).
- Create a complex event activity using attached (ComplexEvent.java) code.
- Update the properties (processFlowId, eventId, eventName, hostName, senderEmailId, emailSubject, fileSearchCriteria, receiverEmailId, password) in ComplexEvent code as per your mail server specification.
- Create and Put Gateway condition in the process flow designer before Mail Source activity in the process flow.
- In Gateway, edit the Sequence flow from Gateway to Mail Source activity and choose the Condition type as Java Condition in condition wizard. In Java condition, copy and paste the attached code (Condition Gateway.java)and save the condition.
- Replace the Mail Source Name with the name of mail source activity created in the below lines of Condition Gateway.java code.
- context.setActivityParameter("Mail Source Name","fileName",fileList[totalFiles - 1]);
- context.setActivityParameter("Mail Source Name","leaveCopyOnServer",true);
- context.setActivityParameter("Mail Source Name","leaveCopyOnServer",false);