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

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

  • March 2, 2017
  • 2 replies
  • 828 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

smacdonald2008
Level 10
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. 

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe 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