Bpmnlint not working as expected

@nikku , @barmac @philippfromme @Niklas_Kiefer

I am trying to use Bpmnlint for error finding but it not working as expected .

The issue is it shows the error firstTime but it doesn’t update as soon as some of it solved.

It works perfectly after one re-render and keeps updating the errors as they are solved


import BpmnModeler from "bpmn-js/lib/Modeler";
import "bpmn-js-bpmnlint/dist/assets/css/bpmn-js-bpmnlint.css";
import bpmnlintConfig from "../../../bundled-config";

let modeler = {
      container: "#bpmnview",
      propertiesPanel: {
        parent: "#js-properties-panel",
      },
      linting: {
        bpmnlint: bpmnlintConfig,
        active: true,
      },
      additionalModules: [
        lintModule,
        BpmnPropertiesPanelModule,
        BpmnPropertiesProviderModule,
        propertiesCustomProviderModule,
        minimapModule,
        TokenSimulationModule,
        {
          elementColors: [
            "value",
            {
              add() {},
              remove() {},
            },
          ],
        },
      ],
      moddleExtensions: {
        camunda: camundaModdleDescriptor,
      },
    };
    bpmnModeler = new BpmnModeler({ ...modeler });

This is my code for .bpmnlintrc

{
    "extends": "bpmnlint:recommended"
}

I have install bpmn-js-bpmnlint and bpmnlint-pack-config packges.

Could you please help me out here?

What is the error?

Please share a running / prototypical example that clearly shows what you’re trying to achieve, what is working and what is not.

Use our existing starter projects to quickly hack it or share your existing, partial solution on GitHub or via a CodeSandbox. Provide the necessary pointers that allow us to quickly understand where you got stuck.

This way we may be able to help you in a constructive manner.

Thanks :heart:

1 Like

Hello @barmac

Thanks for the reply .
Although I figured out how to make the bpmnlint work I would like to know what to do have all the rules of the camunda modeler

For example ,
When in camunda modeler, a script task is added and there is no inplemenation it shows the error

A must have a defined

Similarly in a User Task when there is no form it shows an warning

A should have a defined

How do I achieve this ?

Is there any package to install ?

Currently my .bpmnlintrc file is like this

{
    "extends": "bpmnlint:recommended"
}

For Camunda compatibility rules, check out GitHub - camunda/bpmnlint-plugin-camunda-compat: A bpmnlint plug-in for Camunda BPMN compatibility.

Camunda Modeler itself uses camunda/linting project which adjusts the configuration to the diagram’s execution platform.

1 Like

Hello @barmac ,

Thanks for the reply.

I am using CustomImplementation for my BPM .
I am having issues in errors.
For example,
When in Camunda scriptTask when we add the implementation the list of errors are removed but in my case I am not able to remove the errors even after adding the custom script prop in the script task

var scriptTaskRequired = function () {
  function check(node, reporter) {
    if (!is$s(node, "bpmn:ScriptTask")) {
      return;
    }
    // Check if the script property is defined
    if (!node.script || node.script.trim().length === 0) {
      reporter.report(node.id, "ScriptTask is missing a script definition");
    }
  }
  return annotateRule$s("script-task-required", { check });
};

This is the custom rule for checking if script is there
I have added it in the array of rules

Now whenever I add the script it does not remove the error

Can you help me here ?

I suggest to check whether the property you are validating is the one that you add via UI.

Please share a running / prototypical example that clearly shows what you’re trying to achieve, what is working and what is not.

Use our existing starter projects to quickly hack it or share your existing, partial solution on GitHub or via a CodeSandbox. Provide the necessary pointers that allow us to quickly understand where you got stuck.

This way we may be able to help you in a constructive manner.

Thanks :heart:

sorry for adding here i couldnt find where i could add a new question.
I added extension elements and they work just fine, but my problem is that elemnts that have an extension cant be deleted or moved on the ui. When i delte them i get this error:

unhandled error in event listener TypeError: Cannot read properties of undefined (reading ‘id’)
at eval (UnclaimIdBehavior.js:41:1)
at invokeFunction (EventBus.js:614:1)
at EventBus._invokeListener (EventBus.js:457:1)
at EventBus._invokeListeners (EventBus.js:431:1)
at EventBus.fire (EventBus.js:379:1)
at CommandStack._fire (CommandStack.js:395:1)
at CommandStack._internalExecute (CommandStack.js:435:1)
at CommandStack.execute (CommandStack.js:186:1)
at Modeling.removeShape (Modeling.js:537:1)
at eval (DeleteElementsHandler.js:40:1)
EventBus._invokeListener @ EventBus.js:471
EventBus.js:473 Uncaught TypeError: Cannot read properties of undefined (reading ‘id’)
at eval (UnclaimIdBehavior.js:41:1)
at invokeFunction (EventBus.js:614:1)
at EventBus._invokeListener (EventBus.js:457:1)
at EventBus._invokeListeners (EventBus.js:431:1)
at EventBus.fire (EventBus.js:379:1)
at CommandStack._fire (CommandStack.js:395:1)
at CommandStack._internalExecute (CommandStack.js:435:1)
at CommandStack.execute (CommandStack.js:186:1)
at Modeling.removeShape (Modeling.js:537:1)
at eval (DeleteElementsHandler.js:40:1)

this is how i add the extension elements

 function createCustomElement(element, type) {
    const bo = element.businessObject || element;
    // create extension
    if (!bo.extensionElements) {
        const extensionElements = moddle.create('bpmn:ExtensionElements', {
            values: [ ]
        });
        
        modeling.updateProperties(element, {
            extensionElements: extensionElements
        });
        
  
        bo.extensionElements = extensionElements;
    }



    // create custom extension element
    const aasIdElement = moddle.create('AAS:aasId', { id: element.aasID})
       
    //  push to extensionElements
    const extensions = bo.extensionElements;
    extensions.values.push(aasIdElement); 
    

        
    // Update diagram
    modeling.updateProperties(element, {
        extensionElements: extensions
    });
}

How is this related to the original question? Please create a new thread, and don’t forget to add a codesandbox example.