Not able to add new rule in decision table using API

Hello everyone,
I have decision table created through modeler,and want to add new rule in it using API, so I am trying this using below code, any idea why this is not working ?

	    DecisionTable decisionTable = dmnModelInstance.getModelElementById("decisionTable");      
	    Rule rule = dmnModelInstance.newInstance(Rule.class);
            //add value for input1
            Text text1 = dmnModelInstance.newInstance(Text.class);
            text1.setTextContent("New input1");
	    InputEntry inputEntry1 = dmnModelInstance.newInstance(InputEntry.class);
	    inputEntry1.setText(text1);
	    rule.getInputEntries().add(inputEntry1);
	    
	    //add value for input2
            Text text2 = dmnModelInstance.newInstance(Text.class);
	    text2.setTextContent("New input2");
            InputEntry inputEntry2 = dmnModelInstance.newInstance(InputEntry.class);
	    inputEntry2.setText(text2);
	    rule.getInputEntries().add(inputEntry2);
        
	    //add value for output
	    Text text3 = dmnModelInstance.newInstance(Text.class);
            text3.setTextContent("new output");
	    OutputEntry outputEntry = dmnModelInstance.newInstance(OutputEntry.class);
            outputEntry.setText(text3);
            rule.getOutputEntries().add(outputEntry);
	    
	    decisionTable.getRules().add(rule);

Thanks,
Anjum

Please provide a test case, ideally shared on github. That makes it easiest for us to reproduce and understand the behavior.

Thanks,
Thorben

Hi Thorben,
Thanks for your reply. :slight_smile:
With some minor changes in my code, I am able to add new input entry and output entry.
But, text for input and output is not displayed in decision table, new entry(3rd row) is displayed as below,

Any idea why?

Thanks,
Anjum