You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/customize-pages-dashboards-and-plugins/page/entity-page.md
+72-48Lines changed: 72 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ When looking at the entity page of a certain `Workflow Run`, the related entitie
67
67
68
68
69
69
:::tip Relation path options
70
-
The relation path dropdown displays straightforward, acyclic paths. For complex scenarios involving circular relationships, advanced path configurations, multiple selfrelations, or maxHops, use [JSON mode](#filters-and-edit-json).
70
+
The relation path dropdown displays straightforward, acyclic paths. For complex scenarios involving circular relationships, advanced path configurations, multiple self-relations, or maxHops, use [JSON mode](#filters-and-edit-json).
71
71
72
72
Using "All paths" is less performant than selecting a specific path, as it requires the system to evaluate multiple relationship paths.
73
73
:::
@@ -174,57 +174,66 @@ If **Deployment Workflow** has multiple relations to **Microservice** (e.g., `de
174
174
Additionally, when you have an existing relation between blueprints, Port automatically creates a mirror property relation that allows you to traverse the relationship in both directions. This mirror relation will appear as an option in the relation dropdown, enabling you to explore connections from either side of the relationship.
175
175
:::
176
176
177
-
#### Selfrelation
177
+
#### Self-relation
178
178
179
-
A selfrelation allows a blueprint to establish a relationship with itself. This is useful when you want entities of the same blueprint to be related to other entities within that same blueprint.
179
+
A self-relation allows a blueprint to establish a relationship with itself. This is useful when you want entities of the same blueprint to be related to other entities within that same blueprint.
180
180
181
-
For example, consider an **Organization** blueprint where:
182
-
- Organizations contain teams
183
-
- Teams can belong to other organizational entities (like groups)
184
-
- All entities share the same blueprint but have hierarchical relationships
181
+
For example, consider a **Team** blueprint where:
182
+
- Organizations contain teams.
183
+
- Teams can belong to other organizational entities (like groups).
185
184
186
-
When defining a self relation, you can specify how many "hops" to traverse in the relationship chain.
185
+
All entities share the same blueprint but have hierarchical relationships.
186
+
187
+
When defining a self-relation, you can specify how many "hops" to traverse in the relationship chain.
187
188
Hops represent the number of jumps you want to make upstream or downstream through the self-relation.
188
189
189
-
<h4>Set up self relations</h4>
190
+
:::tip Create a self-relation
191
+
Before performing the following steps, make sure the desired blueprint has a relation to itself.
192
+
193
+
<details>
194
+
<summary><b>Add self-relation (click to exapnd)</b></summary>
195
+
1. Go to the [Builder](https://app.getport.io/settings/data-model) page of your portal.
196
+
2. Choose the relevant blueprint.
197
+
3. Click the `+ New relation` button.
198
+
4. Give the property a `title`, choose the same blueprint in the `Related to` field.
199
+
5. Choose the entity limit and whether its required.
200
+
6. Click `Save`.
201
+
</details>
202
+
:::
190
203
191
-
Follow these steps to set up a self relation in related entities:
204
+
**Set up self-relations tab**
192
205
193
-
1. Click the `+` button above the Related Entities table.
206
+
To add a self-relation tab to the related entities:
194
207
195
-
2. Choose your blueprint as the `Related blueprint`.
208
+
1. Click the `+` button in the **Related Entities** table.
196
209
197
-
3. Select the self relation path from the available paths.
210
+
2. Choose your blueprint as the **Related blueprint**.
198
211
199
-
:::tip How self relation hops work
200
-
If you want more than one **hop** then you would have to toggle `Json mode` on to specify more than one self relation blueprint identifier for the number of **hops** you want to make.
201
-
:::
212
+
3. Select the self-relation path from the available paths.
202
213
203
-
4. You can also toggle to `Json mode` in the "Add tab" dialog to define the relationship path with precise control over hops.
204
-
205
-
For example if we want to make 2 hops then we would have to specify 2 self relation blueprint identifiers in the path array.
214
+
4. If you want to traverse more than one hop, switch to `Json mode`.
In JSON mode, you can use the `maxHops` feature to control the number of relationship traversals. Path elements can be objects instead of strings, and `maxHops` can only be specified once in the path.
217
-
218
-
```json showLineNumbers
226
+
227
+
- Use maxHops (for variable hops).
228
+
```json showLineNumbers
219
229
"relationPath": {
220
230
{
221
231
"relation": "<SELF_RELATION_IDENTIFIER>",
222
232
"maxHops": <number between 1 and 15>
223
233
}
224
234
}
225
235
```
226
-
227
-
You can also have a mix of fixed and variable hops.
236
+
- Combine fixed hops with maxHops for mixed control.
228
237
229
238
```json showLineNumbers
230
239
"relationPath": {
@@ -238,27 +247,28 @@ Follow these steps to set up a self relation in related entities:
238
247
}
239
248
```
240
249
241
-
:::info maxHops limitation
242
-
You can only use `maxHops` once in a path and it accepts a number between 1 and 15.
250
+
:::info `maxHops` limitation
251
+
The `maxHops` parameter can only be applied **once** per path, and it accepts values from **1 to 15**.
243
252
:::
244
253
245
-
6. Click on `Save` to save the tab.
254
+
5. Click on `Save` to save the tab.
246
255
247
-
:::info Selfrelation identifier
248
-
Note that `self_relation` in these examples represents the identifier of the selfrelation you created in your blueprint. Replace it with your actual selfrelation identifier.
256
+
:::info Self-relation identifier
257
+
Note that `self_relation` in these examples represents the identifier of the self-relation you created in your blueprint. Replace it with your actual self-relation identifier.
249
258
:::
250
259
251
260
252
-
<h4>Examples</h4>
261
+
**Examples**
262
+
253
263
Let's take a look at some examples using the concept of Teams.
**Basic selfrelation with multiple selfrelations:**
269
+
**Basic self-relation with multiple self-relations:**
260
270
261
-
If you want exactly 2 hops, specify the relation twice:
271
+
If you want **exactly 2 hops**, specify the relation twice:
262
272
263
273
```json showLineNumbers
264
274
{
@@ -277,8 +287,9 @@ If you want exactly 2 hops, specify the relation twice:
277
287
}
278
288
}
279
289
```
290
+
In this case, the added tab under the `Unit` entity should show the `Group` entity.
280
291
281
-
**Selfrelation with maxHops for variable hops:**
292
+
**Self-relation with maxHops for variable hops:**
282
293
283
294
If you want a variable number of hops (between 1 and 15), use maxHops:
284
295
@@ -302,24 +313,37 @@ If you want a variable number of hops (between 1 and 15), use maxHops:
302
313
}
303
314
```
304
315
316
+
In this case, the added tab under the `Unit` entity should show the `Basic Team`, `Group` and `Office` entities.
317
+
305
318
**Mixed approach example:**
306
319
307
320
You can also mix fixed hops with variable hops. For example, if you specify `self_relation` twice followed by a `maxHops` object, the system will start traversing from the 2 hops already made and continue with the additional hops specified in `maxHops`.
308
321
309
322
```json showLineNumbers
310
-
"relationPath": {
311
-
"path": [
312
-
"self_relation", // 1st hop: Unit -> Basic Team
313
-
"self_relation", // 2nd hop: Basic Team -> Group
314
-
{
315
-
"relation": "team_self_relation",
316
-
"maxHops": 3// Continues from Group, adding up to 3 more hops (Group -> Office -> etc.)
317
-
}
318
-
]
323
+
{
324
+
"title": "Team Hierarchy",
325
+
"targetBlueprint": "Team",
326
+
"dataset": {
327
+
"combinator": "and",
328
+
"rules": []
329
+
},
330
+
"relationPath": {
331
+
"path": [
332
+
"self_relation", // 1st hop: Unit -> Basic Team
333
+
"self_relation", // 2nd hop: Basic Team -> Group
334
+
{
335
+
"relation": "team_self_relation",
336
+
"maxHops": 3// Continues from Group, adding up to 3 more hops (Group -> Office -> etc.)
337
+
}
338
+
],
339
+
"fromBlueprint": "Team"
340
+
}
319
341
}
320
342
```
321
343
322
-
In this example, the system will traverse 2 fixed hops (Unit → Basic Team → Group) and then continue with up to 3 additional hops using the `team_self_relation`, starting from where the fixed hops left off. This could represent a complete organizational hierarchy from Unit all the way up to higher-level organizational structures.
344
+
In this example, the system will traverse 2 fixed hops (`Unit` → `Basic Team` → `Group`) and then continue with up to 3 additional hops using the `team_self_relation`, starting from where the fixed hops left off. This could represent a complete organizational hierarchy from Unit all the way up to higher-level organizational structures.
345
+
346
+
In this case, the added tab under the `Unit`entity should show the `Group` and `Office` entities.
0 commit comments