Variable watched folder input with OSGi workflow | Community
Skip to main content
Level 2
May 1, 2019
Solved

Variable watched folder input with OSGi workflow

  • May 1, 2019
  • 2 replies
  • 2454 views

(AEM Forms 6.4 on JEE)

I am using a watched folder configured with an OSGi workflow that has a single OOTB Forms 6.4 step "Secure Document" that applies ARES credentials.  My goal is to drop a PDF with a variable file name into the watched folder and get an extended PDF with the same name as output.

The workflow runs successfully by itself.  The workflow + watched folder combo only succeeds if I specify the exact file name as relative input in the workflow ("input/form1.pdf"; "input" being the CRX node created when the folder ingests an item)—something I learned from this thread.  That seems to defeat the purpose.  If I set the input to a different path or "Use Payload", the watched folder errors out and says the following CRX path does not exist or has "no content":

etc/fd/watchfolder/staging/<watchedfoldername>/<long guid>/<input path specified in workflow>

I've tried many combinations of wildcards.  Is variable file name input possible here or should I look elsewhere?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Tim_Goodman_BTE

I just checked - you can't just "Use Payload" as it refers to the entire payload folder (even though its only one file!)

Reading the documentation - it looks like you need to create an additional custom step - this could get the first file in the payload folder, and then pass that as a variable. 

This is referenced in the documentation Adobe Experience Manager Help | Watched folder in AEM Forms  as "Create Payload Mapper Filter to map structure of a watched folder to the payload of a workflow"

I guess this caters for the fact we could have multiple documents at times during the process

Apologies I haven't tried it, but have a look and see if that helps 

2 replies

Tim_Goodman_BTEAccepted solution
Level 4
May 2, 2019

I just checked - you can't just "Use Payload" as it refers to the entire payload folder (even though its only one file!)

Reading the documentation - it looks like you need to create an additional custom step - this could get the first file in the payload folder, and then pass that as a variable. 

This is referenced in the documentation Adobe Experience Manager Help | Watched folder in AEM Forms  as "Create Payload Mapper Filter to map structure of a watched folder to the payload of a workflow"

I guess this caters for the fact we could have multiple documents at times during the process

Apologies I haven't tried it, but have a look and see if that helps 

ak_gfbAuthor
Level 2
May 2, 2019

That makes more sense.  Given my circumstances I might not be able to test this and might have to use Workbench to get a similar outcome, but I'll mark as answered.  If I do test and wrap my brain around it, I'll update this thread.

Thank you very much for your help.