Extracting Mendix microflows to java code using Mendix SDK

1
I want to extract mendix flow into java code. i am done with sdk setup and sample script file to make a online working copy of existing project. i want exact script to get the model into java code. please help me on that.
asked
4 answers
3

Besides being possible or not, that is exactly what you should not do with Mendix. Its like buying lego blocks making granulate out of it and then using that as material to start building a house.

answered
1

You can not do that. Microflows can not be converted to Java. Mendix  interpret the model it does not convert it.

Regards,

Ronald

 

answered
1

I guess the idea is to use the Mendix LowCode/NoCode Editor with all of it’s benefit to produce code that can run without any license. It should be obvious why there is no converter that can export a mendix project to java.

answered
1

In theory you could do this, and this is one of the arguments of why Mendix doesn't suffer from vendor lock-in. This is even specifically called out as a use case of the SDK!

 

In practice, however, I would say this is very difficult: it requires a deep understanding of three languages: TypeScript (to program your scripts which use the SDK), Java (your target language) and Mendix (your source language).

 

The high level approach to convert a microflow to Java code is fairly straightforward:

  • If you have a microflow, create a Java method with the same name,
  • Get all the input parameters of the microflow and add them as parameters of the Java method,
  • If the microflow has a return type, add that as return type of the Java method,
  • Get all microflow activities from the microflow and loop over them,
  • For each microflow activity, create a number of equivalent Java statements (this is obviously the hard part!)
answered