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