Highlighted

Calling Custom Workflow on Page Activation

Avatar

Avatar

Maddy737

Avatar

Maddy737

Maddy737

19-11-2016

Hi All,

Can someone help me how can i call my custom workflow process on page publishing. I have an required to call my workflow whenever page is replicated (Just to clear not on page modification but on page replication). I dont see an node type (cq:replication) in workflow launcher. 

Help will be hightly appreciated.

Replies

Highlighted

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.6K

Likes

961

Correct Answer

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.6K

Likes

961

Correct Answer

1.1K
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

~kautuk

Highlighted

Avatar

Avatar

edubey

Total Posts

1.5K

Likes

264

Correct Answer

392

Avatar

edubey

Total Posts

1.5K

Likes

264

Correct Answer

392
edubey

08-10-2017

Hi,

What you can do write up a replication preprocessor. Here is the sample implementation,

You can call your workflow inside preprocess step.

acs-aem-samples/SampleReplicationPreprocessor.java at master · Adobe-Consulting-Services/acs-aem-sa...

Thanks

Highlighted

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K
Jörg_Hoh
Employee

09-10-2017

Can you clarify your requirement a bit? Does it need to run on author or on publish? When you want to run it on author, the easiest way is probably to run all activation through the "Request for activation" workflow and add your custom step at the appropriate place.

Jörg

Highlighted

Avatar

Avatar

myanubhav

Avatar

myanubhav

myanubhav

11-02-2018

Hi Jörg,

As per the documentation, the 'Request for Activation' workflow is triggered only when the author is not having the required replication rights on the corresponding node.

However, when I remove replicate rights from a page, I don't really see the option to publish the page at all. Can you please help how can I trigger the 'Request for Activation' workflow?

Note: I am using AEM 6.3

Regards,

Anubhav

Highlighted

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K
Jörg_Hoh
Employee

13-02-2018

Maybe this has changed in Touch UI ... In Classic it did.

I would contact support regarding this topic.

Jörg