Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Using watched folder

Avatar

Former Community Member
Hi, I'm having problems with watched folder endpoint.<br /><br />I have a very simple process which consists of one activity - assign task and I want to start this process by copying a PDF to specified folder. I've added a watched folder endpoint for this process and it automatically created appropriate sub folders (input, result, failure etc.).<br /><br />The problem starts when I copy a PDF file to the input folder. LiveCycle picks up the file but the process doesn't start. PDF gets moved to the failure folder and the failure.log shows the reason:<br /><br />ALC-DSC-119-000: com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: <document description here> of type: com.adobe.idp.Document to type: class com.adobe.idp.taskmanager.form.impl.xfa.XFARepositoryFormInstance<br /><br />What am I doing wrong?<br /><br />Thanks<br />Bartek
6 Replies

Avatar

Level 10
When you create your watch folder endpoint, you have to map some of the input variables for your process to a file pattern.



This will take the file matching the pattern and put it in that variable. Now the variable type needs to be the right type to receive the file.



From your error, it looks like you're trying to put a PDF file in a xfaForm variable, which wouldn't work. You need to put the PDF in a document variable.



So, make sure in your process that you have an input document variable. Then in your watch folder configuration, when you map your input varibale to a file pattern, make sure you select literal and a pattern like *.pdf



Jasmin

Avatar

Former Community Member
That was it.

Thanks :)



Now the question is: how to extract data from submitted PDF?

Can it be done with XPath or do I have to use things like XPAAJ?



Bartek

Avatar

Level 10
There is two ways you can do that. There is an operation from the Form service called processFormSubmission. The operation is able to take data out of a submitted PDF.



There is also an operation from the Form Data Integration (under Common) called exportData that can do that.



We do not recommend XPAAJ because is not supported by Adobe and not more effort/development is being done to it.



Jasmin

Avatar

Level 9
Hi Jasmin

What's the different between processFormSubmission and exportData?

howard

Avatar

Level 10
processFormSubmission returns a FormsResult object that might gives you more information depending how the form was rendered.



If you render in HTML or Guide, you get information like the button clicked, you can go to a next page, run server side validations.



If you render a PDF, processFormSubmission gives you a little bit of information on the PDF like if the form contains file attachments, get the size of the documents, number of pages, things like that.



If you just want to get the data out and are not interested in anything else, then exportData should be good enough.



Jasmin

Avatar

Former Community Member
OK, exportData should be sufficient for now.

Thanks a lot.