Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to create project area programmatically using java API?

 Hi, 
We would like to create a project area programmatically using java API.
Thanks

0 votes


Accepted answer

Permanent link
    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

2 votes


One other answer

Permanent link
Please look at the snippets of the Plain Java Client Libraries (download in all downloads).

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,952
× 7,507
× 411
× 89

Question asked: Aug 08 '13, 5:51 p.m.

Question was seen: 8,588 times

Last updated: Sep 30 '13, 3:16 a.m.

Confirmation Cancel Confirm