Display enum values based on dependencies

Posts: 6
Joined: Fri Feb 21, 2014 2:45 pm

Display enum values based on dependencies

Postby mircea » Fri Dec 09, 2016 8:52 am


I have the following 2 enumerations:
Feature = [Feature A, Feature B]
SubFeature = [SubFeature 1, SubFeature 2, SubFeature 3, SubFeature 4]
I have configured a dependency between them as such:
Feature A -> SubFeature 1, SubFeature 2
Feature B -> SubFeature 3, SubFeature 4

I would like to get a wiki script that displays both features and sub-features in an ordered list, based on the dependencies defined. I.e. something like this:
1. Feature A
1.1 SubFeature 1
1.2 SubFeature 2
2. Feature B
2.1 SubFeature 3
2.2 SubFeature 4

My current code looks like this:

Code: Select all

#set($enumFeature = $polarionTool.typeFactory.getEnumType("features"))
#set($enumSubFeature = $polarionTool.typeFactory.getEnumType("subfeatures"))
#set($contextId = $trackerService.getTrackerProject("VersaView2").contextId)
#set($dataService = $trackerService.dataService)
#set($featuresEnum = $dataService.getEnumerationForEnumId($enumFeature,$contextId))
#set($subFeaturesEnum = $dataService.getEnumerationForEnumId($enumSubFeature,$contextId))
#foreach($feature in $featuresEnum.allOptions)
    1. $feature.getName()

    #set($subFeatures = $subFeaturesEnum.getAvailableOptions($feature))
    #foreach($subFeature in $subFeatures)
        11. $subFeature.getName()


I either misunderstood what the effect of getAvailableOptions is supposed to be or how to use it, I guess. Can someone please help?


Posts: 181
Joined: Thu Nov 05, 2009 3:24 pm

Re: Display enum values based on dependencies

Postby martins » Thu Feb 16, 2017 2:30 pm

To build such a dependency list you would need the IRelationMapping interface, see
http://almdemo.polarion.com/polarion/sd ... pping.html

But, as stated in the description,
This interface is not intended to be implemented by clients.

Therefore I don't know if there is a way to use this interface.


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: Ramonged, rosalindajq69 and 8 guests