Asset relations configurations are used in Table widgets and in the Properties editor. In the Table widget, they define which assets can be added to a node of the table. In the Properties editor, they define, which asset structures can be expanded and edited in the editor table.


Target group

Solution developers

Context

  • Table widget configuration: In Table widgets, define which asset relations can be added/removed in each node of the table.

  • Properties editor configuration: In the Properties editor, define which asset structures can be expanded and edited in the editor table.

Prerequisites

You should have a basic understanding of relationships between assets and be familiar with the asset structures in your censhare system.

Introduction

The Table widget displays assets in a table view. Users can add or remove relations to the assets. This functionality must be configured separately for each relation and each node type of the table. It allows you to control, which type of relations users can add or remove in your system.

censhare stores the settings for the "Add relation" functionality in a configuration asset separately from the Table widget. Configuration assets are referenced in the table widget configuration. There, you can select one or multiple configurations. All configuration assets created as described in this article are available in the Table relations configuration of the Table widget.

For example, in censhare PIM, products are related to product items and feature stories. Each relation has a specific type. Therefore, an asset relation configuration is required for each relation type. In the asset relation configuration, you specify the relation type as well as source and target assets. In the Table widget configuration, you can add both table widget relations, so that users can choose which they want to create.

Configuration

To create a new table widget relations configuration asset, proceed as follows:

Basic configuration

The basic settings determine the usage of the asset in the table widget's table relations configuration:

  1. Create an asset of the type Module / Configuration Asset relation (config).

  2. Enter a name and resource key and click OK to save it.

  3. Go to the “Administration” tab and edit the properties in the “Administration” widget.

  4. Select the check-boxes “Enabled” and “In cached tables”.

  5. In the field “Usage”, select “Asset relation configuration”.

  6. Click OK to save.

Relation configuration

This part of the setup refers to the relations, users can add (and remove) in table widgets that use this configuration. Go to the "Overview" tab and open the edit dialog of the "Properties" widget. Configure the fields as follows:

Field

Description

"Relation" section

Name (localized)Enter a name for this configuration asset. When you configure a table widget, this name will appear in the "Table relation configuration" field.

Asset relation type

Enter the ID of the relation type or asset reference feature. You can find the ID’s in the “Master data / Asset relation types” folder or “Master data / Features” folder in the Admin client. A relation ID for the "Product item" relation could look like this, for example: “user.product-item.”. A reference ID for the "Product category reference could be “censhare:product.category”, for example.

Asset relation direction

Select here one of the following values: “Child”, “Parent”, “Feature”, “Feature reverse”. Use “Child” or “Parent” if the asset relation type is an asset relation, for example, “user.product-item.”. Use “Feature” or “Feature reverse” if the type is an asset reference, for example, “censhare:product.category”.
One and the same relation can thus be set up here in two ways: from parent to child or vice versa. The selection you make here, determines, in which assets the “+” button to add an asset relation will appear.
For example, the “Product category” relation can be created as an asset feature reference from a product asset source to a product category target. For the user, however, it makes more sense to create a “Feature reverse” relation from a product category source to a product target. Technically, the result is the same in both cases. If you are not sure, in which direction certain relation is created, check the setup for the relation type or asset reference feature in the Admin Client.

Asset source type

Enter here the asset type(s), from which the relation is created. The field requires the ID of the asset type, for example, product.category. or a wildcard, for example "product.*". See the Hints and tips section for more details on this. The type you select here must be part of the asset structure displayed in the table. Otherwise, users cannot add assets because the source asset is not shown in the table.

Asset target type

Enter here the asset type users can relate to the source asset. The field requires the ID of the asset type, product.item., or a wildcard, for example "product.*". See the Hints and tips section for more details on this. Make sure that the table is configured so that the target assets are displayed. Otherwise, users do not see the asset they added at all.

"Working copy" section

Relation

This field is not needed in this context. Leave it empty.

