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.
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!
|
3 answers
you need to get the working copy of the flow table to modify it
IFlowTable dest_flowtable = workspace.getFlowTable().getWorkingCopy(); |
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 |
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!
|
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.