Surya Chandra
Surya Chandra

Reputation: 1591

Best way to trigger a Page activation workflow

I have a requirement where I have around 800 pages under a path in /content hierarchy. Now, the content in some of those pages will get updated on a nightly basis though some automated process. I have a requirement to trigger a page activation workflow for all the pages that are updated. This has to happen instantaneously after the page content got updated. I actually thought of writing a custom code to manually call the page activation workflow once a page is updated. But, on reading some documentation, I thought a workflow launcher might be more suitable in this scenario.

However, I have some queries related to workflow Launcher:

  1. Does it activate all the pages under the path that I mention in the path property while setting up the launcher or will it activate only those pages which are modified?

  2. I we are logged in as admin, do we get a notification in the inbox for approval of this workflow?

Also, I wanted to know whether using the workflow launcher in this scenario is the best solution for my requirement. I'm relatively new to Workflows, so please help

Upvotes: 2

Views: 6733

Answers (3)

Surya Chandra
Surya Chandra

Reputation: 1591

I actually implemented this requirement with the help of a launcher. The below were the settings that I have done. Its activates only those pages which are modified under the mentioned path.

enter image description here

Upvotes: 4

Markus
Markus

Reputation: 452

Depending on your concrete requirements, if you want to activate the pages without starting a workflow first you can make use of the com.day.cq.replication package. If you obtain a reference to a Replicator object you can trigger replication of a node simply via a call to the replicate method.

Upvotes: 1

Thomas
Thomas

Reputation: 7080

  1. You can define the workflow launcher to listen to a specific property. So if your nightly update updates a specific property, the easiest is to have a launcher that checks for modification of this property: http://docs.adobe.com/docs/en/cq/current/workflows/wf-using.html#Starting Workflows When Nodes Change

  2. Usually you should only log in as admin if you need to access system settings (/system/console) and not for daily work. I suggest you create an administrator user which is part of the group that would get the workflow notification. You can give this user full access to the CRX, but still I would really check if this is needed for daily tasks.

Upvotes: 2

Related Questions