XPath retrieve objects with association defined in non-persistent object - Mendix Forum

XPath retrieve objects with association defined in non-persistent object

15

Use Case example

More than once, I've encountered a SearchHelper entity which is made persistent in order to function. A datasource microflow is used to retrieve all relevant items by checking the search fields values. As soon as you make use of an association in a non-persistent search entity, this will result into the error "association ... is not allowed in an XPath constraint, because it starts in an entity that is not persistable.". As pragmatic solution, the SearchHelper is made persistent, causing the database to clog up with random search requests.

 

XPath feature requests

I see two very nice improvements:

  1. Allow pointing to a single referenced object from a non-persistent entity, as the id value is in memory.
  2. Allow pointing to a list of referenced objects, using something like an in-operator where a list of id's is provided (only if object is owner of reference set, so *-*).

image.png

asked
1 answers

Very worthwhile addition imho to improve the interaction between persistent and non-persistent entities and make the Mx domain modelling options even better!

Created