How to check if 2 numbers match

0
Hello, I’m new to Mendix and creating a test app. I have created an entity “deelnemers’ with attribute called “saldo” which indicates if a user has a positive or negative saldo. Now I want to check by a microflow  if one of the positive digits (saldo) math a negative. Can anyone give me a hint how I can perform this check (see microflow so far)? Maybe later some more questions, but  have to tackle this one first. Kind regards, Daniel
asked
2 answers
1

Building further on the suggesting of Andrej Gajdunk using abs. I think what you want is to create a new Rule where you do the comparison. Than add in your microflow a new decision where you’d like the rule to be used. 

The input is here the min and max saldo:

 

If you want to go different path’s after the check you can use for example a Validation feedback and a merger after or just stop the flow. If you want to do more than one check to see if your flow is valid, you can add a new bool variable at the beginning of your microflow. And set it on false whenever it fails a check. .  For example like this:

Offcourse you could do it simply by adding one decision in your microflow without using a new rule. The rule is just handy when you want to reuse the same check multiple times.

answered
0

Hi Daniel,
There are several approaches you can take.
First, you could use abs to convert the negative number to a positive https://docs.mendix.com/refguide/mathematical-function-calls#9-abs
Second, you could turn both numbers into strings then remove the minus sign and compare them like that
substring($NegativeNumber+’’,1) = $PositiveNumber+’’
Hope this helps

answered