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

how to make changeset suspend, resume or disacard using RTC client api

Hi All,

How do I change state of changeset using RTC client using jazz client java api. I need to change state(discard, resume, suspend) using java client api.

I have tried below code of snippet, but this is not working

public boolean discardChangeSet(IWorkspaceConnection workspace, List<IChangeSetHandle> changeSetsHandle) throws TeamRepositoryException
    {
        workspace.discardChangeSets(true, changeSetsHandle, null);
    }

public boolean suspendChangeSet(ITeamRepository repo,IWorkspaceHandle workspaceHandle, IWorkspaceConnection workspace, List<IChangeSetHandle> changeSetsHandles) throws TeamRepositoryException
    {
        IScmService scmService  = (IScmService) repo.getClientLibrary(IScmService.class);
        
        IChangeSetHandle[] changeSets = Arrays.copyOf( changeSetsHandles.toArray(), changeSetsHandles.toArray().length, IChangeSetHandle[].class);
        scmService.suspend( workspaceHandle, changeSets, IScmService.DELTA_PER_INVOCATION , null, null);
        //workspace.suspend(changeSetsHandles, null);

     }     

After trying for scmService.suspend method it throws null pointer exception.



public boolean resumeChangeSet(IWorkspaceConnection workspace, List<IChangeSetHandle> changeSetsHandles) throws TeamRepositoryException
    {
        workspace.resume(1, changeSetsHandles, null);
    

    }

Could you please let me how to proceed on this. Sample code would be very much helpful.

Thank you in advance

0 votes



One answer

Permanent link
  1. Follow https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ to set up your environment with the SDK and the plain java client libraries for debugging.Use debugging to find out why your calls fail - e.g. what is null.
  2. Search for references of the classes and methods you use to find how the usage patter are e.g. in the client tests that are shipped with the SDK.

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

Question asked: Dec 31 '16, 1:40 a.m.

Question was seen: 2,914 times

Last updated: Jan 05 '17, 3:16 a.m.

Confirmation Cancel Confirm