Programmatic creation of DMN Requirements Graph

hi,

I am looking for code snippets/ examples for programmatically creating DMN Requirements graph (DmnDecisionRequirementsGraph)

Although i have come across creating DMN Tables and Rules via Java API , I did not get how to create Requirements graph yet

Any pointers will be appreciated

Regards
Sashank

Hi Sashank,

I’m not aware of an example. That said, the DMN model API is a simple Java wrapper on top of the DMN semantic model that lets you create DMN models. That means, XML elements have matching Java interfaces (e.g. a decision element is an instance of org.camunda.bpm.model.dmn.instance.Decision in Java). I recommend you create a DRG via Camunda modeler, then inspect the XML and recreate the XML structure via the model API, where this docs chapter would be the starting point: https://docs.camunda.org/manual/7.8/user-guide/model-api/dmn-model-api/create-a-model/

Cheers,
Thorben