Highlighted

Restricting a page to be subjected to workflow only once at a time in AEM 6.3

rohits64600205

08-09-2017

Hi,

I want to restrict the AEM page to be subjected to workflow to only once. Means if I have started the workflow for a particular page I should not be allowed to start any other workflow until the workflow is completed/aborted. I can see this is happening in classic UI by default but in touch ui I was able to start multiple workflows at a time in workflow . How can I restrict in Touch Ui so that if once user starts the workflow no other user or himself can start the workflow until previous workflow is aborted/completed.  Please note I am working in AEM 6.3

Thanks in Advance

Replies

Highlighted
Highlighted

av-ey

26-09-2018

We are finding that not to be the case. I just verified that too on a 6.3 SP2 instance on my local machine. Some of the others have tested this on 6.3 SP1. Have a look at the attached screenshot that shows the community page is being workflowed twice.

1page-2wf.jpg

Thoughts?

Highlighted

smacdonald2008

26-09-2018

YOu are correct -- from the Classic UI - you can only subject a page to 1 workflow --

PageWF1.png

But in Touch UI - this is not the case. I will check with the team why these behaviors are not consistent.

Highlighted

av-ey

26-09-2018

Correct. That appears to be the case. I feel in general, there is a case that a page, at the very least, not being subject to multiple running workflows. That should be pretty simple to implement in Touch UI. It gets interesting when we talk about a workflow package where multiple resources are involved. Implement this kind of simple control for a package is that one could have multiple packages where the same resources participate. As you can imagine, with it being possible to subject a "page" to multiple workflows simultaneously is causing challenges to our authors. Our finding shows the following:

  1. Whichever version of the page via the workflow is actually published first, is the one that remains.  This is regardless of the order in which it may have been submitted into the workflow
  2. Whilst an author can submit multiple versions of the same page into a workflow, we did not encounter any bugs
  3. As well as the system preventing a page from being workflowed simultaneously, the should display a visual indicator for a page already being subject to a running workflow it is selected in Touch UI (in Column, Card or List views).

Shall we raise this as a bug with Daycare?

Thanks,

Arup

Highlighted

smacdonald2008

27-09-2018

I just talked to the Workflow Eng team. There is no restriction at the Workflow level. The restriction we see in the Classic UI is at the UI level. So Classic has it and Touch UI does not. As far as the AEM Workflow engine is concerned - it can have the same page as payloads in multiple workflows. Hope this clears it up.

Highlighted

av-ey

27-09-2018

Thanks for the clarification. What is the use case for it from an "approval" point of view? Surely the end goal, for majority of the use cases, is to have several stages of reviews followed by activation to publish instance(s). What benefit could there possibly be in having multiple workflows for the same page? I just do not see the merit of it... What is your view?

Highlighted

smacdonald2008

27-09-2018

Personally - I agree. You raise valid points - if you are routing a page through a workflow - there should only be 1 page.

Arun_Patidar

MVP

27-09-2018

Hi,

There is a way to identify whether page is part of workflow or not.

On click of create workflow , you can call js which check the workflow status using 'resource-status'

Screen Shot 2018-09-28 at 1.06.37 AM.png

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>"}}

based on response you can stop further processing to go on launch workflow screen and return error using coral alert dialog.

I didn't try this but It can be feasible.