Hi , Could you please print the ddx in log file and check it, if its correctly build. ( paste the log snippet & build DDX in case its still not working - the image and details of error message above are not clear.) , i just tried below DDX, & its work fine for me.
Using workbench process variables, so if you are using WB execute script, below is a simple, sample script I used, where I have attachments in a list. kindly test with a simple use case like below & i hope it helps.
if there are attachments in list,
> get the filename and mimetype ,
>put the sourceDoc in map with numeric key
> put attachmentDocs with numericKey, appended by 1, (so you can iterate here to append all documents of list)
> then you can build the DDX in execute script like:
import java.util.*;
import java.util.Iterator;
List mimetype = patExecContext.getProcessDataListValue("/process_data/attachmentsMimeType");
List fileNames = patExecContext.getProcessDataListValue("/process_data/attachmentsNameslist");
HashMap myMap =patExecContext.getProcessDataMapValue("/process_data/assemblerMap");
System.out.println("***** About to generate DDX***********************");
String ddx = "<DDX xmlns='http://ns.adobe.com/DDX/1.0/'>\n";
ddx += "<PDF result='finalPDF.pdf'>\n";
ddx = ddx + "<PDF source='sourceDoc'/>\n";
for (int i=1;i<myMap.size();i++){
ddx = ddx + "<FileAttachments source = '" + i + "'>\n";
ddx = ddx + "<File filename= '" +fileNames.get(i-1)+ "' mimetype= ' " + mimetype.get(i-1) + "'/>\n";
ddx = ddx+ "</FileAttachments>\n";
}
ddx = ddx + "</PDF>\n</DDX>\n";
System.out.println("***** ddx: " + ddx);
patExecContext.setProcessDataStringValue("/process_data/@ddxString ", ddx);
paste the log snippet & build DDX in case its still not working