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

Deliver by using plainJava API

The code as follow, I've check in, but an exception throw when program call the last line code:
com.ibm.team.scm.common.ChangeSetsNotOutgoingException: These change sets are not outgoing and therefore cannot be delivered.
 at com.ibm.team.scm.client.internal.WorkspaceConnection.checkAgainstReport(WorkspaceConnection.java:2120)
 at com.ibm.team.scm.client.internal.WorkspaceConnection.runDeliver(WorkspaceConnection.java:2012)
My Code:
IChangeSet changeSetToDeliver = null;
   List<IChangeSetHandle> activeChangeSets = workspaceConnection.activeChangeSets(comp);
   System.out.println("Active ChangeSets: " + activeChangeSets.size());
   for (IChangeSetHandle changeSetHandle : activeChangeSets) {
    if (changeSetHandle instanceof IChangeSet) {

     changeSetToDeliver = (IChangeSet) changeSetHandle;
    }
   }
   
   IChangeSetHandle ics = workspaceConnection.getCurrentChangeSet(comp);
   System.out.println("IChangeSetHandle:" + ics);//Here output is 0
   
   
   // deliver the code
   IChangeHistorySyncReport sync = workspaceConnection.compareTo(workspaceConnection, WorkspaceComparisonFlags.CHANGE_SET_COMPARISON_ONLY, Collections.EMPTY_LIST, null);//The 3rd parameter could be used to exclude components on the workspace from the compare operation
   List list = sync.outgoingChangeSets(comp);
   System.out.println("Out going change sets size:" + list.size()); //Here output is 0
   workspaceConnection.deliver(workspaceConnection, sync, workspaceConnection.getBaselineSets(null), Arrays.asList(new IChangeSet[]{changeSetToDeliver}), null);

Is there any one can help for this issue? how should I make the change set to out going chengeset ?
And I know the last line code should be:
workspaceConnection.deliver(workspaceConnection, sync, workspaceConnection.getBaselineSets(null), sync.outgoingChangeSets(comp), null);
But as you can see the out going size is 0 ,but the change set above I get it, which is not 0.

0 votes



2 answers

Permanent link
You are comparing the workspace to itself (see workspaceConnection.compareTo(workspaceConnection, ...) then telling the workspace to deliver the change sets to itself (see workspaceConnection.deliver(workspaceConnection, ...).

You may be able to accomplish what you want by using the command line interface. It would allow you to avoid these mechanical/syntactic problems and concentrate on flowing your changes.

1 vote


Permanent link
Please see: https://rsjazz.wordpress.com/2013/09/30/delivering-change-sets-and-baselines-to-a-stream-using-the-plain-java-client-libraries/ and the related posts.

The error indicates that the change sets are not going out. Maybe there is no flow target set. Maybe they are incoming.

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,939

Question asked: Nov 26 '14, 8:16 a.m.

Question was seen: 4,236 times

Last updated: Nov 26 '14, 10:27 a.m.

Confirmation Cancel Confirm