Support Article

Create PDF attachment is not sent in the email

SA-36494

Summary



User created a flow for sending email with PDF attachment, but createpdf takes time while send email executes so there is no attachment is coming with mail ,

For that user added a wait shape between "createpdf" and "sendEmail", in Wait shape user had set the time has 1 minute and selected the “permit end user perform” checkbox.

With this user is getting the attachment in mail, but when clears “permit end user perform” option, it halts the flow.

User is looking for solution without using wait shape.


Error Messages



Not Applicable


Steps to Reproduce



1.Create a process with CreatePDF and Send Email as steps.
2. In Send Email configure with Email provider details.
3. Run the case.
4. Notice the mail attachment will not be attached.


Root Cause



The problem is occurring because the PDF which got created wasn't committed before the send email smart shape.

As there are no commits happening until the end of the flow, the email is being sent without attachments.

The use case worked with the WAIT shape is because, on selecting the "Permit the end user action", the user is prompted to submit the wait shape assignment and which is making a COMMIT.

The Create PDF shape would create PDF and attaches as part of the next available commit or at least before the flow closes.

As per the existing design of the smart shapes, Pega does not allow multiple commits in the flow for the sake of performance.

In order to resolve this issue, add an assignment or make an explicit COMMIT by adding an utility and calling a new activity which in turn calls the commitWithErrorHandling API.

Resolution



Perform the following local-change:

Add an assignment or make an explicit COMMIT by adding an utility and calling a new activity which in-turn calls the commitWithErrorHandling API to resolve this issue.


Published April 13, 2017 - Updated May 2, 2017

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.