question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prevent Most Common Deployment Errors Through Linting

See original GitHub issue

_Implementation issue for https://github.com/camunda/product-hub/issues/386._

Problem you would like to solve

As a user of the Camunda Modeler, my goal is to implement executable processes. Errors in my process are indicated through linting.

Proposed solution

I want to rely on linting to catch the most common deployment errors.

Errors

⛔ Invalid BPMN 2.0

The only way we were able to reproduce this error was uploading invalid BPMN 2.0 to the web modeler that would display just fine but would result in an error upon deployment since the Zeebe engine is stricter.

XML

<?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:modeler="http://camunda.org/schema/modeler/1.0"
  id="Definitions_0qqsq85"
  targetNamespace="http://bpmn.io/schema/bpmn"
  exporter="Camunda Modeler"
  exporterVersion="5.5.0"
  modeler:executionPlatform="Camunda Cloud"
  modeler:executionPlatformVersion="8.1.0">
  <bpmn:process id="Process_1" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1" foo="bar">
      <bpmn:extensionElements>
        <Foo />
      </bpmn:extensionElements>
    </bpmn:startEvent>
  </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="179" y="79" width="36" height="36" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

Opening this XML in the Camunda Modeler results in a warning:

electron_dJ6i2pll3X

This warning isn’t displayed in the web modeler. However, deploying the XML results in the cryptic SAXException while parsing input stream error:

brave_YX03mve7ls

Related to https://github.com/camunda/zeebe/issues/5490.

⛔ Missing Sequence Flow Condition

Sequence flows must have a condition or be the default sequence flow (already implemented for bpmn:InclusiveGateway cf. https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/44).

⛔ No Executable Process

At least one process must be executable (cf. https://github.com/camunda/zeebe/blob/1.3.0/bpmn-model/src/main/java/io/camunda/zeebe/model/bpmn/validation/zeebe/DefinitionsValidator.java#L37).

⛔ Unknown Elements

This error (Unable to process unknown element with name properties) is most likely caused by deploying diagrams with zeebe:Properties extension elements to Zeebe engine versions that do not support these extension elements. A lint rule (cf. https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/43) was introduced that should prevent this error in the future.

Alternatives considered

None.

Additional context

Tracked in https://github.com/camunda/product-hub/issues/386.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
philippfrommecommented, Nov 9, 2022

I’d love to have a way to just remove the unknown properties so that the diagram is deployable.

This could lead to unexpected behavior, too. The diagram might contain extensions the user doesn’t want to accidentally remove by importing (and maybe exporting) the diagram. The roundtrip should work without surprises.

2reactions
nikkucommented, Nov 9, 2022

As additional context (maybe helping you to find an appropriate solution) either of the following headless “validation” options can help you to determine the soundness of a BPMN diagram:

  • Validating against the BPMN 2.0 schema
  • Using bpmn-moddle to import and reject on all errors + warnings
Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Linting: A Shift Left Strategy to Protect Your Codebase
Linting tools should flag any errors or quality issues while developers are writing code, providing more of an intuitive spell-checking or ...
Read more >
Best practices for Linting - Webapp.io
Linters are programs that look at a program's source code and find problems automatically. They are a common feature of pull request automation ......
Read more >
Linting tools to identify and fix code mistakes - IBM
Easily identify and correct common code mistakes. Linting is the process of performing static analysis on source code to flag patterns that might...
Read more >
Lint Code: What Is Linting + When To Use Lint Tools - Perforce
Linting is important to reduce errors and improve the overall quality of your code. Using lint tools can help you accelerate development and ......
Read more >
Linters aren't in your way. They're on your side
Traditionally, linters make sure your code is clean and easy for teammates to read. They check for errors, bugs, style, and more.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found