About loops in Microflows

0
Hello, In Microflows, you can create loops by putting a back edge without putting a loop structure explicitly. As I understood, the code at the back transforms to Java source code, but, in Java source code, you cannot create such a loop since there are no explicit GOTO statements in Java source code (They are only available at bytecode-level). I wonder how such back edges are transformed to Java. Thank you.
asked
3 answers
2

Hi Bugra,

Unfortunately the following statement is not really true:

the code at the back transforms to Java source code

It is correct that mendix uses java in the background, but this does not mean that microflows are maped directly to java source code.
Instead, Mendix introduces a new abstract layer on top of java where microflows are exectued and in this abstract layer they have probably implemented a GOTO command.
-Andrej


PS: It is also true that mendix can generete some code for eclipse but as the name of the java packages suggest these are only proxy classes that can be used to acceess microflows and entites from java code, and do not contain any actual implementation code for the miroflows.

answered
0

One possibility would be to implement it as

while (true) {}

If you add an exclusive split to end the infinite loop, it could be translated as

if (split condition) {break}

 

answered
0

Thanks for the quick responses. I have realized after Andrej pointed out that the microflows are not really directly transformed to Java source code.

answered