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

Querying RTC SCM data with wildcard characters and regular expressions

Trying to fetch only components,baselines matching the searched name pattern in a repository via RTC Plain Java API.
Didn't find any direct API to find components using wildcard character and regular expressions
     eg:-  [ *_comp ] ,  *_comp*   etc.

Always a code should fetch “n” number of components using methods inside WorkspaceManager and then apply additional logic to filter the searched result.

Is there any other mechanism or data source available using which we can query RTC SCM data to fetch the desired result directly ?.

0 votes


Accepted answer

Permanent link
I suggested the % and _ to be tried on pre 601 client. Since you are on 601 you can ignore that comment.

From what you have listed... isn't * and ? working as expected unless I am missing something obvious.

Sagar U selected this answer as the correct answer

0 votes

Comments

Ok , thank you for the clarification.
Are any other wild card or regular expression patterns also supported along with  * and  ?.


One other answer

Permanent link
Which version of the client SDK are you using?
I believe pre 601 it matched all components starting with the provided name and did not consider wild card characters such as '*' or '?'. Can you try using '%' instead of '*' and '_' instead of '?'.

0 votes

Comments

We are using Verison 6.0.1.ifix003
Yes "Starting with"  works for all versions of rtc sdk
Details of API used:

criteria.setPartialNameIgnoreCase("");
WorkspaceManager.findComponents(criteria, Integer.MAX_VALUE, null);

Results obtained is always random and not as expected, only starts with name pattern works as expected.

From a list of following components in a repo
ABC
A.B.C
B.A
A.B
A
TestPA Default Component

if criteria.setPartialNameIgnoreCase
("
")       - All components were fetched
("%")     - Empty result
("A")     - All components were fetched
("%A")   - Empty result
("A?C")  - ABC
("A
C")   - ABC , A.B.C
("A%C")  - Empty result
("A_C") -  Empty result
("A*")    -  ABC , A.B.C , A.B , A

any suggestions ?




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: May 31 '16, 4:57 a.m.

Question was seen: 3,211 times

Last updated: Jun 10 '16, 7:43 a.m.

Confirmation Cancel Confirm