It's all about the answers!

Ask a question

Exception while saving Project developmentLine


EclipseTalk . (32736161) | asked Aug 24 '09, 6:24 a.m.
Hello,
I'm creating a project area and then associating a development line to it.

I create the developmentLine as follow:
IProcessItemService service = (IProcessItemService) repo.getClientLibrary(IProcessItemService.class);


IDevelopmentLine timeLine = service.createDevelopmentLine();
timeLine.setName(timeLineStr);
timeLine.setStartDate(startDate);
timeLine.setEndDate(endDate);
timeLine.setId("foo");

Then I set the timeLine to the project area as follow:
 

timeLine.setProjectArea(projectArea);
projectArea.addDevelopmentLine(timeLine);
projectArea.setProjectDevelopmentLine(timeLine);

When I save the project and the developmentLine with:
getProcessService().saveProcessItems(new IProcessItem[] { projectArea, timeLine });

I'm getting this exception:
Exception in thread "main" com.ibm.team.repository.common.internal.ImmutablePropertyException

at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2049)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:247)
at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:255)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:310)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:626)
at com.ibm.team.process.internal.common.impl.ProjectAreaImpl.addDevelopmentLine(ProjectAreaImpl.java:1275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

What am I doing wrong?
Thnaks

2 answers



permanent link
Jared Burns (4.5k29) | answered Aug 24 '09, 8:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Mon, 24 Aug 2009 10:38:03 +0000, eclipsetalk wrote:
I'm getting this exception:
Exception in thread "main"
com.ibm.team.repository.common.internal.ImmutablePropertyException

In order to modify an item in Jazz, you need to get a working copy
IItem#getWorkingCopy() is typed to return IItem, but you can safely cast
the result to whatever item type you had to begin with. For example:

projectArea = (IProjectArea) projectArea.getWorkingCopy();

--
Jared Burns
Jazz Process Team

permanent link
EclipseTalk . (32736161) | answered Aug 25 '09, 3:37 a.m.
Thanks Jared, it works like a charm now.

Your answer


Register or 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.