Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Listner to call AEM Custom workflow

Avatar

Level 3

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.

1 Accepted Solution

Avatar

Correct answer by
Level 9

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 · G...

Thanks,

View solution in original post

3 Replies

Avatar

Correct answer by
Level 9

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 · G...

Thanks,

Avatar

Community Advisor

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...

Avatar

Level 3

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.