Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

0 Replies

Avatar

Employee

here is the updated bundle

https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:a9005085-7f50-4876-af8a-49a25c81b69e

I also removed the system.out.println  statements and moved them to log.debug. If you want to see the logs you can enable debug logs for this bundle

Avatar

Level 4
Hi workflowuser, I think i may have found a bug. When you use an xml schema as the adaptive form model, the repeating panel method to add attachments generates an empty ddx file. Using a single file attachment button still works however.

Avatar

Employee
can you paste the Data.xml contents from your workflow payload path after the form is submitted.

Avatar

Level 4
Sorry, how do you access the Data.xml after form submission? Is it through the CRX?

Avatar

Level 4
<?xml version="1.0" encoding="UTF-8"?> <afData> <afUnboundData> <data/> </afUnboundData> <afBoundData> <formData xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <processingInfo> <contractor/> <contractorEmail/> <contractAgency/> <contractAgencyEmail/> </processingInfo> <stdAgreementDetails> <scoID/> <agreementNumber/> <purchaseAuthNumber/> <startDate/> <endDate/> <maxAmount/> <exemption/> </stdAgreementDetails> <contractorInfo> <contractorName/> <printedName/> <contractorTitle/> <contractorBusinessAddr/> <city/> <state/> <zip/> </contractorInfo> <contractAgencyInfo> <contractAgencyName/> <printedName2/> <agencyNameTitle/> <contractAgencyAddress/> <contractCity/> <contractState/> <contractZip/> </contractAgencyInfo> <exhibitsTable> <Row1> <ExhibitA/> <TitleA/> <PageA/> </Row1> <Row2> <ExhibitB/> <TitleB/> <PageB/> </Row2> <Row3> <ExhibitC/> <TitleC/> <PageC/> </Row3> <Row4> <ExhibitD/> <TitleD/> <PageD/> </Row4> </exhibitsTable> </formData> </afBoundData> <afSubmissionInfo> <computedMetaInfo/> <stateOverrides/> <signers/> <afPath>/content/dam/formsanddocuments/assembleattachmentsoriginalwithschema</afPath> <afSubmissionTime>20200922121748</afSubmissionTime> </afSubmissionInfo> </afData>

Avatar

Level 4

and fyi, the attachments are all in the attachments folder in the payload

Avatar

Employee
in the Data.xml, I do not see any fileattachment nodes. where are the attachments?

Avatar

Level 4
Hi workflowuser, is there a cap on the number of attachments? I am testing the bank statements repeating panel. When i attach 20 attachments, the ddx is no longer generated.

Avatar

Employee

in your crx go to 

/var/fd/dashboard/payload/server0/<latest Date>/<mostrecentfolder>/

 

Avatar

Level 4
Thanks, i found the payload path. How do I retrieve the Data.xml contents?

Avatar

Employee

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>

Avatar

Level 4
Hi Giresh, i was able to resolve the repeating panel issue by adding a subform in the xdp and rewriting the schema. Thank you

Avatar

Level 4
It still does not work when there are 20 or more attachments.

Avatar

Level 9

Did you enable the log for the bundle?

check the logs it should give you more information 

Are these attachments all pdf files?

Avatar

Level 4

Here is a portion of the Data.xml after form submission:

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<afData>
    <afUnboundData>
        <data>
            <attachment1>
                <fileAttachment>1.pdf</fileAttachment>
            </attachment1>
            <attachment2>
                <fileAttachment>2.pdf</fileAttachment>
            </attachment2>
            <attachment3>
                <fileAttachment>3.pdf</fileAttachment>
            </attachment3>
            <attachment4>
                <fileAttachment>4.pdf</fileAttachment>
            </attachment4>
            <attachment5>
                <fileAttachment>5.pdf</fileAttachment>
            </attachment5>
            <attachment6>
                <fileAttachment>6.pdf</fileAttachment>
            </attachment6>
            <attachment7>
                <fileAttachment>7.pdf</fileAttachment>
            </attachment7>
            <attachment8>
                <fileAttachment>8.pdf</fileAttachment>
            </attachment8>
            <attachment9>
                <fileAttachment>9.pdf</fileAttachment>
            </attachment9>
            <attachment10>
                <fileAttachment>10.pdf</fileAttachment>
            </attachment10>
            <attachment11>
                <fileAttachment>11.pdf</fileAttachment>
            </attachment11>
            <attachment12>
                <fileAttachment>12.pdf</fileAttachment>
            </attachment12>
            <attachment13>
                <fileAttachment>13.pdf</fileAttachment>
            </attachment13>
            <attachment14>
                <fileAttachment>14.pdf</fileAttachment>
            </attachment14>
            <attachment15>
                <fileAttachment>15.pdf</fileAttachment>
            </attachment15>
            <attachment16>
                <fileAttachment>16.pdf</fileAttachment>
            </attachment16>
            <attachment17>
                <fileAttachment>17.pdf</fileAttachment>
            </attachment17>
            <attachment18>
                <fileAttachment>18.pdf</fileAttachment>
            </attachment18>
            <attachment19>
                <fileAttachment>19.pdf</fileAttachment>
            </attachment19>
            <attachment20>
                <fileAttachment>20.pdf</fileAttachment>
            </attachment20>
        </data>
    </afUnboundData>
    <afBoundData>
        <formData xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <processingInfo>
                <contractor>123</contractor>

 

 

All 20 attachments appear in the Data.xml, but the pdf is not assembled. The same problem happens with the repeating bankstatement panels in the bundle

 

Avatar

Level 9
You will need to change the parameter in the workflow step to reflect your attachment element