AEM Watch Folders | Community
Skip to main content
Level 4
Jun 6, 2017 6:21 AM UTC
Solved

AEM Watch Folders

I am trying to create a simple Watch Folder:

1) Take input of an XML file

2) Create a PDF using XML and XDP (Using "Generate Non-Interactive PDF") - Using a workflow

3) Write PDF to output folder

The workflow works (I've tested it).

The Watch folder gives a PathNotFound Exception on the payload:

crx:/etc/fd/watchfolder/staging/watch-folder/Pxc70daf9d779acfdd9e95d9bf/report.xml'

However, if I pause the Workflow instance using a "Participant Step", I can see that the input XML has actually written to the path:

crx:/etc/fd/watchfolder/staging/watch-folder/Pxc70daf9d779acfdd9e95d9bf/input/report.xml'

Is this a bug?

Additionally - the documentation is quite unclear - there is a setting on the Watched Folder "Payload Mapper Filter" which is not described

AEM 6.3 Forms Help | Watched folder in AEM Forms

I can't see how to get a file output from the Watched Folder...

Caused by: com.adobe.granite.workflow.WorkflowException: com.adobe.granite.workflow.WorkflowException: com.adobe.fd.output.internal.exception.OutputServiceException: AEM_OUT_001_003:Unexpected Exception: Error of type 'javax.jcr.PathNotFoundException' thrown on attempting operation 'CONNECT' on URL 'crx:/etc/fd/watchfolder/staging/watch-folder/Pxc70daf9d779acfdd9e95d9bf/report.xml'. Message = [Node with path /etc/fd/watchfolder/staging/watch-folder/Pxc70daf9d779acfdd9e95d9bf/report.xml does not exist.]

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Tim_Goodman_BTEAccepted solution
Level 4
Aug 13, 2017 10:55 PM UTC

Sorry looping back - solved the problem.

The Watched folder Output folder pattern needed to be set to:  %F.pdf

As mentioned, this is a common use case that should be in the online documentation

12 replies

Level 4
May 1, 2019 11:47 PM UTC

Ah, yes - I see the problem you are facing.  Yes, in this example I hardcoded the input filename, I can't remember if the use payload option worked

I think I solved this already (it was a while ago!) - let me have a look and I'll reply on the other thread

Translate
Level 2
May 1, 2019 5:08 PM UTC

Thanks for the reply on an old post.  I made a new thread with my full question since I think I'm getting into something different.

Regarding your suggestions, I don't believe I am or should be dealing with subfolders beyond including "input/" in the workflow input.  I don't how to tweak folderPath and includeFilePattern to make the workflow look into a specific path.  I imagine I want to include everything for testing purposes so I left includeFilePattern wide open.

Translate
Level 4
May 1, 2019 6:19 AM UTC

It sounds like you are setting the input to include a subfolder

I think you'll need to use separate attributes for folderpath and includeFilePattern

also note that I think that a subfolder called "input" is created under your folder path automatically

Translate
Level 2
Apr 29, 2019 4:48 PM UTC

This has frustrated me for weeks, so thank you for sharing.

Setting workflow input to "input/<file.extension>" seems to work only if you know what the input file name is.  Is there a way around this?

I've tried "input/%F.pdf", "input/%F.%E", "input.pdf", "*.pdf", "input", the 'use payload' setting, etc.  All throw the same or similar error about not finding the node.

Translate
Level 4
Jun 3, 2018 10:46 PM UTC

Wow - old post!

The Watch Folder functionality allows for another system to generate asynchronous file transformations without actually ingesting the file into the JCR. 

This functionality originally existed in LiveCycle (which was the forerunner to AEM Forms).  There are clients that still want to perform this kind of transformation

Translate
briankasingli-4
Level 2
Jun 1, 2018 3:13 PM UTC

Hello Tim,

Can you please give me a use case to why you would want to use a watch folder?

Couldn't we just set a launcher to watch a folder in DAM assets for any file uploads?

Translate
Level 4
Aug 13, 2017 10:58 PM UTC

Additionally, in the workflow:

Input: 

  • Set to relative to Payload folder
  • input/report.xml

Output

  • Under Payload folder
  • output/output.pdf
Translate
smacdonald2008
Level 10
Aug 13, 2017 10:56 PM UTC

Thank you for posting solution!

Translate
Tim_Goodman_BTEAuthorAccepted solution
Level 4
Aug 13, 2017 10:55 PM UTC

Sorry looping back - solved the problem.

The Watched folder Output folder pattern needed to be set to:  %F.pdf

As mentioned, this is a common use case that should be in the online documentation

Translate
Employee
Aug 11, 2017 1:07 PM UTC

Recreated the issue looking into it and will report back.

Translate