Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

AEM 6.3 Override default request activation worflow

Avatar

Avatar
Validate 1
Level 2
daniel379379
Level 2

Likes

5 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
daniel379379
Level 2

Likes

5 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
daniel379379
Level 2

04-10-2017

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,159 likes

Total Posts

6,260 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,159 likes

Total Posts

6,260 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

08-10-2017

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

Answers (0)