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

Setting FlowTarget while creating workspace

Hi, I want to create a new Workspace Repository which flow with only one  component.
I tried to use the following code.
                IWorkspace iWorkspace = null;
try {
IFlowTable iFlowTable = iWorkspaceConnection.getFlowTable();
IFlowEntry iFlowEntry = iFlowTable.getDefaultDeliverFlow();
iFlowTable.setComponentScopes(iFlowEntry.getFlowNode(),
iComponentHandles);
iWorkspace = iWorkspaceConnection.getResolvedWorkspace();
} catch (Exception e) {
System.out.println(e.getMessage());
}

The iComponentHandles is a  List<ICompooentHanlde> which has only one desired IComponent.
But I will get IllegalStateException after executing iFlowTable.setComponentScopes(iFlowEntry.getFlowNode().
iComponentHandles);

How can I solve this? thanks!


0 votes



3 answers

Permanent link
Thanks for applying!

I've solved this problem by simply adding 

iWorkspaceConnection.setFlowTable(iFlowTable, monitor);

I've tried using workspace.applyComponentOperations(operation, monitor); but the component I want to add is already in this workspace. So it will fail.

And finally  I found the problem is that iFlowTable.getComponentScopes() will return empty by default. But it means it will flow with all the components.(doc: empty list means unscoped (i.e. process all components))

Thank you for your help!

0 votes


Permanent link
hm.. I got an email with an additional comment you made..

iFlowTable.setComponentScopes(iFlowEntry.getFlowNode(),
iComponentHandles);

limits which of the workspace components will flow across this flow connection.
it does NOT set the components in this workspace

that is done with
workspace.applyComponentOperations(operation, monitor);

operation = IFlowNodeConnection.IComponentOp

the set componentscope should fail if the component is not in this workspace.

see the javadoc for the detailed description of these plainjava apis

0 votes


Permanent link
you need to get the working copy of the flow table to modify it

        IFlowTable dest_flowtable = workspace.getFlowTable().getWorkingCopy();

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

Question asked: Oct 21 '14, 9:43 p.m.

Question was seen: 4,524 times

Last updated: Oct 22 '14, 8:57 p.m.

Confirmation Cancel Confirm