Listner to call AEM Custom workflow | Community
Skip to main content
Level 2
September 12, 2017
Solved

Listner to call AEM Custom workflow

  • September 12, 2017
  • 3 replies
  • 2416 views

I am creating a custom workflow that will upload multiple images in DAM using Asset manager API. These images are located at external location so if any new file arrived at that location I need to watch that and invoke custom workflow to start copy images to DAM.

Would like to know How to create a listener that will watch this folder and invoke workflow?OR if there is any solution to implement this approach. I am using workflow because after uploading images to AEM JCR , need to send it for approval and publish to production.

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 MC_Stuff

Hi peterw13024062

Since the folder is external you might need to nice native listener rather than at aem.   Instead make use scheduler to check the external folder, if found matching new files upload into dam & default dam update asset workflow will trigger.

acs-aem-samples/ClusterAwareScheduler.java at master · Adobe-Consulting-Services/acs-aem-samples · GitHub

Thanks,

3 replies

MC_Stuff
MC_StuffAccepted solution
Level 10
September 12, 2017

Hi peterw13024062

Since the folder is external you might need to nice native listener rather than at aem.   Instead make use scheduler to check the external folder, if found matching new files upload into dam & default dam update asset workflow will trigger.

acs-aem-samples/ClusterAwareScheduler.java at master · Adobe-Consulting-Services/acs-aem-samples · GitHub

Thanks,

viveksachdeva
Community Advisor
Community Advisor
September 12, 2017

If your external system is dropbox, you can use Dropbox REST API to get delta content and then fetch/upload assets to DAM.

Dropbox - Core API - endpoint reference . In case you are using something else, you can check if there is some API available for that...

Level 2
September 18, 2017

Thanks for this wonderful Solution. I followed above approach and created scheduler to read new files. Its working fine.

But would like to know if there is any way I can save Last ran time of scheduler? Because requirement is that scheduler should pickup only new files from folder after last ran.

we are archiving and cleaning files from folder every 2 week but pushing files every hours or 2 hours whenever receiving new files.