Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Synchronization AEM workflows by used payLoad

Avatar

Former Community Member

Hi, guys! I need to solve problem:
If there are active workflows for an particular resource (payload) new workflow start/creation should be rejected. I use CQ5.5 It provides checking only if workflows started from siteadmin ("Page is already subject to a workflow!"). I need that checking also for others starting types : f.e. from workflow console or by launcher. Any ideas?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Night Elephant wrote...

Hi Sham,

Thank you for reply!

I need validation for any start workflow possibility. As I can see in my CQ5.5 instance, siteadmin makes GET request with payload as param "isInWorkflow" to /bin/workflow.json which responses with boolean flag "status" (it is just checking lockIsDeep and lockOwner properties on corresponding node and preventing new workflow creation). So it is not client side checking, right? Ideally I need to substitute /bin/workflow.json logic and adding that request for workflow console (as it implemented on siteadmin). But, actually I don't know how to do this. 

As possible solution, I can adding MyNewLockingProcess at the beginning of every workflow which will fail duplication workflows and MyNewUnLockingProcess at the end of every workflow


 

 


Hi Night elephant,

Overlay [1] and check if payload is part of workflow. 

As i informed earlier server side not implemented yet, You might need to include MyNewLockingProcess, MyNewUnLockingProcess on all workflow models.

[1]   /libs/cq/workflow/widgets/source/widget/ModelsPanel.js

Thanks,

Sham

View solution in original post

8 Replies

Avatar

Level 10

Hi Night Elephant,

    Currently validation for duplicate workflow is checked at client side & not at server side.  File an official support request asking for server side validation with valid business case.
    If your use case is only for workflow console then implement validation logic at client side in starting workflow dialog.
    
Thanks,
Sham
Twitter: @adobe_sham

Avatar

Employee

Hello,

Workflow launchers already check for a running workflow which match the payload and worklfow model before launching a new one.  You should not need to do anything there.

I don't think there is an easy way to add this functionality to the workflow console without overriding the post servlet that is used to start the workflow.  This would be a fairly complicated task.  Which users are starting workflows from the workflow console consistently?  Perhaps they could use one of the other UIs like siteadmin or dam to start workflows instead?

Will

Avatar

Former Community Member

Will, thank you a lot!

Perhaps they could use one of the other UIs like siteadmin or dam to start workflows instead?

Yes, maybe they can. 

But actually I also need more restricted checking. For example, if one workflow instance use "/content/category/sport" then others can't be started with payloads "/content/category/sport", "/content/category", "/content", "/content/category/sport/football" and so on but can be started with "/content/category/music", "/content/category/sport/hockey" and so on. Is there any way to change default workflow synchronization behavior?

 

Avatar

Former Community Member

Hi Sham,

Thank you for reply!

I need validation for any start workflow possibility. As I can see in my CQ5.5 instance, siteadmin makes GET request with payload as param "isInWorkflow" to /bin/workflow.json which responses with boolean flag "status" (it is just checking lockIsDeep and lockOwner properties on corresponding node and preventing new workflow creation). So it is not client side checking, right? Ideally I need to substitute /bin/workflow.json logic and adding that request for workflow console (as it implemented on siteadmin). But, actually I don't know how to do this. 

As possible solution, I can adding MyNewLockingProcess at the beginning of every workflow which will fail duplication workflows and MyNewUnLockingProcess at the end of every workflow


 

Avatar

Level 10

You will have to override the existing workflow behavior to check the payload. Instead of the actual payload, you might have to take all the payload which contains the string of your payload.

Avatar

Correct answer by
Level 10

Night Elephant wrote...

Hi Sham,

Thank you for reply!

I need validation for any start workflow possibility. As I can see in my CQ5.5 instance, siteadmin makes GET request with payload as param "isInWorkflow" to /bin/workflow.json which responses with boolean flag "status" (it is just checking lockIsDeep and lockOwner properties on corresponding node and preventing new workflow creation). So it is not client side checking, right? Ideally I need to substitute /bin/workflow.json logic and adding that request for workflow console (as it implemented on siteadmin). But, actually I don't know how to do this. 

As possible solution, I can adding MyNewLockingProcess at the beginning of every workflow which will fail duplication workflows and MyNewUnLockingProcess at the end of every workflow


 

 


Hi Night elephant,

Overlay [1] and check if payload is part of workflow. 

As i informed earlier server side not implemented yet, You might need to include MyNewLockingProcess, MyNewUnLockingProcess on all workflow models.

[1]   /libs/cq/workflow/widgets/source/widget/ModelsPanel.js

Thanks,

Sham

Avatar

Former Community Member

You will have to override the existing workflow behavior to check the payload

Ye, the question is how to to do it?