Jump to: navigation, search

Dynamic Selective List (Client)

In property editing, UBIK® supports defining a list of values for users to choose from instead of letting them enter arbitrary values. These are what we call selective lists and selective list items.

Static & dynamic versions

Previously, such a list and list items are static and a part of the meta definitions, which means it's difficult or even impossible to update once they are configured and delivered to the clients in productive environments.

In some scenarios where such lists or list items are known to change quite often, a more dynamic version is needed.

Technical concept

The items of a dynamic selective list are instances of ContentClass, also known as UBIK® objects. So picking a dynamic selective list item is just like picking a query result item during editing a Guid/link property. In fact, properties having dynamic selective lists are Guid properties and the feature is based on the same technology as the general Guid property editing. In other words:

  • The items are found through a filter query (specifically a SYSCLS DYNAMIC SELECTIVE LIST);
  • The display strings of the selected item are presented as the display value of the property;
  • The UID of the object/item is the actual value of the property;
  • Through this Guid link, it's possible to get all property values on the selected item.
IC Attention.pngBecause you will have to set up additional data such as the METACLASS_IDS property on the query, it's highly recommended to read the details about offline query first.

Resolving dynamic items

The crucial part of this new solution is that it's dynamic, meaning the items to choose from can vary upon data changes of the following.

Data hierarchy

To resolve the suitable dynamic selective list items, UBIK® first looks for so-called dependency objects, namely objects that the property being edited depends on. This is done through checking the data hierarchy upward, starting from the object being edited, with the following rules:

  • The process is recursive. UBIK® looks up the hierarchy until it either reaches the top/root or finds an object with the dependency property.
  • An object can have multiple parent objects. All those parents are taken into account in the item resolving process. Finding one dependency object along a parent lineage doesn't stop UBIK® from checking the other lineages and this is why it's possible to have multiple dependency objects.
  • It's also possible that the dependency object is the one being edited itself.
IC Hint square.pngThe property values found on multiple dependency objects are used in the follow-up querying process with a "logic or" relation. For example, if a string value "A" is found on one suitable dependency object and "B" on another, the query will return those dynamic selective list items having either "A" or "B" in their QUERY_CRITERION_NAME'd property values.

Dependency property values

Dependency property values are those values that directly determine which dynamic selective list items are available. Once UBIK® finds the dependency objects in the data hierarchy, it tries to extract values from the specified properties (dependency property name) on those objects.

The values are then used as inputs for the filter query (configured on the property being edited) according to the dynamic selective list criteria. From there on, the item resolving process becomes identical to offline querying.

IC Hint square.pngSpecifically speaking, the multiple values are used with a value definition of "in a collection" during the querying process, effectively applying them in a "logic or" relation. Like in the general offline query feature, individual string values are compared using string contains whereas other types are compared using equality.

Dynamic selective list criteria

UBIK® relies on special objects with the SYSCLS DYNAMIC SELECTIVE LIST CRITERION to resolve items dynamically. These objects carry the following properties and each of them serves a different purpose of configurability.

  • DYNAMIC_SELECTIVE_LIST: The Guid of the SYSCLS DYNAMIC SELECTIVE LIST instance that should be used in resolving dynamic selective list items.
  • DEPENDENCY_CLASS: (Optional) The Guid of the MetaClass which instructs UBIK® the type of objects to exclusively look for when searching for dependency objects in the data hierarchy. If unspecified, any object having the specified dependency property can be a dependency object.
  • DEPENDENCY_PROPERTY_NAME: The name of the property whose values determine the dynamic selective list items.
  • QUERY_CRITERION_NAME: The name of the property that the resolved dependency property values should be filled into for querying.
  • IS_MULTI_VALUE_STRING: (Optional) Whether the value of the dependency property should be interpreted as multiple string values separated by ";". Defaults to false. Additional note: Currently, values specified in a multi value string are only considered as strings. For example, "1;2;3" will be considered as strings "1", "2" and "3" and used in the query as such, resulting in finding items having their corresponding property values containing any of these string values.
  • IGNORE_NULL: (Optional) Whether null dependency property values should serve as a filtering criterion or be ignored. Defaults to false.
IC Hint square.pngThe data type of the DEPENDENCY_PROPERTY_NAME'd property should match that of the QUERY_CRITERION_NAME'd criterion so that the values can be used. Otherwise, that dependency property is ignored and the item resolving algorithm will continue looking up the data hierarchy.

Example use case

Example use case
Example use case

In this example, two properties "Model Guid" and "Part Guid" are associated with a dynamic selective list each.

  • "Part Guid" depends on a property "Types of Parts" and uses SYSCLS DYNAMIC SELECTIVE LIST "Part Query" to find the suitable dynamic selective list items (parts).
    • From the data hierarchy, UBIK® extracts the "Types of Parts" values. There are many factors that can affect which objects UBIK® takes the values from, see resolving dynamic items for details.
    • If for example, the final "Types of Parts" value found is "Mechanical", the query will return all those "DSL Item Instances" that are "Mechanical", e.g. "Screw". The user can then select one of those items and its Guid will be set as the value of property "Part Guid".
  • "Model Guid" depends on a property "Part Guid" and uses SYSCLS DYNAMIC SELECTIVE LIST "Model Query" to find the suitable dynamic selective list items (models).
    • Similarly, UBIK® tries to find the "Part Guid" values, which can be found on the object itself in this case.
    • If for example, the final "Part Guid" value is the Guid of item "Screw", the query will return all those "DSL Item Instances" that are "Screw", e.g. "M1.6". The user can then select from those just like with the other property mentioned above.

See also