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

Avatar

Avatar

techddx

Avatar

techddx

techddx

15-09-2020

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

 

View Entire Topic

Avatar

Avatar

workflowuser

Employee

Avatar

workflowuser

Employee

workflowuser
Employee

22-09-2020

your Data.xml should look something like this. It should have fileAttachment elements in it

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<afData>
<afUnboundData>
<data>
<tableItem11>Testing</tableItem11>
<telephonebill>
<fileAttachment>aa.png</fileAttachment>
</telephonebill>
<Row2>
<bankstatements>
<fileAttachment>adls.png</fileAttachment>
</bankstatements>
</Row2>
<idcard>
<fileAttachment>etrade.PNG</fileAttachment>
</idcard>
</data>
</afUnboundData>
<afBoundData>
<data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"/>
</afBoundData>
<afSubmissionInfo>
<computedMetaInfo/>
<stateOverrides/>
<signers/>
<afPath>/content/dam/formsanddocuments/assembleattachments</afPath>
<afSubmissionTime>20200920124211</afSubmissionTime>
</afSubmissionInfo>
</afData>