Mendix Mindfulness: The unused Microflow Parameter

Lennart Spaans
2 min readDec 3, 2020

I would like to take a moment to have a look at something that seems to get overlooked a lot. In fact, chances are that once you go looking for it, you will find them everywhere, like mushrooms in an autumn forest.

“The unused Microflow Parameter”

First of all, what am I talking about here? According to the Mendix documentation, “A parameter is a special kind of variable that is used as an input for the microflow. When a microflow is triggered, the parameters are filled with the current values.”

Mendix generates microflow parameters automatically when you create a new microflow, for example when creating a submicroflow from the main flow. This is very assistive to the developer and a terribly handy timesaver during the development process, but the downside is that sometimes these parameters remain in the code unused.

So, is that really a problem?

Well, not exactly. There is no risk of performance degradation associated with having unused parameters in a microflow.

Then why does Mendix bring the issue to the developers attention, by showing warning “CW0094: variable is never used” in the error tab of Studio Pro’s console?

The answer is quite simply; for the sole purpose of clarity.

The code we write today is not for ourselves. It is for the person coming after us, our fellow coder who is going to have to interpret the inner workings of modules which they did not create.

Having to investigate the purpose of a parameter requires investing time and effort. Productivity will go down, and customer satisfaction with it.

“Making an application complicated is simple, and making it simple is complicated”.

Removing unnecessary parameters from your microflow is a wonderful best practice. Enable warnings in your console and Mendix will even show them to you while you are developing.

--

--

Lennart Spaans

Certified Mendix Expert at Ordina Digital Services and Lean Six Sigma Black Belt