I think I see a couple issues that are leading to the problem your describe:
Issues:
How to fix it:
Thanks for your help.
Im not sure however if this is what i wanted. So i guess your assumption that my datamodel is still correct in the last point of your answer is correct.
I will try to explain why and what i want to do:
In Essence is want to save results: Matches played, with which Teams and which Team has won how often in a game or in a match. And i want to retrieve all Data of the Team and underlying Data for Statistics.
Instead of creating a result object, i wanted to get the data via the game and respective teame objects. (Mainly because i dont know how a result object could look like)
So the GAME object should be the result and create the log of results. Data in there should never be changed after a game has finished.
So i thought about the following implementation:
I want to Create Teams. Some parts of the Team (Players) are fixed for all Games. (Later this can be extended to sessions even, as teams are fixed for the complete Session)
Then i want to play individual games with this team. However i want to make changes in the Team, after playing a game.
for example Wincounter for the Game. Then, ideally i want to save the Team with the corresponding individual information (Wins in the match). To Save it, i wanted to use the Team_Game Association. So i want to copy Team and change the Winscounter after each game. So i can retrieve the outcome of a game via Team_Game. (a small result object)
Then after the Match is finished i can use the “old” Team via Team_Match to start again.
I have to copy the team and create a link to a game in this scenario. But this is not working. The microflow is triggered when creating a new game btw.
I am new to mendix. I have some knowledge in C++ and Java where this seems much easier to implement for me. I think i might not see the forest for the trees :)
I just dont know, how can i set which team won in game object. The link via Match does not work, as its already there. How can the game object look like, and how do i assign a win to a certain team. Thats the underlying problem i cant answer by myselfe at the moment.
To set which team won the match, create a new extra 1-1 association between Match and Team with a meaningful name, for instance, “Match_VictoriousTeam”. All that this association does, is point out which team won the match.