Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

AEM 6.3 Override default request activation worflow

Avatar

Former Community Member

Hi,

I created a custom workflow for the request activation of a page. It's equals at the default workflow, but before activate the page, I added a custom step.

My question is what's the correct way to call my workflow instead of that default.

The solution I thinked and I'm implementing is to override "/libs/wcm/core/content/sites/publishpagewizard" (that is the button "Publish page" in the sidekick in a page), recreating the wizard under "/apps/wcm/core/content/sites/publishpagewizard" and rebuilding the same xml structure, changing only the following properties on the node "/jcr:content/body/items/form/items/wizard/items/publishstep/items/fixedColumns/items/fixedColumn1/items/references": requestActivationWorkflow and scheduleActivationWorkflow. In this way it seems to work and it calls my workflow. But it's correct? The reason of my doubts is because in this way I'm forced to replicate the entire structure of these wizard (publishpagewizard but consequently also the managepublicationwizard, that is the other way to publish now or later a page through the relative button in sites.html), so if with an instance update or an hotfix the structure has changes, it could create me problems.

The other related question is how to trigger the direct activation? Because I need for that custom step I added in my workflows also in the direct activation, that for default calls the servlet "/bin/replicate.json". Otherwise I could change the replicationUrl (an other property under that wizard node), call a custom servlet that does that custom step and then calls the default servlet.

Thank you in advance, Daniel

1 Accepted Solution

Avatar

Correct answer by
Administrator

This would need a custom implementation. I would look at using workflows as part of this solution.

Write code that iterates through pages using JCR API or QueryBuilder API. Then when you find a page that meets your criteria, invoke a workflow (that activates the page) using an API.

You can invoke workflows programmatically. See: http://scottsdigitalcommunity.blogspot.ca/2013/09/creating-workflows-for-adobe-experience.html

You may need to write a custom workflow step as well to perform time operations (if you want to wait 30 mins for example)\. However, AEM is very flexible in letting you write custom workflow steps. TO learn how to write a custom workflow step that implements,

WorkflowProcess see:

https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html

More reference:- http://wemcode.wemblog.com/get_asset_reference_in_page



Kautuk Sahni

View solution in original post

1 Reply

Avatar

Correct answer by
Administrator

This would need a custom implementation. I would look at using workflows as part of this solution.

Write code that iterates through pages using JCR API or QueryBuilder API. Then when you find a page that meets your criteria, invoke a workflow (that activates the page) using an API.

You can invoke workflows programmatically. See: http://scottsdigitalcommunity.blogspot.ca/2013/09/creating-workflows-for-adobe-experience.html

You may need to write a custom workflow step as well to perform time operations (if you want to wait 30 mins for example)\. However, AEM is very flexible in letting you write custom workflow steps. TO learn how to write a custom workflow step that implements,

WorkflowProcess see:

https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html

More reference:- http://wemcode.wemblog.com/get_asset_reference_in_page



Kautuk Sahni