Skip to content

blutorange/BPMNspector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BPMNspector

Static analysis for BPMN 2.0 process models

This is a fork of https://github.com/uniba-dsg/BPMNspector with the following changes:

  • Move everything into a separate package.
    • The original project contained the api, which may conflict with other libraries. Everything is now inside the package com.github.blutorange.bpmnspector. This also lets us add a proper module-info.java.
  • Remove the CLI
    • This keeps the project simple and focused on the core functionality of validating BPMN files. The original CLI required e.g. Apache Velocity as a dependency, which is not needed for the core functionality of the project. If needed, we should turn this into a multi-module project, the CLI should be a separate module (feel free to make a PR!)
  • Remove MojoValidator
  • Remove XSD schema validator
    • Just use the standard Java XML API to validate against the BPMN 2.0 XSD files. But I'm open to PRs that add this back.
  • Use Maven instead of Gradle.
    • This is a simple project that does not need the additional configurability provided Gradle.
  • Properly declare all dependencies and make sure to only use dependencies available in Maven Central.
    • The original project used dependencies that were not available in Maven Central and included some dependencies as JAR files instead of declaring them. The original project was also not available via Maven Central.
  • Update all dependencies to their latest versions.
    • The original project used outdated dependencies, some of which have changed their package name.

Javax / Jakarta

Currently, this still uses the javax namespace for compatibility. Will soon be updated to the jakarta namespace.

Usage

See also https://github.com/uniba-dsg/BPMNspector, but briefly:

Include as a Maven dependency in your pom.xml:

<dependency>
  <groupId>com.github.blutorange</groupId>
  <artifactId>bpmnspector</artifactId>
  <version>${bpmnspector.version}</version>
</dependency>

Then you can use it:

import com.github.blutorange.bpmnspector.api.BPMNspector;

public class Main {
  public static void main(String[] args) {
    var inspector = new BPMNspector();

    // you can also use an InputStream if you have the content in memory
    var result = inspector.validate("path/to/your/bpmn/file.bpmn");
    
    if (!result.isValid()) {
      System.out.println("Validation failed");
      for (var violation : result.getViolations()) {
        System.out.println(violation.getLocation()+ ": " + violation.getMessage());
      }
    }
  }
}

About

Static analysis for BPMN 2.0 process models.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%