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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Publish referenced assets in custom workflow

Avatar

Level 1

Hi,

In my current custom workflow referenced items are not getting published. I want to have a functionality similar to OOTB publish workflow where it gives a popup in publish wizard and asks if we want to activate referenced items as well. Can you please help me as to how can I implement the same behaviour for custom workflow?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

The popup is not part of the workflow itself, but part of the "activation" logic.

Workflows run async and are not directly connected to a browser window, thus they cannot render HTML and send it as response to a user.

If you have a custom workflow, you can either replicate the activation feature (most likely to can reuse the complete logic and UI then), start the reference search first and as a final step put all that information into your custom workflow. This allows a limited amount of interactive work, but it's more complicated than a simple workflow, which just runs in the background and has no feedback channel.

Or you just implement a workflow step (as usual) and use the ReferenceSearch class [1] to find all other objects in the repo which are referencing your page.

[1] ReferenceSearch (The Adobe AEM Quickstart and Web Application.)  (note that this is not a service, but a simple object!!)

View solution in original post

3 Replies

Avatar

Correct answer by
Employee Advisor

The popup is not part of the workflow itself, but part of the "activation" logic.

Workflows run async and are not directly connected to a browser window, thus they cannot render HTML and send it as response to a user.

If you have a custom workflow, you can either replicate the activation feature (most likely to can reuse the complete logic and UI then), start the reference search first and as a final step put all that information into your custom workflow. This allows a limited amount of interactive work, but it's more complicated than a simple workflow, which just runs in the background and has no feedback channel.

Or you just implement a workflow step (as usual) and use the ReferenceSearch class [1] to find all other objects in the repo which are referencing your page.

[1] ReferenceSearch (The Adobe AEM Quickstart and Web Application.)  (note that this is not a service, but a simple object!!)

Avatar

Level 1

Thanks much Joerg for detailed explanation and solutions.

2nd solution would be appropriate for my custom workflow. However, for our requirement, we need to make use of com.day.cq.dam.commons.util.AssetReferenceSearch API to search the assets which are referenced in particular page we want to activate.

Avatar

Employee Advisor

That is straight forward then. Implement a custom workflow step which instantiates an AssetReferenceSearch object, execute the search method and replicate each resulting asset.

Of course you don't have a popup window then, but it's all done automatically.

Jörg