Hi ,
I have a requirement to create page version on save.
So I have created a launcher on cq:Page modifcation event. with below properties
Event : Modified
Node : cq:Page
Path : /content
excludedList : event-user-data:changedByWorkflowProcess
Workflow is using OOTB create version process step.
Do I need to consider any other approach to solve this problem or I am missing something ?
With the above solution, it creates page version on change.
Problem: when any user try to move the page , move operation fails.
@arunpatidar @SantoshSai Please suggest.
Thanks,
Sravan
Solved! Go to Solution.
Views
Replies
Total Likes
you can use PageManager API to move and create versions.
Moving operation means deleting the node and then adding the node to new location. OOB workflow launchers only supports created, modified and removed. To implement your use case to trigger the WF launcher in case of moving page would require to register a Observation event listener for Event.NODE_MOVED
observationManager.addEventListener(this, Event.NODE_MOVED, ASSET_UPDATE_PATH, isDeep, uuid, nodeTypeName, noLocal);
Here are some references:-
https://www.argildx.us/technology/triggering-a-workflow-using-event-listeners-in-aem/
https://www.north-47.com/knowledge-base/event-listener-vs-event-handler-in-aem/
Hope this helps.
Hi @Avinash_Gupta_ ,
I am not planning to use event listner. Is there any way to handle the above ask using launcher ?
Thanks,
Sravan
you can listen to jcr:content node for
PROPERTY_CHANGED for jcr:content/cq:lastModified
NODE_MOVED for jcr:content node
hi @arunpatidar ,
So you are saying , instead of workflow I should go for Event Listener. Also, Property change will be triggered for each and every property change. I want to create only one Version with the change. Any suggestions for this
Also, is there any way I can implement using workflow launcher only ?
Thanks,
Sravan
You can create workflow launcher as you suggested and create version using that workflow.
hi @arunpatidar , If I use the workflow launcher, then Move operation fails. Any suggestions to overcome that ?
you can use PageManager API to move and create versions.
Views
Likes
Replies
Views
Likes
Replies