Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Have you tried this already?

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

cheers,
Jörg

View solution in original post

2 Replies

Avatar

Level 10

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. 

Avatar

Correct answer by
Employee Advisor

Have you tried this already?

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

cheers,
Jörg