A12 relationship extensions

Hi all,
i have some A12 relationship topics i would like to discuss together.

There is demand in the cosmo project to have them so i would like to discuss which option we have to build them.

In general they are about constrains if a document is a candidate for a relation.

Feature A - filter candidates

Use case: documentA is only a candidate if it fulfills a filter query:
e.g. Only brokers form the same country as the client can be selected
e.g. Only active partners can be selected (a filter like this can be created by a user)
e.g. Only cars with salesValue < 100.000 can be selected (a filter like this can be created by a user)

Resources

  • A12-16516

complexity drivers

  • build the filter query: type (string, boolean, date,…), path and value
  • if data changes assignment becomes invalid > selected is not in list of candidates :warning:
    • e.g. a partner set to inactive. Should this be possible?
  • configuration for it:
    • find the source value
    • find the operator
    • find the target fields for the path
    • relation between source and targets

Feature B - candidates are documents linked to other document

Use case: Only documents linked to documentA via relation X can be linked to documentC
e.g. Only accounts linked to a broker can be linked to an offer

Kind of a new relationship type: relationship between document and relationship

complexity drivers

  • source of candidates is different not documents but relationship data
  • combination with feature A
  • if relationship changes assignment becomes invalid: selected is not in list of candidates
    • Should it be possible to change relations that is the source of another relation?

resources

A12-14401

Feature C - limit candidates to fit to upper limit of relation

Use case: A document is a candidate if it’s upper limit will not be broken by a new assignment

e.g Only unassigned vehicles can be assigned to an offer.

complexity drivers

  • combination of document query and relationship query
  • n:m (m>1) relations
    • if we limit to 1:n we could use negative of feature B candidates are documents not linked to other document
  • If all used relations are filtered out assignment to the current document will be filtered out. Might break other A12 use-cases.

resources

Feature D - use feature A, B and C together

e.g. candidates for accounts are accounts linked to a broker (B) that are not used (C) and active (A)

Feature X - follow constrains of feature A,B,C in back-end

ADD_LINK and MODIFIY_LINK operation need to consider the constrains of A,B
:white_check_mark: Validation of feature C already implemented by A12

Questions

  • Are the use cases understood?
  • Would A12 describe this features the same way?
  • Is there anything available already that could be used instead?

Next steps

Setup a meeting to discuss options.

Cheers
Julian

We had a meeting and discussed several usecases.
Some of them will be solvable with the new Query API coming in experimental state in February 2025 with the 2024.06-ext4 release. A developer will be able to use it. We are working on modeling support and try to provide something with the 2025.06 release. I will keep in contact with the reporter regarding this.

Especially the CDM parts need the “Consolidate Relationship Engine and CDMs” workstream to be finished. This is currently planned for 2025.06.

We also discussed “Business Constraints for Relationship Models”. @julian-typed-spruce and the COSMO team will derive an A12 ticket from this discussion.

Hi,

In our project, we need to prefilter the dropdown options (candidates / available_items) that are comming from a relationship model, e.g. filter active companies, or filter companies from a given country.
This filtering condition would need to be specified on Form Model level in a static manner, preferably on SME.

If I understand correctly, the mentioned “Feature A - filter candidates” is something that would deliver this kind of functionality? If yes, when can we expect it to be available?
Are there any other ways we could implement it atm? Would the new Query API be helpful in this case?

Regards,
Grzegorz

Moin @g.witek,
the Query API allows to filter relationship candidates based on field values. You can create such query requests and send them to the corresponding endpoint.

Data Services Documentation
The new Query API is already documented in the corresponding documentation from Data Services, see Query API > has Operator. In your case, the has Operator could be used with a constraint to filter relationship links that have to satisfy a specific condition.

Query API Tutorial
There’s a dedicated developer tutorial for the new Query API that discovers the new functionality and possibilities. An example for the has operator can be found under Task 2 - Discovering Queries > has Operator.

At the moment there’s no finalized concept yet on how to propagate the Query API capabilities to the modelers and the corresponding UI models.