get running workflow on a page

Avatar

Avatar

manishajoshi

Avatar

manishajoshi

manishajoshi

20-12-2019

How to get if there is any running workflow on a page programatically?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Dipti_Chauhan

Avatar

Dipti_Chauhan

Dipti_Chauhan

22-12-2019

Hi,

  You can adapt your current resource to WorkflowStatus and get running workflow Information for current page,

 

e.g

 

final com.adobe.granite.workflow.status.WorkflowStatus wfState = resource.adaptTo(WorkflowStatus.class);
you Can use this method to check if any running workflow

wfState.isInRunningWorkflow(false)
and wfState.getWorkflows(false); to get running workflow information.

 

Thanks

Dipti Chauhan

Answers (2)

Answers (2)

Avatar

Avatar

BrianKasingli

MVP

Avatar

BrianKasingli

MVP

BrianKasingli
MVP

23-12-2019

There are many different ways to run a workflow on a page programmatically. 

  1. Trigger workflow automatically by Sling Schedular Service. - https://helpx.adobe.com/experience-manager/using/aem-first-components1.htmlhttps://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/in...
  2. Trigger workflow automatically by workflow launchers. - https://blogs.adobe.com/contentmanagement/tag/workflow-launcher/
  3. Trigger workflow automatically by JCR event listeners. - https://helpx.adobe.com/experience-manager/using/maven_arch12_event_listener.html
  4. Trigger workflow manually from the Touch UI Site's Console . -https://docs.adobe.com/content/help/en/experience-manager-64/authoring/workflows/workflows-applying....
  5. Trigger workflow manually from the Touch UI Workflow Model's Console - https://helpx.adobe.com/uk/experience-manager/6-3/sites/administering/using/workflows-starting.html#...
  6. Trigger workflow manually from CURL command - https://github.com/paulrohrbeck/aem-links/blob/master/curl_cheatsheet.md#user-content-enable-query-d....

I hope this helps answer the question.