Creating indirect collections

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Experience design > Advanced topics >

Creating indirect collections

Overview

In order to make the most out of the My stuff menu, you may present to stakeholders different data sets which are product of either direct collections in the data model, or indirect collections, as described at My stuff.

While it may be most common and easier to use direct collections in My stuff, the potential of indirect collections relies on the fact that they do not need to be already designed in the data model to target a collection which is accessible more than 1 entity away.

Additionally, indirect collections allow you to include design-time filters to ensure you only display items from that collection with a given criteria.

 

Indirect_3

 

Concepts

Before you start, make sure you consider the following scenarios to identify when you can use an indirect collection:

Collection of data which is not directly bound to the stakeholder (e.g, collection of a collection, collection of a related attribute, or related attribute of a collection).

Reversed one-to-many relationship.

 

For a better illustration, the following examples elaborate on how to define an indirect collection when having a collection of a collection and a reversed one-to-many relationship.

 

1. Collection of a collection

A collection of a collection happens when the stakeholder has a collection of Entity A, which in turns has a collection of Entity B.

 

Indirect_1

 

When an indirect collection is defined in this scenario, it is equivalent for the My stuff section to have the following relationship:

 

Indirect_4

 

2. Reversed one-to-many collection

A reversed one-to-many collection happens when an Entity A has a related attribute relationship to the stakeholder.

 

Indirect_2

 

This means, that the Related stakeholder reference has been defined as shown below:

 

Indirect_15

 

When an indirect collection is defined in this scenario, it is equivalent for the My stuff section to have the following relationship:

 

Indirect_5

 

note_pin

You may also define a permanently reversed one-to-many collection, by editing your data model (one which does not apply only to My stuff).

The advantage of defining a permanently reversed one-to-many collection is that you can reuse it for expressions and forms.

For more information please refer to the Relationships and reversing a related attribute.

 

Creating indirect collections

In order to define the Xpath of an indirect collection,  go into the Expert view and click Entities.

Locate the Stakeholder entity and go into its Collections item.

 

Custom_filter_2

 

Select the New indirect collection option, right-click the Collections node or selecting it directly from the ribbon.

 

Indirect_6

 

Set a Name and a Display name for the new indirect collection. The Display name will be used in the Work Portal.

 

Indirect_7

 

Once you press Next, a window with the navigable relationships is displayed. By default, the starting point is the current stakeholder (painted in blue).

The relationships shown in the right frame are the ones related to the entity displayed in green (or blue if any relationship has been selected).

 

Indirect_8

 

Navigate through the relationships until the last entity be the one desired to relate.

In this example, notice that a Patient has many instances of Appointment, while each Appointment has 1 assigned Medical Center.

 

Indirect_9

 

If the path has a collection, you can filter the final results, leaving only the ones related to the registries not filtered in said collection. To filter a collection, hover over the collection and select Add Filter.

 

Indirect_10

 

A window will be shown prompting for a boolean filter. Set the filter and then select Ok. More than one filter can be configured, as long as the result is a boolean value.

 

Indirect_11

 

When a filter has been applied to a collection, it will show a funnel icon with the number of filters it has. If hovered over, the current filters will be displayed.

 

Indirect_12

 

Once finished, decide whether leaving repeated records, and then check/uncheck the option.

 

Indirect_13

 

To save the new indirect collection click Finish.

 

In this example, we have correctly defined an indirect collection, allowing the Patient to view the records of all the medical centers he/she has been related to when an appointment has been rescheduled.

 

Indirect_14