Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Combining PDF Attachments with DDX, then send separately with Document of Record in AEM OSGi Workflow

Avatar

Level 4

I have a dynamic number of pdf attachments as input from an adaptive form, and would like to merge all attached pdfs into a single pdf using DDX, then have it send separately with the Document of Record with the Send Email step. However I encountered an issue with the Send Email step with the following: 

 

Caused by: com.adobe.granite.workflow.WorkflowException: GetPropertyValue failed as value corresponding to VARIABLE:attachments for type class java.lang.Object is NULL

 

 

The DDX is as follows:

 

<DDX xmlns="http://ns.adobe.com/DDX/1.0/"> 
    <PDF result="Attachments.pdf"> 
         <PDF source="fileAttachment"/> 
    </PDF> 
</DDX>

 

 

Input map for invoke ddx:

The "attachment" path matches the output attachment folder of the adaptive form

techddx_0-1600213093578.png

Output map:

The output document is saved into the "attachments" document variable

techddx_1-1600213301535.png

Send Email step with Document of Record and attachments document:

techddx_2-1600213476906.png

 

 I am unsure why the value for attachments is NULL. Any help on this is appreciated, thank you!

 

EDIT - testing workflowuser's process:

The following is the dynamic table with file attachments. The ordering is PDFs 1,2,3,4, but the resultant PDF from the process gives ordering 2,3,4,1. 

techddx_0-1600299274726.png

 

1 Accepted Solution

Avatar

Correct answer by
Level 9

please log a support ticket with Adobe if you are having problems with 20 or more attachments in the form

View solution in original post

59 Replies

Avatar

Level 4

I have changed the arguments, and i still get the issue. It works when there are 18 attachment elements, but not when there are more.

techddx_0-1600904073390.png

The same problem happens in the repeating bankstatements panel. It works when there are less than 20 attachments

techddx_0-1600904263431.png

 

 

Avatar

Level 9
Ok let me give you a updated bundle with NoForms element

Avatar

Correct answer by
Level 9

please log a support ticket with Adobe if you are having problems with 20 or more attachments in the form

Avatar

Level 9

Is that a common use case of attaching 20 pdf files?

Avatar

Level 4
It is an uncommon use case, but there may be times where there are 20+ attachments.

Avatar

Employee Advisor
I think I found the problem. it was in my code. I was limiting my search to 20 . I can change the max search results to 100 and give you the updated bundle if you need

Avatar

Level 9

As a workaround have two repeating panel’s. The first panel you can allow users to add a maximum of say 12 attachments 

In the second panel they can add another 8 attachments and submit the form 

this is working for me 

Avatar

Employee Advisor

Here is the latest bundle

https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:6c353e00-1139-48c6-b8b3-5bd4abda5fd5

I have increased the size of my query to 100

Your workflow step should look like this

workflowuser_0-1602102827925.png

 

Avatar

Level 4
Hi workflowuser, I tested the new bundle and there are no issues with 20+ attachments. Thank you!

Avatar

Level 4
Hi workflowuser, is it possible to make a slight change to the bundle? Currently, the process only supports the assembly of static document, and breaks when a dynamic document is attached. From the DDX reference guide, it suggests the use of the NoForms element as the child of the PDF element. Is it possible for you to add the NoForms element to each PDF element, so the bundle supports dynamic documents as well? Thank you for all your help.

Avatar

Level 9

I have also added bookmarks to the assembled pdf 

open the assembled pdf using Adobe reader and check the bookmarks 

Avatar

Employee Advisor

The updated custom bundle  which allows you to assemble xfa based form is now available and can be downloaded from here

custom bundle

 

The entire article is available on experience league 

Avatar

Level 4
Thank you! This is unrelated, but is it possible for secured PDFs to be merged with DDX without their passwords? The use case would be similar to Adobe Sign, where all attachments can be rendered and merged regardless if they are secured or not.

Avatar

Level 9

Are you able to assemble secured pdf using Acrobat?

Avatar

Level 4
No, I am unable to since it requests for a password when combining

Avatar

Employee Advisor
we can add it as a package of documents, but not assemble together