Get workflow id in page author mode | Community
Skip to main content
New Participant
October 1, 2020
Solved

Get workflow id in page author mode

  • October 1, 2020
  • 3 replies
  • 2960 views

Hi ,

 

Is there any way to get workflow ID in edit mode of a page when logged in as a content author. Without servlet call to query the available workflows.

 

AEM version : 6.5

 

Thanks 

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 arunpatidar

you can use resource-status api to get running workflow for current page

 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/restricting-a-page-to-be-subjected-to-workflow-only-once-at-a/m-p/250095/highlight/true#M11914

 

e.g. for content/AEM63App/fr

http://localhost:4502/resource-status/editor/content/AEM63App/fr.1.json 

 

If page is part of workflow it returns response something like below:

{"0":{"statusType":"workflow","statusPriority":10000,"shortMessage":"demo-email","variant":"info","i18n.message.snippets":["demo-email"],"title":"Workflow","message":"This page is subject to the workflow <i>{0}<\/i>"}}

 

3 replies

arunpatidar
arunpatidarAccepted solution
New Participant
October 1, 2020

you can use resource-status api to get running workflow for current page

 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/restricting-a-page-to-be-subjected-to-workflow-only-once-at-a/m-p/250095/highlight/true#M11914

 

e.g. for content/AEM63App/fr

http://localhost:4502/resource-status/editor/content/AEM63App/fr.1.json 

 

If page is part of workflow it returns response something like below:

{"0":{"statusType":"workflow","statusPriority":10000,"shortMessage":"demo-email","variant":"info","i18n.message.snippets":["demo-email"],"title":"Workflow","message":"This page is subject to the workflow <i>{0}<\/i>"}}

 

Arun Patidar
tarunrajgAuthor
New Participant
October 4, 2020

Hi @arunpatidar ,

 

I have tried the resource-status and it does the job partly i.e., I am able to get the required values when logged in as admin or approver. 

But in case of content author session, the json does not contain the workflow id (Even for the workflow the user has triggered). It contains the workflow name and status.

I will try and test by modifying the user permissions and see which level/node has the access to retrieve the value.

Currently the author is in content-author group and has "read", "modify", "create", "delete" permissions for /var/workflow.

 

Thanks for your time and response as this solves a question that I raised in the forum. 

santhosh_kumark
New Participant
October 1, 2020

Hi @tarunrajg ,

 

Hope this helps your requirement to get workflow id and enable it at the page level.

https://helpx.adobe.com/experience-manager/using/aem64_workflow_information.html

 

Regards,

Santosh

joerghoh
Employee
October 1, 2020

Hi,

do I understand you correctly, that if a user opens a page in editmode and this is part of a workflow, you would like to retrieve the workflow ID of that workflow? What would you like to do with that ID?

tarunrajgAuthor
New Participant
October 1, 2020

Hi Jörg_Hoh,

 

Yes, I need the workflow id when a page is opened in edit mode and the page is subjected to a workflow. 

 I have a requirement where a content author should be able to terminate a workflow which he has triggered. So I want to add a button/link in the status bar which calls a servlet with workflow id as parameter.