Camunda-dmn-model is not allowing to append a new RULE in an existing decision table

I need to use the DMN in my project and the requirement is to add a new RULE programmatically in an existing decision table.

DmnModelInstance dmnModelInstance = Dmn.readModelFromStream(ExampleTestCompatibility.class.getResourceAsStream(“Example.dmn”));
DecisionTable decisionTable = dmnModelInstance.getModelElementById(“decisionTable”);
decisionTable.getRules().add(newRules);

When I drilled down into the source code,I found that ChildElementCollectionBuilderImpl class in camunda-xml-model where the collection is made immutable … collection.setImmutable();

Is there any sort of restriction of not allowing to append row in an existing Decision Table ?

Hi @suvaio,

please have a look at the class:

Does this help you?

Best regards,
Philipp

Thanks a lot.
The problem might have been with the template I was using.