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

Obtain flow target for workspace using API

 Hi,

I've been looking at this for alittle while and I've not been able to work out the flow target for a workspace.  I have the following code that provides me the workspace connection:

//get connection for workspace name
IWorkspaceConnection connection = workspaceManager.getWorkspaceConnection(workspace, null);
I've tried using the call getFlowTable() and then on the returned IFlowTable use the getDefaultDeliverFlow() but these just appeared to return nulls.

Does anyone know how to get the default flow target for the workspace?

Thanks

Adam

0 votes


Accepted answer

Permanent link
That is the correct way to get the default flow target. However, null means there is no default flow target. You may want to check that the workspace has one of its flow targets set as the default.
Adam Coulthard selected this answer as the correct answer

1 vote

Comments

 Hi Tim,


When I open the workspace and look at the Flow Targets I can see two Flow Targets one has default and current next to it.  But when I go to getFlowTable() getDefaultDeliverFlow it returns null for the getDescription() which I assume would be the name of the flow target (in this case a stream).  Or do I need to do something else to the IFlowEntry to get the actual name?

Thanks

Adam

Once you have the handle to the item, you have to fetch the full item from the repository. The IFlowEntry description is not the description set in the stream/workspace editor.

IFlowEntry defaultDeliverFlow = workspaceConnection.getFlowTable().getDefaultDeliverFlow();
if (defaultDeliverFlow == null) {
    System.out.println("no default flow entry");
} else {
    IFlowNodeHandle flowNode = defaultDeliverFlow.getFlowNode();
    IWorkspace fetchedFlowNode = (IWorkspace) repo.itemManager().fetchCompleteItem(flowNode, IItemManager.DEFAULT, monitor);
    System.out.println(fetchedFlowNode.getDescription());

</pre>

1 vote

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

Question asked: May 17 '13, 9:03 a.m.

Question was seen: 4,459 times

Last updated: May 17 '13, 10:29 a.m.

Confirmation Cancel Confirm