How to find through code, if a given payload is in active workflow? | Community
Skip to main content
New Participant
March 2, 2017
Solved

How to find through code, if a given payload is in active workflow?

  • March 2, 2017
  • 2 replies
  • 826 views

Hi

I have a payload path like /content/world/latest-news. I want to check if this page is in any active workflow job queue. How to check that through programing?

thanks

Srini

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 joerghoh

Have you tried this already?

Resource r = ResourceResolver.get("/content/world/latest-news"); WorkflowStatus wfStatus = r.adaptTo(WorkflowStatus.class);

cheers,
Jörg

2 replies

joerghoh
joerghohAccepted solution
Employee
March 2, 2017

Have you tried this already?

Resource r = ResourceResolver.get("/content/world/latest-news"); WorkflowStatus wfStatus = r.adaptTo(WorkflowStatus.class);

cheers,
Jörg

smacdonald2008
New Participant
March 2, 2017

You can use the Workflow API described at: https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/workflow/WorkflowSession.html

Look at the method and the return values. You can get a collection of all workflows by invoking the getActiveWorkItems method and from their get all data.