Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to exclude assets,templates and other references when workflow is unpublished.

Avatar

Level 4

when we publish workflow it's activating page assets and all references  but when  replicationActionType is Unpublish it should not activate assets and other references since these refernces are used in other places and it might break in other pages.

Is there a way to write condition when replicationActionType is Unpublish do not activate assets and consider only live copies and actual payload and it should not create revision for page.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

That's not the OOTB behavior, I just validated that with the OOTB workflow[1], the assets are not deactivated when you deactivate a page.  If you are observing that behavior, maybe there is a custom code running on your instance? Can you please check once more?

 

Please also look at this: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/need-to-referenced-pages-w... 

 

[1]. OOTB workflow for deactivation

EstebanBustamante_0-1702045289892.png

 

Hope this helps.



Esteban Bustamante

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi,

 

That's not the OOTB behavior, I just validated that with the OOTB workflow[1], the assets are not deactivated when you deactivate a page.  If you are observing that behavior, maybe there is a custom code running on your instance? Can you please check once more?

 

Please also look at this: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/need-to-referenced-pages-w... 

 

[1]. OOTB workflow for deactivation

EstebanBustamante_0-1702045289892.png

 

Hope this helps.



Esteban Bustamante

Avatar

Community Advisor

Hello @vijitha ,

As pointed out in the other replies, most likely it is a custom workflow code that is unpublishing the dependent assets.

 

Do you see any such code in your code repository, and if you do, there is a high chance that you might want to exclude it for the unpublishing workflow use case.

 

ReferenceSearch referenceSearch = new ReferenceSearch();
Collection<ReferenceSearch.Info> resultSet = referenceSearch.search(resolver, path).values();

 

 

regards,

Preetpal

Avatar

Level 4

Hi, 

I have fixed this issue in my project. When we unpulish the asset we don't have any issue but issue is with fragment.

For example we have  fragmement and it is getting used in all of the pages. If we just edit the fragment and save it ,and if we unpublish the page, fragment also is getting unpublished so it will cause an issue. To avoid that when actioType is unpublish consider only payload and livecopy url.