It's all about the answers!

Ask a question

Load rule: exclude sub folders


0
1
Alexander Schick (2724) | asked Jun 23 '16, 9:58 a.m.
edited Jun 29 '16, 10:54 p.m. by David Lafreniere (4.8k7)
Hello everyone,

we are currently trying to exclude a sub folder in a component from being loaded. In the load rule, we are using the parentLoadRule with exclude and filter elements below. This works fine when excluding elements in the root folder of the component, but we cannot exclude only specific sub folders.

For example, we have the following structure in the component:
- Test
- Test\A
- Test\B
We would like to only exclude "Test\B".

Is this possible at all? The documentation seems to hint into this direction: "[...] filtering to control which of the immediately contained items should be loaded [...]"

I appreciate any input or advice on this topic!

2 answers



permanent link
Alexander Schulz (1122) | answered Jun 27 '16, 2:34 a.m.
Hi Alex,

you can use "Parent Load Rule" and "Exclude filter"

..."

exclude

The exclude element is a collection of filter elements to be applied to the names of the items contained within the parent folder to decide whether they should be in the list of items to be loaded or not. Note the include filters are also applied (if specified) so if the include filters does not identify an item to be considered for loading, then it will also be excluded even though not specifically listed in the exclude filters. The filter allows for an exact name match or a pattern match on the name.

..."



Comments
Mallikarjuna Manoj Kandala commented May 18 '17, 1:23 a.m.

When I use Parent load rule and exclude filter , it is not filtering the files inside the sub folders. It just filters the files at the top level/root directory of component.


permanent link
Christian Giesa (13137) | answered Feb 11 '20, 9:00 a.m.

 Hello Alexander,


you can achieve this like the following:

(optional)
<parentLoadRule>
        <component name="Component/>
<parentFolder repositoryPath="/"/>
    <exclude>
            <filter pattern="Test"/>
        </exclude>
        <sandboxRelativePath pathPrefix="/Component/"/>
    </parentLoadRule>

(mandatory)
<parentLoadRule>
        <component name="Component/>
<parentFolder repositoryPath="/Test/"/>
    <exclude>
            <filter pattern="B"/>
        </exclude>
        <sandboxRelativePath pathPrefix="/Component/Test/"/>
    </parentLoadRule>

Your answer


Register or 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.