If you already created a DMN model and want to process it through the DMN model API, you can import it with the following methods.

// read a model from a file
File file = new File("PATH/TO/MODEL.dmn");
DmnModelInstance modelInstance = Dmn.readModelFromFile(file);

// read a model from a stream
InputStream stream = [...]
DmnModelInstance modelInstance = Dmn.readModelFromStream(stream);

After you imported your model you can search for elements by their id or by the type of element.

// find element instance by ID
DecisionTable decisionTable = modelInstance.getModelElementById("decisionTable1");

// find all elements of the type DecisionTable
ModelElementType decisionTableType = modelInstance.getModel()
Collection<ModelElementInstance> decisionTableInstances = 

For every element instance you can now read and edit the attribute values. You can do this by either using the provided helper methods or the generic XML model API. If you added custom attributes to the DMN elements, you can always access them with the generic XML model API.

DecisionTable decisionTable = modelInstance.getModelElementById("decisionTable1");

// read attributes by helper methods
String outputLabel = decisionTable.getOutputLabel();
Collection<Input> inputs = decisionTable.getInputs();

// edit attributes by helper methods

// read attributes by generic XML model API (with optional namespace)
String custom1 = decisionTable.getAttributeValue("custom-attribute");
String custom2 = decisionTable.getAttributeValueNs("custom-attribute-2", 

// edit attributes by generic XML model API (with optional namespace)
decisionTable.setAttributeValue("custom-attribute", "new value");
  "http://camunda.org/custom", "new value");

You can also access the child elements of an element or references to other elements. For example, a decision has a required decision which it depends on. A required decision is represented by a requiredDecision element inside an informationRequirement XML element.

Consider the following simple DMN model:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/DMN/20151101/dmn.xsd" 
             id="dish" name="Dish" namespace="test-drd-2">

  <decision id="dish-decision" name="Dish Decision">
      <requiredDecision href="#season" />
    <decisionTable id="dishDecisionTable">
      <input id="seasonInput" label="Season">
        <inputExpression id="seasonInputExpresion" typeRef="string">
      <output id="output" label="Dish" name="desiredDish" typeRef="string"/>
      <rule id="dishRule1">
        <inputEntry id="dishInputEntry1">
        <outputEntry id="dishOutputEntry1">

  <decision id="season" name="Season decision">
    <decisionTable id="seasonDecisionTable">
      <input id="temperatureInput" label="Weather in Celsius">
        <inputExpression id="temperatureInputExpression" typeRef="integer">
      <output id="seasonOutput" label="season" name="season" typeRef="string" />
      <rule id="seasonRule1">
        <inputEntry id="seasonInputEntry1">
        <outputEntry id="seasonOutputEntry1">


You can now use the DMN model API to get the input elements of the required decisions.

// read dmn model from file
File file = new File("PATH/TO/MODEL.dmn");
DmnModelInstance modelInstance = Dmn.readModelFromFile(file);

// find the main decision by ID
Decision decision = modelInstance.getModelElementById("dish-decision");

// get the information requirements
Collection<InformationRequirement> informationRequirements =

// get the input of the required decisions
for (InformationRequirement informationRequirement : informationRequirements) {
  Decision requiredDecision = informationRequirement.getRequiredDecision();
  DecisionTable decisionTable =
  Collection<Input> inputs = decisionTable.getInputs();

On this Page: