Functions for rows in reports

You can use XPath functions to return rows of data; these functions can be used in the definition of a data set in the report editor.

As described in Functions for topology report expressions, you can use these XPath functions in the row definition for a report data set.

getAllHosts(inputXPath)
Returns the units that are the source of hosting links to the specified unit. This function returns only the direct hosts of the specified unit and not all of the units in the specified unit's hosting stack.
inputXPath
The XPath location of the unit.

Return type: core:Unit

getAttributes(inputDmoXPath, 'isIncludeUnSet')
Returns a list of attributes that are defined on the specified topology element and the values of those attributes.
inputDmoXPath
The XPath location of the topology element.
isIncludeUnSet
TRUE to include attributes that do not have a specified value (that is, attributes that are set to a null value), or FALSE to exclude attributes that are do not have a specified value. This value must be enclosed in quotes.

Return type: ecore:EAttribute

getConstraintByType(inputUnitXPath, 'dmoType')
Returns the constraints of the specified type (or any subtype of the specified type) on the specified topology element. This function does not recurse, meaning that if you pass the location of a unit to the function and that unit has a constraint with a child constraint, the function returns only the top-level constraint and not the child constraint.
inputUnitXPath
The XPath location of the topology element to search.
dmoType
The type of constraint to find, such as core:Constraint. This value must be enclosed in quotes.

Return type: core:Constraint

getDependsOn(inputUnitXPath)
Returns the units that are the target of dependency links from the specified unit. This function does not recurse; that is, this function returns only the direct target of dependency links from the unit and not any units that are connected to those targets.
inputUnitXPath
The XPath location of the unit.

Return type: core:Unit

getExtendedAttributes(inputXPath)
Returns a list of user-defined attributes that are defined on the specified topology element.
inputXPath
The XPath location of the topology element.

Return type: ecore:EAttribute

getFinalRealizationByType(inputTopologyXPath, 'dmoType', 'isIncludeConfig')
Returns the final realization units (that is, the last unit to which the other units are realized) for all of the units of the specified type or a subtype in the specified topology.
inputTopologyXPath
An XPath expression that specifies the context of the topology in which to search for units, usually //* to search for units anywhere in the topology.
dmoType
The type of unit for which to find the final realization, such as core:Unit. This value must be enclosed in quotes.
isIncludeConfig
TRUE to include configuration units or FALSE to omit configuration units. This value must be enclosed in quotes.

For this function, you can use the return type core:Unit. To retrieve more specific information about the final realization units (such as an attribute that is defined on that unit type rather than on the core unit type), you can set the return type to the same value that you used for the dmoType parameter. You can use the same that you used in the dmoType parameter because all of the units that this function returns will be of that type or a subtype.

