NodeArtifactsRule Interface
Rule used to create and assign artifacts to specific nodes. The artifacts can be
accessed when evaluating parent node's hideExpression
to decide whether it should
be hidden or not.
A typical use case:
- The hierarchy consists of Subject nodes and each Subject may or may not have child Model nodes. There are 2 types
of Models: A & B, we want ModelA nodes to be visible and ModelB ones to be hidden. We want Subject node to be
visible only if it has a Model (either A or B). In this case we can't use
hideIfNoChildren
flag on Subjects, because a Subject node may only have a related ModelB which means Subject doesn't have children and should be displayed as a leaf node. The solution is to useNodeArtifacts
on the ModelB nodes and ahideExpression
on Subject nodes. The expression can access artifacts created by child ModelB nodes:NOT ThisNode.HasChildren AND NOT ThisNode.ChildrenArtifacts.AnyMatches(x => x.IsModelB)
note The rule is costly performance-wise and should only be used in very limited amount of specific cases where hidden child nodes need to be used to used to determine parent node's visibility.
Extends
Properties
Name | Type | Description | |
---|---|---|---|
condition | undefined | string | Defines a condition for the rule, which needs to be met in order for it to be used. | |
items | [key: string]: string | A map of items that define the values stored in the artifacts data structure. | |
ruleType | NodeArtifacts | Used for serializing to JSON. |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
onlyIfNotHandled | undefined | boolean | RuleBase | Should this rule should be ignored if there is already an existing rule with a higher priority. |
priority | undefined | number | RuleBase | Defines the order in which presentation rules will be evaluated and executed. |
Defined in
Last Updated: 08 January, 2020