It's all about the answers!

Ask a question

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


Nilesh Patil (1733650) | asked Dec 31 '16, 1:40 a.m.
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

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Jan 05 '17, 3:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
  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.

Your answer


Register or 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.