It's all about the answers!

Ask a question

How to create project area programmatically using java API?


CAIO CARLO CANDIDO (21126) | asked Aug 08 '13, 5:51 p.m.
 Hi, 
We would like to create a project area programmatically using java API.
Thanks

Accepted answer


permanent link
K M (38324749) | answered Aug 28 '13, 5:45 p.m.
    public String createProject(String name, String processId) throws TeamRepositoryException{
        String msg = "Created project " + name + " with process id Name " + processId;            

        IProcessItemService service = (IProcessItemService)repo.getClientLibrary(IProcessItemService.class);
        IProcessDefinition definition = service.findProcessDefinition(processId,IProcessItemService.ALL_PROPERTIES, MONITOR);
        
        if (definition == null) {
            throw new TeamRepositoryException("Could not find Predefined Process " + processId);            
        }
        IProjectArea project = service.createProjectArea();
        project.setName(name);
        project.setProcessDefinition(definition);        
        service.save(project, MONITOR);

        // Set project access
        setVisibility(name,false,false,true);

        service.initialize(project, MONITOR);

        return msg;
    }

CAIO CARLO CANDIDO selected this answer as the correct answer

One other answer



permanent link
Ralph Schoon (61.8k33643) | answered Aug 08 '13, 6:28 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please look at the snippets of the Plain Java Client Libraries (download in all downloads).

Your answer


Register or to post your answer.