/
RelationshipPathSpecification.ts
67 lines (60 loc) · 3 KB
/
RelationshipPathSpecification.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
/*---------------------------------------------------------------------------------------------
* 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 { SingleSchemaClassSpecification } from "./ClassSpecifications";
import { RelationshipDirection } from "./RelationshipDirection";
/**
* Specification of a single step in [[RelationshipPathSpecification]].
*
* @see [Relationship path specification reference documentation page]($docs/presentation/RelationshipPathSpecification.md)
* @public
*/
export interface RelationshipStepSpecification {
/** This attribute specifies the ECRelationship that should be used to traverse to target class. */
relationship: SingleSchemaClassSpecification;
/**
* This attribute specifies the direction in which the [[relationship]] should be followed.
* @see RelationshipDirection
*/
direction: `${RelationshipDirection}`;
/**
* This attribute may be used to specialize the target of the relationship.
*/
targetClass?: SingleSchemaClassSpecification;
}
/**
* Specification of a single step in [[RepeatableRelationshipPathSpecification]].
*
* @see [Repeatable relationship path specification reference documentation page]($docs/presentation/RepeatableRelationshipPathSpecification.md)
* @public
*/
export interface RepeatableRelationshipStepSpecification extends RelationshipStepSpecification {
/**
* When a number is specified, the relationship is traversed recursively the specified number of times.
*
* When it is set to a special value `"*"`, the same relationship is traversed recursively unbounded number
* of times, starting from zero (the relationship is not followed). On each traversal iteration, Presentation
* rules engine accumulates all indirectly related ECInstances as defined by the remaining relationship path.
*/
count?: number | "*";
}
/**
* Relationship path specification is used to define a relationship path to an ECClass.
*
* @see [Relationship path specification reference documentation page]($docs/presentation/RelationshipPathSpecification.md)
* @public
*/
export type RelationshipPathSpecification = RelationshipStepSpecification | RelationshipStepSpecification[];
/**
* This specification declares a step in a relationship path between a source and target ECInstances. A step
* can optionally be repeated a number of times to traverse the same relationship recursively. Multiple
* specifications of this type can be chained together to express complex indirect relationships.
*
* @see [Repeatable relationship path specification reference documentation page]($docs/presentation/RepeatableRelationshipPathSpecification.md)
* @public
*/
export type RepeatableRelationshipPathSpecification = RepeatableRelationshipStepSpecification | RepeatableRelationshipStepSpecification[];