Triggering workflow upon page deactivation | Community
Skip to main content
Level 3
Oct 16, 2015 2:28 AM UTC
Solved

Triggering workflow upon page deactivation

Dear All,

I have a requirement where I need to trigger a custom workflow upon page deactivation. Author is expected only to deactivate page and I should internally trigger my workflow. Can someone please suggest with some sample code. 

I tried with EventHandler but FramworkUtil is not having a method - getBundle to get the bundle context. I am using osgi coe version 4.3.0 

Please provide some code example whcih I can use or refer.

Thanks,

Ravi

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
joerghoh
joerghohAccepted solution
Employee
Oct 16, 2015 2:28 AM UTC

Hi,

if your author does not have the "replicate" privilege, the logic behind the "deactivate" buttons invokes the "request for deactivation" workflow by default (at least in Classic UI, haven't tested with TouchUI yet). And then you can customize this workflow.

kind regards,
Jörg

8 replies

akshat_jain09
Level 2
Mar 4, 2019 6:15 AM UTC

Hey

I tried this approach for an asset deactivation for the same requirement as that of Ravi.

I added a custom step in the "Request for Deactivation" workflow, but the changes did not reflected. However they reflect for the "Schedule deactivation of page/asset" workflow.

Can you please suggest the fix?

Translate
joerghoh
joerghohAccepted solution
Employee
Oct 16, 2015 2:28 AM UTC

Hi,

if your author does not have the "replicate" privilege, the logic behind the "deactivate" buttons invokes the "request for deactivation" workflow by default (at least in Classic UI, haven't tested with TouchUI yet). And then you can customize this workflow.

kind regards,
Jörg

Translate
edubey
Level 10
Oct 16, 2015 2:28 AM UTC

Hi,

For deactivation are you using your custom workflow ?

Translate
Lokesh_Shivalingaiah
Level 10
Oct 16, 2015 2:28 AM UTC

you can customize the deactivate action and assign that service when you click on 'deactivate' button

Translate
Ravi_KSAuthor
Level 3
Oct 16, 2015 2:28 AM UTC

Authors will have replicate auhorization. I just need to get hold of my workflow as soon as he click deactivate button. 

Translate
Ravi_KSAuthor
Level 3
Oct 16, 2015 2:28 AM UTC

Can you please share any code example so that I can follow it.

Translate
Ravi_KSAuthor
Level 3
Oct 16, 2015 2:28 AM UTC

No. On deactivation I want to trigger my workflow whcih actually connects to Solr server to remove that index.

Translate
Level 3
Oct 16, 2015 2:28 AM UTC

whenever a deactivate button/option is clicked (either from sidekick or siteadmin). it is eventually handled by (AFAIK) CQ.wcm.SiteAdmin.internalDeactivatePage function which in turn makes a call to /bin/replicate.json servlets that deactivates the page.

you can override that function to do your stuff.

hoep this helps. Sorry I dont have any code snippets to show right now.

Translate