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

how to solve ImmutablePropertyException exception on setting setCurrentIteration

Hello  team

 I am using the below code to set the currentiteration for the timeine  :
 IDevelopmentLineHandle[] developmentLineHandle = prjArea
                .getDevelopmentLines();
 developmentLine = fAuditableClient.resolveAuditable(developmentLineHandle1,
         ItemProfile.DEVELOPMENT_LINE_DEFAULT, monitor);

for (IIterationHandle subiterationsHandle : subiterations) {
                IIteration subiteration = fAuditableClient.resolveAuditable(
                        subiterationsHandle, ItemProfile.ITERATION_DEFAULT, monitor); }
         
developmentLine.setCurrentIteration(subiterationsHandle);

i get the below error:

Exception in thread "main" com.ibm.team.repository.common.internal.ImmutablePropertyException
    at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2143)
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
    at com.ibm.team.process.internal.common.impl.DevelopmentLineImpl.setInternalCurrentIteration(DevelopmentLineImpl.java:766)
    at com.ibm.team.process.internal.common.impl.DevelopmentLineImpl.setCurrentIteration(DevelopmentLineImpl.java:1286)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.ibm.team.repository.common.internal.util.ItemStore$ItemInvocationHandler.invoke(ItemStore.java:597)
    at com.sun.proxy.$Proxy18.setCurrentIteration(Unknown Source)


Let me know hat is causing the problem here ????

Thank you
  

0 votes


Accepted answer

Permanent link

 Please carefully read Understanding and Using the RTC Java Client API   especially the part about working copy. You can not just modify stuff, you usually need a modifiable item (working copy).


From the same blog post read up how to setup the RTC SDK and the plain java client libraries. Use the Eclipse Java Search capability to search for setCurrentIteration and look at how the code is used in the RTC SDK e.g. unit tests.

Example from com.ibm.team.process.internal.client.tests.AbstractTeamProcessTest.setCurrentIteration(IDevelopmentLine, String) to get the workingcopy (called mutable copy in this context)

   
            IProcessItemService service = getProcessItemService();
            line = (IDevelopmentLine) service.getMutableCopy(line);
            line.setCurrentIteration(current);
            service.save(line, null);
    



vinitha dsouza selected this answer as the correct answer

1 vote

Comments

Thank You for the reply :)
It worked

The point of my reply was what to do and how to get at this information. It took me longer to type the response than to search for the API. If you want to continue with this kind of work, you should learn how to find API examples in the SDK.


You had several questions with a similar pattern and you would be able to answer most of your questions if you could do that.

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

Question asked: Mar 10 '17, 2:44 a.m.

Question was seen: 1,878 times

Last updated: Mar 10 '17, 3:34 a.m.

Confirmation Cancel Confirm