Expand my Community achievements bar.

SOLVED

How to fetch the previous version of an asset(if available) programmatically within a Workflow Process?

Avatar

Level 2

Hi All,

I'm using AEM 6.4 and under a use case, I need to check the current version of an asset and then fetch the previous version of an asset?

Basically, I have to address the following items:-

  • View what version of the asset you are using programmatically in the WorkflowProcess.
  • Get byte[] for the previous version if exists. (*I can get bytes[] once I get the previous version)
  • Restore the asset to a previous version.

Has anyone achieved this or something similar?

-thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You can get the version using VersionManager (Content Repository for Java Technology API Version 2.0)

and you can restore directly.



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

You can get the version using VersionManager (Content Repository for Java Technology API Version 2.0)

and you can restore directly.



Arun Patidar