Create Version with Custom Label and Description via Workflow Activate? | Community
Skip to main content
Level 3
May 15, 2018 6:03 PM UTC
Solved

Create Version with Custom Label and Description via Workflow Activate?

Is it possible, when activating a page via a Workflow, create a version but use a custom Label and Description?  By default my understanding is that when you run a page through a Workflow and Activate the page then a version is automatically created but auto increments the version label (#) and doesn't allow adding a custom description for the label.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
akhoury
akhouryAccepted solution
Employee
May 15, 2018 11:13 PM UTC

As smacdonald2008​ had mentioned you can create a custom workflow step instead of using the ActivatePageProcess:

1. Create the custom workflow step as documented here.

2. Call the Replicator service's method Replicator.replicate​ and set ReplicationOptions.setSuppressVersions(true)

3. Now the activation itself won't create the version, in your custom code before calling Replicator.replicate you can call PageManager.createRevision to instead create a version of the page with your custom label.

4 replies

Level 3
May 16, 2018 1:53 PM UTC

Thanks for the information all, much appreciated.

Translate
smacdonald2008
Level 10
May 16, 2018 1:55 AM UTC

Excellent response!

Translate
akhoury
akhouryAccepted solution
Employee
May 15, 2018 11:13 PM UTC

As smacdonald2008​ had mentioned you can create a custom workflow step instead of using the ActivatePageProcess:

1. Create the custom workflow step as documented here.

2. Call the Replicator service's method Replicator.replicate​ and set ReplicationOptions.setSuppressVersions(true)

3. Now the activation itself won't create the version, in your custom code before calling Replicator.replicate you can call PageManager.createRevision to instead create a version of the page with your custom label.

Translate
smacdonald2008
Level 10
May 15, 2018 7:42 PM UTC

To get more detail into a Replication Workflow - you can look at writing a custom AEM workflow step. Then within the custom step - use the Replicator ("The Adobe AEM Quickstart and Web Application.")  API. Notice the parameter based on the ReplicationOptions object. Notice that you can set options using this object.

Translate