Hi, i want to trigger a workflow, which creates a new version of an asset when the user publishes the asset. to achieve this i created a model which has the following steps 1) flow start, 2) Activate Page/Asset, 3) create version 4) Flow end. and then i created a launcher to launch. it is working fine, but when the user modifies any metadata (we have custom or dam or dc) the launcher is triggered. we already have DAM Meta Data write back workflow that is triggered when the metadata is modified and this also creates a new version. so now when the user is modifying any metadata, both the workflows are triggered and 2 versions are created.
any ideas as to how to restrict my workflow launcher to publish only??
Solved! Go to Solution.
Views
Replies
Total Likes
I found out the solution. adding this "jcr:content/cq:lastReplicationAction==ACTIVATE" to the conditions in the workflow launcher fixed the issue.
just wanted to add, this is a on-prem AEM instance
Views
Replies
Total Likes
@ASP_Corp invoke this workflow/ service from within an event listener that listens to replication events. when an asset is published, it will create a replication event that you can then listen to and invoke your workflow/logic to create asset versions.
Refer to the below on how to create an event listener
https://aemhints.com/2020/11/08/event-listener-in-aem-6-5/
@Harwinder-singh , thank you for the reply, but isnt there a simple way to restrict my workflow launcher via conditions, exclusion..etc??. like trigger my workflow via launcher when the quick publish or manage publish is clicked?, writing a class for a rather simple scenario is a bit overkill i think.
Views
Replies
Total Likes
@ASP_Corp considering extensibility in mind, i doubt if that is an overkill. Also, when you plan to move to AEM as cloud service, you will have to switch to post processing workflows instead of launcher based implementations. Food for thought.
Views
Replies
Total Likes
Hi @Aditya_Chabuku , this is just a general configuration for workflow launcher, iam looking at specific configuration so that my workflow gets triggered only when the asset is published. thank you.
@Harwinder-singh , agreed. and this is one of the reasons our clients are cautions to migrate to AEM cloud.
Views
Replies
Total Likes
I found out the solution. adding this "jcr:content/cq:lastReplicationAction==ACTIVATE" to the conditions in the workflow launcher fixed the issue.