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

[RTC Java API] How to set component scope for flow target?

Hi, the use case for this question is: I have a Stream with 100 components, I create a Workspace connected to the Stream, I only add 10 components to my Workspace. Now, if I look at the Pending Changes view in Eclipse client, all changes are shown there: 10 changes from my 10 components & 90 component additions from the other 90... I only want to see the changes from my 10 components, so I edit the component scope by open the Workspace --> click on the Stream name in Flow Target table --> choose Edit --> in the Edit Flow Target window I choose "Flow only components checked below" option & choose the components to be flowed.
--> How can I do this with Java API? I try to use the following but no success:
IFlowTable#addAcceptFlow(source, remoteRepoIdentifier, remoteRepoURI, componentScopes, description) and
IFlowTable#addDeliverFlow(source, remoteRepoIdentifier, remoteRepoURI, componentScopes, description)

I've already supplied the component handle list into the parameter "componentScopes" but when I go back to Eclipse client to check, it still flow all components.
Below is the code I used:

IWorkspaceConnection wsCon;

IFlowNodeHandle nodeHandle;

flowTable = wsCon.getFlowTable().getWorkingCopy();

flowTable.addAcceptFlow(nodeHandle, repo.getId(), repo.getRepositoryURI(), wsCon.getComponents(), null);

flowTable.addDeliverFlow(nodeHandle, repo.getId(), repo.getRepositoryURI(), wsCon.getComponents(), null);

wsCon.setFlowTable(flowTable, null);









0 votes



One answer

Permanent link
Check out this working snipet:

public void setFlowTarget(IWorkspaceConnection stream, IWorkspaceConnection flowTarget, ArrayList<ComponentWithHandle> scopeComponents, boolean isDefault, boolean isCurrent) throws TeamRepositoryException {
        IFlowTable flowTable = stream.getFlowTable().getWorkingCopy();
        flowTable.addDeliverFlow(flowTarget.getResolvedWorkspace(), teamRepository.getId(), teamRepository.getRepositoryURI(), null, flowTarget.getDescription());        
        flowTable.addAcceptFlow(flowTarget.getResolvedWorkspace(), teamRepository.getId(), teamRepository.getRepositoryURI(), null, flowTarget.getDescription());    
        IFlowEntry flowNodeDeliver = flowTable.getDeliverFlow(flowTarget.getResolvedWorkspace());
        IFlowEntry flowNodeAccept = flowTable.getAcceptFlow(flowTarget.getResolvedWorkspace());
      
        flowTable.setComponentScopes(flowNodeAccept.getFlowNode(), repackComponents(scopeComponents));    
       

      
if (isDefault) {
            flowTable.setDefault(flowNodeDeliver);
            flowTable.setDefault(flowNodeAccept);
        }
        if (isCurrent) {
            flowTable.setCurrent(flowNodeDeliver);
            flowTable.setCurrent(flowNodeAccept);
        }
        stream.setFlowTable(flowTable, progressMonitor);
    }

0 votes

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,934
× 411
× 169

Question asked: Mar 26 '15, 10:34 p.m.

Question was seen: 5,231 times

Last updated: Oct 09 '15, 8:30 a.m.

Related questions
Confirmation Cancel Confirm