If you make your destination an entity with associations to both the flight and the cargo, then it should look something like this:
[CargoSystem.Parcel_Destination/CargoSystem.Destination/CargoSystem.Flight_Destination = '[%CurrentObject%]']
Take a look at the contrained by function. I suggest playing with that option.
Regards,
Ronald
I tried as David suggested, made a association between Destination and Flight as well as Parcel. I could then produce this exact xPath without giving errors in the Modeler.
[CargoSystem.Parcel_Destination/CargoSystem.Destination/CargoSystem.Flight_Destination = '[%CurrentObject%]']
But when I try to add a parcel to the flight, I can not even see the list of parcels. I get the same error as I did before
com.mendix.core.CoreRuntimeException: Exception occurred in action '{"amount":20,"sort":[{"direction":{},"memberName":"ParcelID"}],"formName":"CargoSystem.Parcel_Select","returnsCount":true,"offset":0,"type":"RetrieveXPathSchemaRawAction","xpath":"//CargoSystem.Parcel[CargoSystem.Parcel_Destination/CargoSystem.Destination/CargoSystem.Flight_Destination = '3659174697238529']"}', all database changes executed by this action were rolled back
at com.mendix.core.actionmanagement.CoreAction.c(SourceFile:515)
Caused by: l: An exception has occurred for the following request(s):
fw (depth = -1, amount = 20): //CargoSystem.Parcel[CargoSystem.Parcel_Destination/CargoSystem.Destination/CargoSystem.Flight_Destination = '3659174697238529']
at x.a(SourceFile:49)
Caused by: l: Exception occurred while retrieving data. (SQL State: 42581, Error Code: -5581) Detail Message: org.hsqldb.HsqlException: unexpected token: ) : line: 17
at H.a(SourceFile:1398)
Caused by: java.sql.SQLSyntaxErrorException: unexpected token: ) : line: 17
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.JDBCStatement.executeQuery(Unknown Source)
The unexpected token : ) : line: 17 was thrown before. Since it is a sqlException I guess that something in the xPath is going wrong? I am sure my flight has a destination (I added it while creating the object via a reference selector, the same counts for the parcels).
This is unfortunately still not working. No one any advice?