RelatedInstanceSpecification Type alias
This sub-specification allows joining the primary node instance with any number of related instances and creating hierarchies based on a mix of those related instances.
The related instance property values can be accessed from multiple different places:
- Instance filter
- Customization rule value
- Grouping rule
Example:
{
"id": "related_instance_example",
"rules": [{
"ruleType": "LabelOverride",
"condition": "ThisNode.IsInstanceNode ANDALSO this.IsOfClass(\"Model\", \"BisCore\")",
"label": "modeledElement.UserLabel"
}, {
"ruleType": "Grouping",
"condition": "ParentNode.IsNull",
"class": {
"schemaName": "BisCore",
"className": "Element"
},
"groups": [{
"specType": "Property",
"propertyName": "CodeValue",
"createGroupForSingleItem": true
}]
}, {
"ruleType": "RootNodes",
"specifications": [{
"specType": "InstanceNodesOfSpecificClasses",
"classes": { "schemaName": "BisCore", "classNames": ["GeometricModel"] },
"arePolymorphic": true,
"instanceFilter": "modeledElement.CodeNamespace = 1",
"relatedInstances": [{
"relationshipPath": [{
"relationship": { "schemaName": "BisCore", "className": "ModelModelsElement" },
"direction": "Forward",
}],
"class": { "schemaName": "BisCore", "className": "Element" },
"alias": "modeledElement"
}]
}]
}]
}
Here BisCore:GeometricModel
instances are joined with BisCore:Element
instances to create the hierarchy. This allows:
- Related
BisCore:Element
properties to be accessed inInstanceFilter
usingmodeledElement
alias. - The
LabelOverride
rule to usemodeledElement
alias to access properties of the joined related instance. - The
GroupingRule
to be applied because it's groupingBisCore:Element
which is now part of the generated nodes.
RelatedInstanceSpecification = DEPRECATED_RelatedInstanceSpecification | RelatedInstanceSpecificationNew
Defined in
Last Updated: 05 June, 2020