Exception while saving Project developmentLine
Hello,
I'm creating a project area and then associating a development line to it.
I create the developmentLine as follow:
Then I set the timeLine to the project area as follow:
When I save the project and the developmentLine with:
I'm getting this exception:
What am I doing wrong?
Thnaks
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
On Mon, 24 Aug 2009 10:38:03 +0000, eclipsetalk wrote:
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
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