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:
List mimetype = patExecContext.getProcessDataListValue("/process_data/attachmentsMimeType");
List fileNames = patExecContext.getProcessDataListValue("/process_data/attachmentsNameslist");