It's all about the answers!

Ask a question

Why does Deletion of an Iteration programatically throw ProcessDataValidationException ?


Achla Sharma (31316) | asked Aug 14 '14, 2:53 a.m.
edited Sep 04 '14, 5:26 a.m.

Following is my code to delete iteration from a project area :


for (Object obj : itemManager.fetchCompleteItems(
    Arrays.asList(workingDevLine.getIterations()),
    IItemManager.DEFAULT, monitor)) {

   IIteration iter = null;
   if (obj instanceof IIteration) {
    iter = (IIteration) obj;
    
    
     workingDevLine.removeIteration(iter);
    }

I am recieving the following error message :

com.ibm.team.process.common.service.ProcessDataValidationException: Iteration 'FY14Q3' has a backpointer to timeline 'Project_Timeline', but the timeline does not contain it.

An explanation about this error might be helpful.

3 answers



permanent link
Stephanie Bagot (2.1k1513) | answered Aug 14 '14, 1:08 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
It looks like your iteration is referencing a project timeline. Did you delete the project timeline that iteration was associated with?

Comments
Achla Sharma commented Sep 04 '14, 5:13 a.m.

No, I just wanted to delete a particular iteration from the project timeline. The project timeline is not deleted.


permanent link
Qiong Feng Huang (76911610) | answered Aug 15 '14, 4:22 a.m.
JAZZ DEVELOPER
 When you use IDevelopmentLine.removeIteration() to remove an iteration, you should also have to remove the reference of development line from the iteration that is about to be removed.

For example:
developmentLine.removeIteration(iteration);
iteration.setDevelopmentLine(null);

Comments
Achla Sharma commented Sep 04 '14, 5:12 a.m.

I tried implementing your suggestion. I am getting the following error message on save operation :

com.ibm.team.process.common.service.ProcessDataValidationException: timeline may not be null


permanent link
Qiong Feng Huang (76911610) | answered Sep 29 '14, 1:24 a.m.
JAZZ DEVELOPER
 If you just want to delete a iteration, you can use com.ibm.team.process.client.IProcessItemService.delete(IProcessItemHandle, boolean, IProgressMonitor) on client site.

Comments
Achla Sharma commented Sep 29 '14, 6:35 a.m.

Hi

Thanks for the alternative. I tried using the method. The problem with this approach is that it renders the existent workitems using the iteration in an unstable state. Instead I tried this :com.ibm.team.process.client.IProcessItemService.archiveProcessItem(IProcessItemHandle, IProgressMonitor).

It did archive the iteration still I was getting work items in an uunstable state. I just added the workingDevelopmentLine.remove operation after this and it worked for me. We now have unnecessary iterations archived. For the workitems using the iteration, the planned for field has value :"iteration-name"+"(archived)".


Achla Sharma commented Sep 29 '14, 6:37 a.m.

The code now looks like this :

service.archiveProcessItem(working_Iteration, null);

workingDevLine.removeIteration(working_Iteration);

Your answer


Register or to post your answer.