Search code examples
processcamundatest-coverage

Camunda process-test-coverage can't be rendered


We are using Camunda Process-Test-Coverage (https://github.com/camunda-consulting/code/tree/master/snippets/process-test-coverage) to visualize the tested paths in our Camunda processes. This usually works fine, but currently we have a bigger process where it doesn't. The generated html looks good but the browser just shows a lot of

failed to import <bpmn:SequenceFlow id="SequenceFlow_00ti7a9" /> at BpmnTreeWalker.js:77

because

Error: element <bpmn:ServiceTask id="arbeitskorbEintragLfDatenUebernehmen" /> referenced by <bpmn:SequenceFlow id="SequenceFlow_00ti7a9" />#sourceRef not yet drawn

I don't even know where to start looking so this is a shot in the dark. Removing the highlights didn't help, but when I exchanged the diagramXml with one from a working process, this worked to, so it seems like the diagramXml is not correct but since the generation is pretty simple, I'm assuming our BPMN somehow is the problem. Are there any known problems with some bpmn elements or process sizes? Anyone knows where to look for errors?


Solution

  • Try to use this lib, it is recommended by Camunda docs and works for big processes too.

    Easy to use:

    @ClassRule
    @Rule
    public static ProcessEngineRule rule = TestCoverageProcessEngineRuleBuilder.create().build();
    
    // ...
    
    // Through this rule, the process engine and services are available by getters:
        ProcessInstance process = rule.getProcessEngine().getRuntimeService()
                                      .startProcessInstanceByKey(PROCESS_DEFINITION_KEY);
    
    // ...and test, what you want, for example:
        assertThat(process)
                .isStarted()
                .task()
                .hasName("User Task")
                .hasCandidateGroup("TEST_GROUP")
                .isNotAssigned();
    

    Hope this helps!