To save the configuration, click OK to close the dialog and then click SAVE or SAVE & CLOSE. The configuration is now available in the table widget configuration.

Hints and tips

Choose the proper direction of a relation

Before configuring the asset relations, you should think about how users would create a relation from their perspective. Any relation can be created both ways: from child to parent or from parent to child. The same goes for asset references. Here, the directions are named "feature" and "feature reverse".

For example, the "Product category" relation can be created as an asset feature reference from a product asset source to a product category target. However, depending on your workflows, users may want to create a "Feature reverse" relation from a product category source to a product target. Technically, the result is the same in both cases, but the asset relation configuration is different.

Use wildcards in the asset source and target type definitions

Asset types in censhare can be configured in hierarchies. For example, the asset types "Product item", "Product accessory", "Product spare part" and others related to products are subtypes of the "Product" asset. In Asset type definition in the censhare Admin Client, the notation [asset_type].[asset_sub_type]. is used to indicate this hierarchy. Likewise, the wildcard expression [asset_type].* designates the asset type and all subtypes (as you may know from search fields and hierarchical value lists).

With a wildcard, you specify an asset type and all its subtypes instead of a single asset type as source or target asset, respectively. As shown above, wildcards are marked with an asterisk. The most generic usage of wildcards is just an asterisk "*" - this expression matches all asset types. For example, if you define the relation type "Assignment" (notation "user.") and an asterisk (notation "*") as target asset in the table widget relation asset. Users then can assign any asset to the selected source asset type in the table.

Wildcards are handy if you want to configure multiple asset types as source or target asset that all belong to the same hierarchy. For example, if you define task.* in the target type field, users will be able to assign any (sub)type of task in the table widget. However, make sure that the relation type matches the asset types - in this case, the relation type has to be set to "user.task.".

In some specific cases, wildcards cannot be used. For example, you want to define a "product." as source asset type and then "product.*" as target asset type. There are several subtypes to products such as product items, product accessories or product warranties that match this pattern. However, all of these require a specific relation type: "user.product-item.", "user.product-accessory.", "user.product-warranty,". Therefore, you must configure one asset relation configuration asset per relation. It is not possible to configure multiple relation types in one asset.

Thus, make sure that you use wildcards in combination with matching relation types such as "user.task." with "task.*" or use the generic "user." relation (assignment).

Asset filter dependencies

Be aware that relations might use asset filters, so that only a certain asset type can be parent and, respectively, child asset. The widget configuration does not apply any restrictions. However, censhare may apply asset filters when creating a relation.

Asset filters are defined for each asset relation type or asset reference feature. To check filters, open the "Asset relation types" or the "Features" entry in the Master data directory of the censhare Admin-Client. Search for the desired asset type or feature in the table and double-click to open the configuration. In the "Filters" entry, any configured filters are shown for parent and child assets.

Both the configuration and possible asset filters only refer to features of the "Asset reference" or "Asset key reference" value type.

The filters defined in the asset relation or asset feature configuration determine, whether an asset relation requires a certain asset type as child or parent asset. Most relation types do use asset filters, except the generic “Assignment”. For example, the relation type “Product item” requires a “Product” asset as parent and a “Product item” asset as child.

Coherent usage in table widgets

In table widgets, the displayed assets and respective asset relations are configured independently from the relation configuration described in this article. Both have to be coherent, though, in order to show the desired results. First, make sure that the source target asset type in this configuration is displayed at all in the table widget. Otherwise, users cannot create asset relations. Second, make sure as well that all target asset type user can add in the widget are displayed in the table. Otherwise, they can create the respective relation but the result is not shown. For example, the table configuration displays projects and tasks, and the relation configuration allows to add any task subtype asset (target asset type "task.*"). Users can create relations to, say, a Milestone, but will not see it in the table. The relation is created, though. In order to make the configuration coherent, make sure that the table widget shows also the respective task subtypes.

Next steps

Use the asset relation configuration  in a Table widget, or in a Properties editor configuration.