No process definition after deployment

I might run into a very stupid problem. I created a bpmn definition from Camunda modeler like this.

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.6.0">
  <bpmn:process id="Process_1" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1">
      <bpmn:outgoing>SequenceFlow_0fguipa</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:sequenceFlow id="SequenceFlow_0fguipa" sourceRef="StartEvent_1" targetRef="Task_0hoou9d" />
    <bpmn:userTask id="Task_0hoou9d" name="Test Task">
      <bpmn:incoming>SequenceFlow_0fguipa</bpmn:incoming>
      <bpmn:outgoing>SequenceFlow_132w0fc</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:endEvent id="EndEvent_0ppv1mn">
      <bpmn:incoming>SequenceFlow_132w0fc</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="SequenceFlow_132w0fc" sourceRef="Task_0hoou9d" targetRef="EndEvent_0ppv1mn" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="219" y="185" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="237" y="221" width="0" height="0" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="SequenceFlow_0fguipa_di" bpmnElement="SequenceFlow_0fguipa">
        <di:waypoint xsi:type="dc:Point" x="255" y="203" />
        <di:waypoint xsi:type="dc:Point" x="320" y="203" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="288" y="188" width="0" height="0" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="UserTask_1cd8mpi_di" bpmnElement="Task_0hoou9d">
        <dc:Bounds x="320" y="163" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="EndEvent_0ppv1mn_di" bpmnElement="EndEvent_0ppv1mn">
        <dc:Bounds x="493" y="185" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="511" y="221" width="0" height="0" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="SequenceFlow_132w0fc_di" bpmnElement="SequenceFlow_132w0fc">
        <di:waypoint xsi:type="dc:Point" x="420" y="203" />
        <di:waypoint xsi:type="dc:Point" x="493" y="203" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="457" y="178" width="0" height="0" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

After that I save it as a bpmn file on my local machine, then I execute the follow java call.

        InputStream modelStream = TestProcessEngine.class.getResourceAsStream("model.bpmn");
        BpmnModelInstance modelInstance = Bpmn.readModelFromStream(modelStream);

        processEngine.getRepositoryService().createDeployment().addModelInstance("test", modelInstance).name("test").deploy();

        List<ProcessDefinition> definitions = processEngine.getRepositoryService().createProcessDefinitionQuery().list();

My question is after the execution, the new model didn’t add to the process definition but it added to deployment successfully.

I check the DB as well, ACT_RE_DEPLOYMENT has one line related but ACT_RE_PROCDEF didn’t change. Is there any api I need to call to make deployment take action in process definition? Or I’m missing something in the xml definition.

Thanks,

Future Edit:
I change my origin xml isExecutable to true, the problem still remain.

1 Like

Thats your problem - you need to tick the executable flag on your process or else it is assumed the model is not intended to be executed.

2 Likes

Sorry, That’s my question problem. I did aware isExecutable need to be “true”.
In the testing code, I’m using a xml with isExecutable set to true, but the problem remains.

Change that code to .addModelInstance("test.bpmn", modelInstance) or else the deployer won’t interpret it as a BPMN process to be transformed into a prcess definition.

2 Likes

Awesome~! That works !
So the deployer is using the file name to determine if it is a bpmn, cmmn or dmn?

Correct. Possible endings are .bpmn, .bpmn20.xml, .cmmn, .cmmn10.xml, .cmmn10.xml, .dmn, .dmn11.xml. I’ll create a ticket that we document these in the API’s Javadoc.

1 Like

Thanks a lot, I investigating this problem for one day. I did check the source code, but didn’t see this logic. Also for addbpmnModelInstance, this property can be implied as well.