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

SCM query for custom attribute value supports EQUALS but not CONTAINS?

hi all
When constructing an SCM query for a custom attribute value, it appears that you can do this:

 IGenericQueryNode query1 = IGenericQueryNode.FACTORY.newInstance(QueryOperations.OPERATION_EQUALS)
                .addChild(customAttrName).addChild(customAttrVal);

but not

IGenericQueryNode query1 = IGenericQueryNode.FACTORY.newInstance(QueryOperations.OPERATION_CONTAINS)
                .addChild(customAttrName).addChild(customAttrVal);

Neither OPERATION_CONTAINS nor OPERATION_MATCHES works.

RTC 6.0.6.1

Thoughts?

0 votes



One answer

Permanent link
ah. CONTAINS is for tags. That wasn't obvious.

    private static class CustomAttributeTableQueryHandler extends AbstractScmQueryHandler<ICustomAttributeHandle, CustomAttributeQueryModel> {
    
        private CustomAttributeTableQueryHandler(ScmTransactionContext rtc, CustomAttributeQueryModel model) {
    
            super(rtc, model);
    
            Map<String, QueryOperationHandler> queryFunctions = new HashMap<String, QueryOperationHandler>();
    
            queryFunctions.put(QueryOperations.OPERATION_AND, ScmQueryOperationLibrary.genericANDOperationHandler);
    
            queryFunctions.put(QueryOperations.OPERATION_OR, ScmQueryOperationLibrary.genericOROperationHandler);
    
            queryFunctions.put(QueryOperations.OPERATION_EQUALS, ScmQueryOperationLibrary.customAttributeEQOperationHandler);
    
            queryFunctions.put(QueryOperations.OPERATION_HAS_ATTRIBUTE, ScmQueryOperationLibrary.customAttributeExistOperationHandler);
    
            queryFunctions.put(QueryOperations.OPERATION_BASELINE, new InBaselineQueryOperation());
    
            queryFunctions.put(QueryOperations.OPERATION_CONTAINS, ScmQueryOperationLibrary.genericTagsContainsOperationHandler);
    
            queryFunctions.put(QueryOperations.OPERATION_HAS_LINK, ScmQueryOperationLibrary.genericHasLinkOperationHandler);
    
            super.setOperationHandlers(queryFunctions);
    
        }
    

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

Question asked: Nov 11 '20, 11:11 a.m.

Question was seen: 1,385 times

Last updated: Nov 11 '20, 11:20 a.m.

Confirmation Cancel Confirm