Skip to main content
4-Participant
July 17, 2023
Solved

How to programmatically move all revisions and versions of objects by Expression

  • July 17, 2023
  • 1 reply
  • 1299 views

Hi All,

 

I have tried with this Expression (CS152791), but it is not move all the previous revisions. It will move only last 2lastest versions of object.

 

Kindly help me out to move all revision and versions by expression.

 

Thanks,

Prashanth

 

 

Best answer by HelesicPetr

Hi @Prashanth_0108 

So try to search previous versions that were not moved and use the api to move them.

You may go through all revisions

 

PetrH

1 reply

5-Regular Member
July 17, 2023

Hi Prashanth_0108,

Thank you for your question.
I encourage you to bring more details and context to your initial inquiery. For example, screenshots are useful to better understand what you are trying to do and will also increase your chance to receive meaningful help from other Community members.
 
 
4-Participant
July 18, 2023

Hi Archila,

 

Kindly check the snapshots and i am using this expression for moving the object from one folder1 to folder2.

 

// Check if a PBO has been assigned to the process
if (primaryBusinessObject !=null) {
try {
wt.folder.Folder f = wt.folder.FolderHelper.service.getFolder( "/Default/Obsolescence",((wt.inf.container.WTContained)primaryBusinessObject).getContainerReference());
 
//move the PBO to the test folder
wt.folder.FolderHelper.service.changeFolder((wt.folder.FolderEntry)primaryBusinessObject, f);
  }
catch ( wt.util.WTException wex ) {
  System.out.println( "Cannot move "+ primaryBusinessObject.getDisplayIdentifier( )+" because "+ wex.getLocalizedMessage());
}
}
else
 // if a PBO has not been assigned to the Process
 System.out.println( "Primary business object is NULL");
 
 

Regards,

Prashanth

HelesicPetr
22-Sapphire II
22-Sapphire II
July 18, 2023

Hi @Prashanth_0108 

So try to search previous versions that were not moved and use the api to move them.

You may go through all revisions

 

PetrH