How to retrieve IFlowNodeConnection with plain Java API
![]()
Luca Martinucci (1.0k●2●91●110)
| asked Sep 13 '16, 11:23 a.m.
edited Sep 14 '16, 7:48 a.m. by David Lafreniere (4.8k●7)
How can I retrieve an IFlowNodeConnection object, having an IWorkspace object, with plain Java API?
RTC version is 5.0.2. |
Accepted answer
![]()
Luca Martinucci (1.0k●2●91●110)
| answered Sep 14 '16, 5:13 a.m.
edited Sep 14 '16, 7:50 a.m. by David Lafreniere (4.8k●7)
I found out how to do this (actually, very easy).
By using a WorkspaceManager object:
IWorkspaceHandle wsHandle = (IWorkspaceHandle) workspace.getItemHandle();
IWorkspaceConnection wsConnection = workspaceManager.getWorkspaceConnection(wsHandle, null);
IFlowNodeConnection flowNodeConn = (IFlowNodeConnection) wsConnection;
David Lafreniere selected this answer as the correct answer
Comments 1
Notes:
-There is no need for the first line (to cast to IWorkspaceHandle), an IWorkspace already is an IWorkspaceHande.
-Generally there's not much need for the 3rd line either. A IWorkspaceConnection is an IFlowNodeConnection (i.e it already has access to the API in IFlowNodeConnection), so your code can pass around an IWorkspaceConnection and work just fine.
Thanks for your suggestions, I will try them.
It works; thank you very much.
|