Skip to main content
TheBigRed
New Participant
July 28, 2016

Event listener with a Workflow Launcher

  • July 28, 2016
  • 17 replies
  • 5072 views

Hello,

I have workflow launcher active on a directory.

Also have a custom event listener set on the same directory. The event listener moves files to a different folder.

Problem is the workflow is interfering with the event listener as the event listener can't move the files since it's in a workflow.

How to work around this?

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

17 replies

joerghoh
Employee
September 11, 2017

What is your requirement, that you want to move things around while potentially at the same time a workflow is started for it?

Kind regards,

Jörg

ebin_Aby
New Participant
September 13, 2017

We wanted to create a tools page to delete a node eg ecom data node , where we will have a button to request deletion and once it is approved by workflow process the node is deleted and replicated to publish server .

joerghoh
Employee
September 13, 2017

Hi,

I think I understand your usecase, but at which point comes this EventHandler into the play?

kind regards,
Jörg

smacdonald2008
New Participant
July 29, 2016

Are you referring Java logic that implements javax.jcr.observation.EventListener?

TheBigRed
TheBigRedAuthor
New Participant
August 3, 2016

smacdonald2008 wrote...

Are you referring Java logic that implements javax.jcr.observation.EventListener?

 


Yes I am.

TheBigRed
TheBigRedAuthor
New Participant
August 3, 2016
This is the error I'm receiving, I'm guessing my event listener is moving the file before DAM XMP Writeback is finished? com.day.cq.workflow.WorkflowException: execute: cannot set last modified, asset [{/content/dam/rogers/rpl_brandpublications/prism/CHE_20160701_1785745288_prism.xml/jcr:content/metadata}] in payload doesn't exist for workflow [{VolatileWorkItem_node1_etc_workflow_instances_server0_2016-08-03_1_dam-xmp-writeback_660}]. at com.day.cq.dam.core.process.AssetSetLastModifiedProcess.execute(AssetSetLastModifiedProcess.java:202) at com.day.cq.workflow.compatibility.CQWorkflowProcessRunner.execute(CQWorkflowProcessRunner.java:93) at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:189) at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:244) at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:500) at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:291) at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:58) at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:227) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)