For example, assume the following topology, in which three different types of conceptual operating system units are realized to three separate concrete operating system units:
Three different conceptual operating system units are each realized to a concrete operating system unit of the same type
You can pass the operating system type that is the supertype of all these units, os:OperatingSystemUnit, to the getFinalRealizationByType function as in this example:
getFinalRealizationByType(//*, 'os:OperatingSystemUnit', 'false')
In this case, the function returns the three concrete units, because they are the final realization of the units of the type specified in the parameters.
In most cases, you use the XPath expression //* as the value of the inputTopologyXPath parameter. In this case, the function returns the final realization units in the topology specified in the report's data source. However, if you want to find the final realization of a unit whose topology has been imported into another topology, you can specify the XPath location of that other topology. For example, consider the following topologies:
A series of operating system units that are realized across different topologies
In this example, a generic operating system unit in topology A is realized to a generic Linux operating system unit that is also in topology A. Then, topology A is imported into topology B and the generic Linux unit is realized to a conceptual Redhat Linux unit in topology B, which is realized to a concrete Redhat Linux unit in topology B. Assume that you create a data source that refers to topology A and create a data set using the following expression:
getFinalRealizationByType(//*, 'os:OperatingSystemUnit', 'false')
This expression returns the generic Linux unit in topology A because the XPath expression //* refers to the topology that is listed in the data source. If you want to retrieve the final realization of the generic operating system in topology B, you must pass the XPath location of topology B, as in the following example:
getFinalRealizationByType(resolveURI('platform:/resource/MyProject/topologies/com/mycompany/B.topology#/'), 
'os:OperatingSystemUnit', 'false')
In this case, the function returns the concrete Redhat Linux unit from topology B.
getFoundInDiagrams(inputUnitXPath)
Returns a list of diagrams in which the specified unit is found.
inputUnitXPath
The XPath location of the unit.

Return type: notation:Diagram

getHosted(inputXPath)
Returns the units that are the target of hosting links from the specified unit. This function does not recurse; that is, this function returns only the units that are directly hosted by the specified unit, and not any units that are hosted by those units.
inputXPath
The XPath location of the unit.

Return type: core:Unit

getHostedByType(inputUnitXPath, 'dmoType', 'isIncludeConfig', 'isRecurse')
Returns the units that are both hosted by the specified unit and are of the specified type or a subtype of that type.
inputUnitXPath
The XPath location of the unit.
dmoType
The type of unit to find. To return all units that are hosted by the specified unit, use core:Unit. To limit the results to a particular type of unit and subtypes of that unit, specify a unit type, such as database:DatabaseUnit to return only database units. This value must be enclosed in quotes.
isIncludeConfig
TRUE to include configuration units or FALSE to exclude configuration units. This value must be enclosed in quotes.
isRecurse
TRUE to recurse, that is, to include units that are indirectly hosted by the specified unit, or FALSE to include only the units that are the source of hosting links to the specified unit. This value must be enclosed in quotes.

Return type: core:Unit

getImportedBy(inputUnitXPath)
Returns the topologies into which the specified unit is imported.
inputUnitXPath
The XPath location of the unit.

Return type: core:Topology

getImportedTopology(inputXPath)
Returns the actual topology to which an imported topology refers. In other words, you pass the XPath location of an imported topology to this function, and the function returns the topology that was imported. For example, if you import topology A into topology B, you can pass the XPath location of the imported instance of topology A in topology B to the function, and the function returns topology A.
inputXPath
The XPath location of the imported topology.

Return type: core:Topology

getImportUnits(inputXPath)
Returns the units of a specified imported topology, including units that are not visible when the topology is imported, such as private units.
inputXPath
The XPath location of the imported topology.

Return type: core:Unit

getMemberIn(inputXPath)
Returns the units that the specified unit is a member of. In other words, this function returns the units that are the source of a membership link to this unit.
inputXPath
The XPath location of the unit.

Return type: core:Unit

getMemberOf(inputXPath)
Returns the members of the specified unit. In other words, this function returns the units that are the target of a membership link from this unit.
inputXPath
The XPath location of the unit.

Return type: core:Unit

getRealizedBy(inputXPath)
Returns the units that are the target of a realization link from this unit.
inputXPath
The XPath location of the unit.

Return type: core:Unit

getRealizes(inputXPath)
Returns the units that are the source of a realization link to the specified unit.
inputXPath
The XPath location of the unit.

Return type: core:Unit

getRequiredBy(inputUnitXPath)
Returns the units that have a dependency link to the specified unit.
inputUnitXPath
The XPath location of the unit.

Return type: core:Unit

getSource(inputUnitXPath)
Returns the source of the specified link.
inputUnitXPath
The XPath location of the link

Return type: core:Unit

getSourceConstraintLink(inputXPath)
Returns the constraint links for which the specified unit is the target.
inputXPath
The XPath location of the unit.

Return type: core:ConstraintLink

getTopologyDiagrams(inputXPath, 'diagramName')
Returns one or more of the diagrams in a specified topology. After you have a diagram, you can retrieve attributes such as its name or pass the diagram to getTopologyDiagramImage to retrieve an image of the diagram.
inputXPath
The XPath location of the topology, in most cases DeployCoreRoot/topology.
diagramName
The name of the diagram to retrieve, or an asterisk as a wildcard character to retrieve all of the diagrams that are associated with the topology. This value must be enclosed in quotes.

Return type: notation:Diagram

instanceOf(inputTopologyXPath, 'dmoType')
Returns all of the topology elements of the specified type in the specified topology.
inputTopologyXPath
An XPath expression that specifies the context of the topology in which to search for units, usually //* to search for units anywhere in the topology.
dmoType
The type of topology element to find, such as core:Unit for units or core:Constraint for constraints. This value must be enclosed in quotes.
For example, to create a data set that includes every unit in the topology, use this expression:
instanceOf(//*, 'core:Unit')
Similarly, to retrieve every realization link in the topology, use this expression:
instanceOf(//*, 'core:RealizationLink')

The return type for this function is the same type as the dmoType parameter.


Feedback