Hi all!
I’m generating DMN using GitHub - camunda/camunda-dmn-model: DMN model API written in Java. java library.
I was looking around how could i simply use existing Camunda process-flow json data without any additional transformation in DMN.
First i tried to use juel script but after several attemps just tried javascript once and it works!
So i would like to share my experience to other developers who might need it too.
-
Let say json is defined in my unit test as variable input data:
String json = “{"roleaaselection":"validated"}”;
VariableMap variables = Variables.putValue(“json”, json); -
Input variable inputEntry is defined in DMN generation shortly:
inputExpression.setExpressionLanguage(“javascript”);
text.setTextContent(“JSON.parse(json).roleaaselection”); -
and Rule input itself is FEEL value: “"validated"”
Generated DMN looks itself completely:
example.dmn (4.3 KB)