-
Notifications
You must be signed in to change notification settings - Fork 208
/
RelatedInstanceSpecification.ts
69 lines (63 loc) · 2.78 KB
/
RelatedInstanceSpecification.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module PresentationRules
*/
import { Id64String } from "@itwin/core-bentley";
import { SingleSchemaClassSpecification } from "./ClassSpecifications";
import { RelationshipPathSpecification } from "./RelationshipPathSpecification";
/**
* Defines base attributes for [[RelatedInstanceByPathSpecification]] and [[RelatedInstanceByTargetInstancesSpecification]].
* @public
*/
export interface RelatedInstanceSpecificationBase {
/**
* Specifies an an alias that given to the related instance. The alias can be used to reference the
* instance in instance filter and customization rules.
*
* @pattern ^\w[\w\d]*$
*/
alias: string;
/**
* Specifies whether to omit the primary instance from the result if the other end of [[relationshipPath]]
* does not yield any related instances.
*/
isRequired?: boolean;
}
/**
* A type of [[RelatedInstanceSpecification]] that joins related instances by a relationship path.
* @public
*/
export interface RelatedInstanceByPathSpecification extends RelatedInstanceSpecificationBase {
/**
* Specifies a chain of [relationship path specifications]($docs/presentation/RelationshipPathSpecification.md)
* that forms a path from the primary instance to the related instances.
*/
relationshipPath: RelationshipPathSpecification;
}
/**
* A type of [[RelatedInstanceSpecification]] that joins related instances by target class and instance IDs.
* @public
*/
export interface RelatedInstanceByTargetInstancesSpecification extends RelatedInstanceSpecificationBase {
/**
* Specifies target class and a list of target ECInstance IDs.
*/
targetInstances: {
/** Specification for the target class to join. */
class: SingleSchemaClassSpecification;
/** Ids of the target instances to join. */
instanceIds: Id64String[];
};
}
/**
* Related instance specification is used in [content]($docs/presentation/content/ContentRule.md#attribute-specifications)
* and [hierarchy]($docs/presentation/hierarchies/ChildNodeRule.md#attribute-specifications) specifications to "join" the
* primary instance with its related instance and allow using the related instance for filtering, customization and grouping.
*
* @see [Related instance specification reference documentation page]($docs/presentation/RelatedInstanceSpecification.md)
* @public
*/
export type RelatedInstanceSpecification = RelatedInstanceByPathSpecification | RelatedInstanceByTargetInstancesSpecification;