RTC api: Get the human readable name of the current flow target
Hello friends,
my first question here.
I need support by finding the human readable name of the flow target.
The eclipse plug-in manages it some how, so I would like to do it as well, because we need that name for our logic.
I have already a lot of information, like:
ITeamRepository repo = (ITeamRepository) selectedSnapshotCandidate.getOrigin();
IWorkspaceHandle currentFlowTarget2 = rtcHandler.getCurrentFlowTarget();
IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(repo);
IWorkspaceConnection workspaceConnection;
try {
workspaceConnection = workspaceManager.getWorkspaceConnection(currentFlowTarget2, null);
} catch (TeamRepositoryException e) {
throw new RuntimeException("Cannot create stream connection", e);
}
IFlowEntry currentAcceptFlow = workspaceConnection.getFlowTable().getCurrentAcceptFlow();
But I can't get its name! The name attribute returns the server adress.
Any help would be highly appreciated.
Accepted answer
IFlowEntry currentAcceptFlow = workspaceConnection.getFlowTable().getCurrentAcceptFlow();
IFlowNodeHandle currentAcceptFlowHandle = currentAcceptFlow.getFlowNode();
if (currentAcceptFlowHandle instanceof IWorkspaceHandle) {
IWorkspaceConnection currentAcceptFlowConnection = workspaceManager.getWorkspaceConnection((IWorkspaceHandle) currentAcceptFlowHandle, null);
String currentAcceptFlowName = currentAcceptFlowConnection.getResolvedWorkspace().getName();
}