Validation feedback on fields of a specialised object

0
Update, I just noticed that the input parameter is missing, this is not the root of my problems :) accidentaly deleted it. Hi! Im working on a simple app for an animal shelter. I have created a generalised entity called Animals, and several specializations that inherit from Animals. In the Mendix Tutoral i was able to create a microflow that did a check on a field whether is was filled in or not, and display a message to the user. I am trying to build the same functionality here, but I cant access the attributes of my specialized entities.  How can I make them available to the microflow? This is the model so far: https://modelshare.mendix.com/models/7e250502-90f3-4e00-8a29-3f12142114d9/bco_validatefields   The fields naam, leeftijd and gewicht exist in the generalized entity animal.  There are 5 specialized entities: Cat, Dog, GuinneaPig, Rabbit and Parrot in which the attributes Gender and Race exist. Thanks for thinking along!  
asked
2 answers
0

Hi Bart,

You could use an inheritance split of your animal object - this will enable you to determine what type of specialization it is and perform validations as appropriate for each type.  BTW, inheritance split is the green diamond.  Put that in your microflow and point it to the Dieren entity.  Then the arrows coming out of the split will be for each type of specialization.

Hope that helps,

Mike

answered
0

You need to Cast your animal object. See documentation here: https://docs.mendix.com/refguide/cast-object

And an example here: https://modelshare.mendix.com/models/f099fba5-ba6a-4854-b4ac-1da63e5cc5f5/example-of-activity-cast-object

This way you split depending of the generalization the microflow.

Regards,

Ronald

 

answered