Multi instance task is hung

Broker version: 0.23.1
Java Client

I create a simple process with multi instance task:

<?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:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_10gb0at" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Zeebe Modeler" exporterVersion="0.9.1">
  <bpmn:process id="mock-process" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1">
      <bpmn:outgoing>Flow_0ulicn4</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:sequenceFlow id="Flow_0ulicn4" sourceRef="StartEvent_1" targetRef="Activity_1kujh3x" />
    <bpmn:endEvent id="Event_12hj9nh">
      <bpmn:incoming>Flow_1d4wp0a</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_1q79li8" sourceRef="Activity_1kujh3x" targetRef="Activity_0b9uo84" />
    <bpmn:serviceTask id="Activity_1kujh3x" name="just a mock">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="mockCommand" />
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0ulicn4</bpmn:incoming>
      <bpmn:outgoing>Flow_1q79li8</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="Activity_0b9uo84" name="check the service status">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="mockShowNameCommand" />
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_1q79li8</bpmn:incoming>
      <bpmn:outgoing>Flow_1d4wp0a</bpmn:outgoing>
      <bpmn:multiInstanceLoopCharacteristics>
        <bpmn:extensionElements>
          <zeebe:loopCharacteristics inputCollection="=services" inputElement="service" outputCollection="statuses" outputElement="=status" />
        </bpmn:extensionElements>
      </bpmn:multiInstanceLoopCharacteristics>
    </bpmn:serviceTask>
    <bpmn:sequenceFlow id="Flow_1d4wp0a" sourceRef="Activity_0b9uo84" targetRef="Event_12hj9nh" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="mock-process">
      <bpmndi:BPMNEdge id="Flow_0ulicn4_di" bpmnElement="Flow_0ulicn4">
        <di:waypoint x="215" y="117" />
        <di:waypoint x="270" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1q79li8_di" bpmnElement="Flow_1q79li8">
        <di:waypoint x="370" y="117" />
        <di:waypoint x="450" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1d4wp0a_di" bpmnElement="Flow_1d4wp0a">
        <di:waypoint x="550" y="117" />
        <di:waypoint x="712" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="179" y="99" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1h65wqt_di" bpmnElement="Activity_1kujh3x">
        <dc:Bounds x="270" y="77" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1k3pmb9_di" bpmnElement="Activity_0b9uo84">
        <dc:Bounds x="450" y="77" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_12hj9nh_di" bpmnElement="Event_12hj9nh">
        <dc:Bounds x="712" y="99" width="36" height="36" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

my task implement is very simple(do some light wrap according JobHandler)

@Component("mockShowNameCommand")
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class MockShowNameCommand implements BusinessCommand {

    @InputVariable
    private String service=null;

    @OutputVariable
    private boolean status=false;

    @Override
    public void execute() throws Exception {
        if(service.indexOf("a")>0){
            this.status = true;
        }else
        {
            this.status = false;
        }
    }
}

and finally, I start a workflow instance:

why the task is stop at there, I am sure the task code in client is not called. so any suggestion?

@aximo what is your worker doing exactly? can you debug your worker and see how many time is being called?
I am not sure… but I feel that you are missing a big part of Zeebe, which is that it will not run code inside the process, it will delegate all the services tasks to a Worker, but you don’t seem to be implementing one.

HTH


according the image , I think i already register the job task to zeebe client?

After i restart the worker, it is ok, maybe i make a mistake

thanks

1 Like

@aximo great to hear that… can you please mark this as resolved?