Checkout the EPMducument/ .SLDASM from the workspace.
Use case: I have a Part Structure. I want to add all the Parts and associated EPMDocuments available in the structure, Add the structure into the workspace and then do check out all the EPMDocuments from the workspace.
What i did :
private void checkoutDocument(EPMDocument document) throws WTException, WTPropertyVetoException {
try {
System.out.println("Checking out document: " + document.getNumber());
if (!WorkInProgressHelper.isCheckedOut(document)) {
// Get the current user's checkout folder
Folder checkoutFolder = WorkInProgressHelper.service.getCheckoutFolder();
// CheckoutLink chilink = WorkInProgressHelper.service.checkout(document, checkoutFolder, "Check out comment");
CheckoutLink chilink = WorkInProgressHelper.service.checkout(document, checkoutFolder, WorkspaceName)
wt.epm.EPMDocument wrk = (wt.epm.EPMDocument)chilink.getWorkingCopy();
System.out.println("Document checked out successfully: " + wrk.getIdentity());
} else {
System.out.println("Document is already checked out.");
}
} catch (WTException e) {
e.printStackTrace();
throw new WTException("Error checking out document: " + e.getMessage());
}
}

