MicroFlows with generic input parameter

2
Is there some way I can create a parameter in a MicroFlow that just says it expects an object? So I want a parameter without telling the system what type of object is can expect. This can be useful for lets say: do something when the object has an attribute with a specific name of is from some specific type or <whatever> I’m pretty new to Mendix but I come from some other development platform where we could do things like this. That is very handy in many cases (also has some drawbacks but ok) and I wonder if such things are also possible in Mendix.
asked
3 answers
2

You are allowed to do this inside a Java action, but not a microflow. 

 

In addition to rachana's answer, you may also use specializations in a microflow where the generalized object is the input parameter.

answered
0

Nope, Mendix Doesnt allow such mappings. If you really need it. you can do a work around by: 

 

create a dummy entity

have other entities associated to the dummy entity 

pass dummy entity as parameter to your microflows. 

answered
0

It's possible with a little bit of Java magic, but I'd heavily advise against it.

 

Effectively you are asking for a solution that gives attributes a kind of global scope; their meaning would no longer be confined to the entity they belong to.

 

There are maybe a small number of usecases where this is fine, but in all other cases it would create a spiderweb of dependencies. Technical debt will take off like a rocket and development speed will slow down to a crawl.

 

Could you tell us more about your use case?

answered