To create a new DMN model from scratch, you have to create an empty DMN model instance with the following method:
The next step is to create a DMN definitions element. Set the target namespace on it and add it
to the newly created empty model instance.
Usually you want to add a decision to your model. This follows
the same 3 steps as the creation of the DMN definitions element:
- Create a new instance of the DMN element
- Set attributes and child elements of the element instance
- Add the newly created element instance to the corresponding parent element
To simplify this repeating procedure, you can use a helper method like this one:
Validate the model against the DMN 1.3 specification and convert it to
an XML string or save it to a file or stream.
DMN 1.3 diagramThe resulting XML string will reference the DMN 1.3 specification.