Issue
When using a boolean attribute directly in a decision without an explicit comparison, the following error occurs:
Caused by: com.mendix.modules.microflowengine.MicroflowException: No connecting flow found after processing activity 'Decision name' (gateway value: null) in microflow 'Microflow name'
For example, this error occurs when the decision expression is written as:
$BooleanObject/booleanValue
Instead of:
$BooleanObject/booleanValue = true
Environment
Studio Pro (all versions)
Cause
This error occurs when a boolean attribute holds an empty value. In Mendix Studio Pro, an empty boolean is neither true nor false. This follows the semantics of NULL values in Structured Query Language (SQL), to which XML Path Language (XPath) expressions are translated. From the Mendix documentation on empty values:
If the value of an attribute in the database is empty, this is interpreted as "unknown" and any comparison of that attribute to another attribute will not match, even if both are empty.
When the decision expression is written as $BooleanObject/booleanValue, Mendix Studio Pro attempts to convert the empty value directly to a boolean. This conversion is not supported, which causes the gateway to return null and triggers the error.
When the expression is written as $BooleanObject/booleanValue = true, the empty value is compared to true, which evaluates to false. This allows the decision to follow the false path without error.
The table below summarizes the behavior:
| Expression | Boolean value | Result |
$BooleanObject/booleanValue = true |
empty |
Evaluates to false
|
$BooleanObject/booleanValue = false |
empty |
Evaluates to false
|
$BooleanObject/booleanValue |
empty | Error: cannot convert empty to boolean |
Solution / Workaround
To resolve this error, handle empty boolean values before the decision using a validation check. This ensures the decision always receives a valid boolean value.
Follow these steps to add a validation check:
- In Mendix Studio Pro, open the microflow that contains the decision.
- Before the decision, add a new decision to check whether the boolean attribute is empty. Use the following expression:
$BooleanObject/booleanValue = empty - On the
truepath of the empty check, add a Change Variable or Change Object activity to set the boolean attribute to a defined default value, such asfalse. - Connect the
falsepath of the empty check directly to the original decision. - Ensure the original decision uses an explicit comparison:
$BooleanObject/booleanValue = true - Save the microflow.
This approach ensures full control over the outcome and prevents the error from occurring.
Internal information related
- 281740
- RUN-5255
- C3T260XGA/p1782477402918279
- [Internal] Empty values in XPath comparison expression
Additional information
- Mendix documentation:
0 Comments