how to checkout the workspace object through api
I added the epm document to workspace though api, and i want to check out the added EPM document from the workspace.
this is my code
private void addToWorkspace(EPMDocument doc) {
try {
wt.fc.ReferenceFactory referencefactory = new wt.fc.ReferenceFactory();
wt.fc.WTReference wtreference = referencefactory.getReference(doc);
wt.epm.EPMDocument epm = (wt.epm.EPMDocument) wtreference.getObject();
System.out.println("epm-->"+epm);
wtreference = referencefactory.getReference("OR:wt.epm.workspaces.EPMWorkspace:1150900");
wt.epm.workspaces.EPMWorkspace workspace= (wt.epm.workspaces.EPMWorkspace) wtreference.getObject();
System.out.println("workspace-->"+workspace);
//Get the EPMDocument configuration
wt.epm.workspaces.EPMAsStoredConfigSpec asStored = wt.epm.workspaces.EPMAsStoredConfigSpec.newEPMAsStoredConfigSpec(epm);
wt.fc.QueryResult queryResult = wt.epm.structure.EPMStructureHelper.service.navigateReferencesToIteration(epm, null, true, asStored);
//To add to workspace, set some collection
wt.fc.collections.WTHashSet collection = new wt.fc.collections.WTHashSet();
collection.add(epm);
// Add to workspace
wt.epm.workspaces.EPMWorkspaceHelper.manager.addToWorkspace(workspace, collection);
//Get check out folder for the current user in the session
wt.folder.Folder checkoutFolder1 = wt.vc.wip.WorkInProgressHelper.service.getCheckoutFolder();
//Check out object
wt.vc.wip.CheckoutLink chklink1 = wt.vc.wip.WorkInProgressHelper.service.checkout(epm, checkoutFolder1, "Check out comment");
wt.epm.EPMDocument wrk1 = (wt.epm.EPMDocument) chklink1.getWorkingCopy();
} catch (WTException | WTPropertyVetoException e) {
e.printStackTrace();
}
}
this is coming like this, i wanted to checkout from workspace

