Comment on Do Code Generators for Decision Modeling Actually Work? by jacobfeldman
Blog: Decision Management Community
I need to correct you – OpenRules does NOT generate code “out of a model”. OpenRules directly executes all decision tables and other decision modeling constructs presented in Excel by instantiating the predefined Java classes in run-time. Our customers may even define snippets of Java inside Excel cells (which look very similar to DMN FEEL) and they will be executed when they run an instance of OpenRulesEngine without any code generation. OpenRules-based decision models are always executable by design. As Bruce Silver pointed in his recent book, “whatever execution algorithm is employed, the DRD (and I’d add, the entire the decision model) should be executable”.
When OpenRules is used together with DecisionsFirst Modeler, then James’ high-level decision model is simply linked to executable implementations using decision tables represented in OpenRules or other vendor’s format. Again no code generation occurs here.
Actually, the real problem is not with code generation, but rather with which decision model representation will be maintained: the original one in DMN or the generated one in a target format. I suspect that in many code generation cases, “the target representation” is the one that is actually being supported by users using the target BRMS. And this is the problem! However, if the code is generated on the fly every time when you run the decision model and there is no performance overhead, then it is not a problem.
As an example, I may point to success of the JSR-331 standard (http://jsr331.org). The same decision model (in this case a constraint satisfaction problem) can be executed by different constraint or linear solvers without changing a single character in the original model. For example, we may generate the proper code for a linear model in the MPS format on the fly (!), then execute this code with one of 7 linear solvers, and then present the results back in the original terms. Nobody ever looks at the generated code and everything works just fine.