get running workflow on a page | Community
Skip to main content
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 Dipti_Chauhan

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

3 replies

Dipti_Chauhan
Community Advisor
Dipti_ChauhanCommunity AdvisorAccepted solution
Community Advisor
December 23, 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

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
December 23, 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/index.html?org/apache/sling/commons/scheduler/Scheduler.html
  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.html
  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#TouchOptimizedUI
  6. Trigger workflow manually from CURL command - https://github.com/paulrohrbeck/aem-links/blob/master/curl_cheatsheet.md#user-content-enable-query-debug-log.

I hope this helps answer the question.