Problem creating a DMN programatically

I try to create a DMN programmatically.

  Dmn.writeModelToStream(new"./$dmnId.out.dmn"), dmnModel)

This creates the following exception:

Caused by: org.xml.sax.SAXParseException; cvc-complex-type.2.4.b: The content of element 'rule' is not complete. One of '{"":inputEntry, "":outputEntry}' is expected.

I took the excel importer as an example.

Here is the code - how I created the Rule:

  private def dmnRule(postcode: Integer, place: String, userFin: String) = {
    val rule = dmnModel.newInstance(classOf[Rule])
    val inputEntry = dmnModel.newInstance(classOf[InputEntry])

    val userFinIn = dmnModel.newInstance(classOf[InputEntry])

If I check the Debugger - it shows that I have the requested inputEntry:

Any ideas?

You have to have at least one outputEntry.


@langfr thanks - this line was the problem:

    val userFinIn = dmnModel.newInstance(classOf[InputEntry])

Copy-Paste Error - Just forgot to change the In to the Out. And the Error message oneOf took me on the wrong foot :grimacing:.