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
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Validate 1
Level 2
techddx
Level 2

Likes

12 likes

Total Posts

65 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Validate 1
Level 2
techddx
Level 2

Likes

12 likes

Total Posts

65 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
techddx
Level 2

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
Ignite 5
Employee
workflowuser
Employee

Likes

133 likes

Total Posts

443 posts

Correct Reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

133 likes

Total Posts

443 posts

Correct Reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile
workflowuser
Employee

15-09-2020

are the form attachments getting assembled into one pdf?

techddx
Hi workflowuser, yes, the goal is to assemble all form attachments into one pdf, then have it send as a separate attachment with the Document of Record.
GirishBedekar
For now remove the send email and check if the invoke ddx step is working
workflowuser
i will have to look into it as to why it is not working. I have used custom osgi bundle which seems to work fine. If you are open to use the custom bundle to get unblocked I can send it to you. But we absolutely need to get it working using the workflow step
Kosta_Prokopiu
Somehow I wonder about the attachments coming from your AF. The DDX assembles 1 source from fileAttachment into the Attachments.pdf. According to the DDX reference manual the source is either a single document that you map or a list of documents. Looking at this I am not sure if your input map is correct. If it isn't and it cannot assemble the Attachments.pdf then that could explain your error. Test the Assember step on its own and see if you actually get a valid PDF result.
techddx
Hi Girish and Kosta, I tested the invoke ddx step by itself and it results in a failure. I suspect the issue is due to the input mapping as well. I made an ArrayList variable of type Document to hold the attachments, but the ArrayList/Document variable does not show in the Set Variable step. It does not show in the input mapping of invoke ddx either, as it only accepts a variable of type Document. FYI, this is on AEM version 6.5.4.
techddx
Hi workflowuser, i am open to using a custom osgi bundle, but would prefer to solve this with the out of the box features.
workflowuser
ok, let me send you the custom bundle to get you unblocked. By the way the custom bundle uses the publicly documented API . I will send you the bundle by EoD today