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

Creating CLM links from a workitem save participant

Hi,

What's the best way to programmatically link to RQM (a test case) from a work item save participant? Are there internal RTC APIs for this or do OSLC calls have to be made from the participant Java code?

Is it even possible?

Thanks,

Simon

0 votes


Accepted answer

Permanent link
Simon, a bit late.....

I stumbled across this some time ago. This should be working similar in a participant. The code below is client code, I highlighted the important part. You call it with a URI to the remote object. See https://jazz.net/forum/questions/81826/how-an-operation-participant-works?page=1&focusedAnswerId=81979#81979 on how to save a work item in a participant.

    private static class LinkURIOperation extends WorkItemOperation {

       
        private URI fURI;
        private IEndPointDescriptor fEndpointDescriptor;
       
        public LinkURIOperation( IEndPointDescriptor endpointDescriptor,URI uri) {
            super("Linking URL", IWorkItem.FULL_PROFILE);
            fURI = uri;
            fEndpointDescriptor=endpointDescriptor;
        }

        @Override
        protected void execute(WorkItemWorkingCopy workingCopy,
                IProgressMonitor monitor) throws TeamRepositoryException {
            IReference reference;
                reference = IReferenceFactory.INSTANCE.createReferenceFromURI(fURI);
                workingCopy.getReferences().add(fEndpointDescriptor,reference);
        }
    }


To call it

                    URI uri=new URI("https://clm.example.com:9448/qm/oslc_qm/contexts/_Lm2UIACBEeGZqMjM3RLKTw/resources/com.ibm.rqm.planning.VersionedTestCase/_dJzNgQCBEeGZqMjM3RLKTw");
                    IEndPointDescriptor endpoint = ILinkTypeRegistry.INSTANCE.getLinkType(WorkItemLinkTypes.TESTED_BY_TEST_CASE).getTargetEndPointDescriptor();
                    LinkURIOperation linkOp = new LinkURIOperation(endpoint,uri);
                    linkOp.run(workItem, monitor);

//                    IEndPointDescriptor endpoint1 = //ILinkTypeRegistry.INSTANCE.getLinkType(WorkItemLinkTypes.AFFECTS_EXECUTION_RESULT).getTargetEndPointDescriptor();
//                    IEndPointDescriptor endpoint3 = //ILinkTypeRegistry.INSTANCE.getLinkType(WorkItemLinkTypes.AFFECTED_BY_DEFECT).getTargetEndPointDescriptor();


Simon Fisher selected this answer as the correct answer

2 votes


One other answer

Permanent link
Thanks Ralph, I did use something similar in the end.

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

Question asked: Nov 25 '11, 4:32 a.m.

Question was seen: 6,223 times

Last updated: Jul 17 '12, 12:18 p.m.

Confirmation Cancel Confirm