cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Workspace using API

Highlighted
Participant

How to create Workspace using API

Hi Friends,

I am trying to create a Workspace in ProjectLink but using the follwing API but when I execute it throws me the error :

Error:

INFO  : wt.system.err Administrator - (wt.inf.container.containerResource/26) wt.inf.container.ClassicContainerNotFoundException: Context not found: "Windchill PDM"

Code:

WTPart part = getPart("xxxxxxx");

EPMWorkspace workspace = wt.epm.workspaces.EPMWorkspace.newEPMWorkspace("NewWorkSpace", SessionHelper.getPrincipal(),FolderHelper.getFolder(part) , WTPartConfigSpec.newWTPartConfigSpec(),EPMDocConfigSpec.newEPMDocConfigSpec() );

PersistenceHelper.manager.save( workspace );

can anyone help me how I can achieve this

1 REPLY 1

Re: How to create Workspace using API

Hello!

Maybe this will work?

EPMWorkspace.newEPMWorkspace(name, user, null, WTPartConfigSpec.newWTPartConfigSpec(), configSpec, container);

where

EPMDocConfigSpec configSpec is your configspec and WTContainer container is your project

And also remove the line

PersistenceHelper.manager.save( workspace );

Best regards,

Peter