This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Bonita Process Model — EMF-based domain models for defining BPMN 2.0 business processes, used by Bonita Studio. Includes process model definitions, BAR/BPMN export transformations, and model migration support.
Modules: bundles/ (OSGi plugins), features/ (Eclipse features), tests/ (test fragments), sites/ (P2 update site), releng/ (target platform, coverage).
Tech Stack: Java 17, Eclipse Modeling Framework (EMF), Eclipse Tycho, Maven
- Java JDK 17+
- Maven (wrapper included:
./mvnw) - For Eclipse development: Eclipse IDE with Tycho support
# Full build with install
./mvnw install
# Clean build with code formatting
./mvnw clean spotless:apply install
# Build without transfer progress (cleaner output)
./mvnw clean install --no-transfer-progress
# Build with code coverage (Jacoco)
./mvnw clean install -Pjacoco
# Build and run SonarQube analysis
./mvnw deploy sonar:sonar -Pjacoco
# Generate SBOM (Software Bill of Materials)
./mvnw package # SBOM generated automatically in target/bom.json
# Validate code formatting
./mvnw spotless:check
# Apply code formatting
./mvnw spotless:apply
# Build in offline mode (skip formatting checks)
./mvnw install -PofflineTwo launch configurations are provided:
- Build Bonita Process Model.launch - Compiles and builds model Java classes
- Generate Bonita Process Model SBOM.launch - Generates Software Bill of Materials
Usage: Right-click launch file → Run As → [Launch Configuration Name]
# Run all tests
./mvnw test
# Run tests with Groovy support (required for some tests)
# On Ubuntu:
sudo apt-get update && sudo apt-get -y install groovy
./mvnw test
# Run specific test module
./mvnw test -pl tests/org.bonitasoft.bpm.model.tests
# Run standalone integration tests
./mvnw test -pl tests/standalone-testsGenerate a project to read Bonita process models:
mvn archetype:generate \
-DarchetypeGroupId=org.bonitasoft.archetypes \
-DarchetypeArtifactId=process-reader-archetype \
-DgroupId=org.company.bpm \
-DartifactId=my-process-reader \
-Dversion=0.0.1-SNAPSHOT \
-Dpackage=org.company.bpm.reader \
-DdisplayName="My Custom Process Reader"Releases are managed via GitHub Actions using the gitflow-maven-plugin:
- Workflow:
.github/workflows/release.yml - Branch Strategy:
develop- Main development branchsupport/A.B.x- Maintenance branches (e.g., support/8.0.x, support/9.0.x)
- Release Types:
- Patch (X.Y.Z):
versionDigitToIncrement=2 - Minor (X.Y.0):
versionDigitToIncrement=1 - Major (X.0.0):
versionDigitToIncrement=0
- Patch (X.Y.Z):
Eclipse RCP Plugin Architecture with EMF-Based Domain Models
The project follows a modular, plugin-based architecture using Eclipse Tycho for OSGi bundle management. The core is built around Eclipse Modeling Framework (EMF) for domain model definition and code generation.
┌─────────────────────────────────────────────────────────────┐
│ Eclipse RCP Layer │
│ (P2 Update Site / Eclipse Plugin Integration) │
└─────────────────────────────────────────────────────────────┘
▲
│
┌─────────────────────────────────────────────────────────────┐
│ Transformation Layer │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ bonita2bar │ │ bonita2bpmn │ │
│ │ (BAR Export) │ │ (BPMN Export) │ │
│ └──────────────────┘ └──────────────────┘ │
└─────────────────────────────────────────────────────────────┘
▲
│
┌─────────────────────────────────────────────────────────────┐
│ Business Logic Layer │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ bpm.migration │ │ bpm.model.edit │ │
│ │ (Migrations) │ │ (Edit Support) │ │
│ └──────────────────┘ └──────────────────┘ │
└─────────────────────────────────────────────────────────────┘
▲
│
┌─────────────────────────────────────────────────────────────┐
│ Domain Model Layer (EMF) │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ bpm.model │ │ connector.model │ │
│ │ (Process Model) │ │ (Connectors) │ │
│ └──────────────────┘ └──────────────────┘ │
└─────────────────────────────────────────────────────────────┘
▲
│
┌─────────────────────────────────────────────────────────────┐
│ Foundation Layer (Dependencies) │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ plugin-deps │ │ gmf-plugin-deps │ │
│ │ (EMF, Maven) │ │ (GMF Notation) │ │
│ └──────────────────┘ └──────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Purpose: Defines the Bonita business process domain model using EMF
Key Responsibilities:
- EMF model definitions (.ecore files) for processes, expressions, forms, configurations, etc.
- Generated Java classes from EMF models (impl, util packages)
- Model loading and resource management (ModelLoader)
- Model migration support (process.history - 1MB migration history)
EMF Models (11 .ecore files):
process.ecore- Main process definition (pools, lanes, tasks, events, gateways)configuration.ecore- Process configurations and environmentsexpression.ecore- Expression types and evaluationform.ecore- Form definitionsconnector-configuration.ecore- Connector configurationsActorMapping.ecore- Actor-to-user mappingsparameter.ecore- Process parameterskpi.ecore- Key Performance Indicatorssimulation.ecore- Process simulation datadecision.ecore- Decision tablestransitions.ecore- Transition logic
Key Patterns:
- EMF Factory pattern for object creation
- Resource loading with automatic migration support
- OSGi vs non-OSGi environment detection
Purpose: Transforms Bonita process models into Business Archive (.bar) files for deployment
Key Responsibilities:
- Build BAR files from process models
- Generate Maven POMs for process dependencies
- Bundle connectors, dependencies, and resources
- Handle multiple configuration environments
Architecture Pattern: Provider-Based Extensibility
interface BarArtifactProvider {
void build(BusinessArchiveBuilder, Pool, ProcessPom, Configuration)
void configure(EnvironmentConfigurationBuilder, Configuration, Pool)
}Key Classes:
BarBuilder- Main builder orchestratorBarBuilderFactory- Factory for builder instancesProcessPomGenerator- Generates pom.xml for process dependenciesBarArtifactProvider- Extension point for artifact providers
Artifact Providers:
DependenciesArtifactProvider- JAR dependenciesConnectorImplementationArtifactProvider- Connector implementationsFormMappingArtifactProvider- Form mappingsParameterArtifactProvider- Process parameters
Purpose: Exports Bonita process models to standard BPMN 2.0 XML format
Key Responsibilities:
- Transform Bonita model to BPMN 2.0 specification
- Preserve BPMN compatibility for interoperability
- Handle Bonita-specific extensions
Key Classes:
BonitaToBPMNExporter- Main transformation engineBonitaModelExporterImpl- Model exporter implementation
Dependencies:
org.bonitasoft.spec.bpmn- BPMN 2.0 specification models- GMF Notation support for diagram information
Purpose: Handles backward compatibility and model version migrations
Key Responsibilities:
- Migrate old process files to current version
- Custom migration rules for breaking changes
- Connector definition updates
- Expression migration
Migration Types:
- EMF Edapt-based automatic migrations (process.history)
- Custom Java migrations (66 migration classes)
- Connector version updates (20+ connector migrations)
- Expression type migrations
- Contract migrations
Notable Migrations:
StartTimerConditionCustomMigrationMultiInstanceCustomMigrationFormMappingCustomMigrationDocumentTypeMigration- Various connector version updates (Email, REST, Groovy, Salesforce, etc.)
Purpose: Defines connector and filter models
EMF Models:
definition.ecore- Connector definitionsimplementation.ecore- Connector implementations
Purpose: Provides EMF Edit framework support for UI manipulation
Key Responsibilities:
- Item providers for property sheets
- Label providers
- Command support for undo/redo
org.bonitasoft.bpm.plugin-dependencies:
- Bundles EMF dependencies for Maven environments
- Includes: EMF Edapt, Maven Artifact APIs
org.bonitasoft.gmf.plugin-dependencies:
- Bundles GMF (Graphical Modeling Framework) dependencies
- Includes: GMF Notation, Draw2D, GEF
Purpose: Maven archetype to generate projects for reading Bonita process models
Generated Project Includes:
- Sample .proc file
- ModelLoader usage examples
- HTML display utilities
User Code
→ ModelLoader.loadModel(URI)
→ ResourceSetImpl with custom handlers
→ Check EMF model version
→ If old version: Migrate via process.history
→ Load into EMF objects (Pool, Configuration, etc.)
→ Return loaded model
BarBuilderFactory.create()
→ BarBuilder with providers
→ buildAll(environment)
→ For each process:
→ Load Configuration for environment
→ ProcessPomGenerator.generatePom()
→ Filter dependencies based on configuration
→ BusinessArchiveBuilder
→ Call all BarArtifactProvider.build()
→ Add connectors, dependencies, forms, etc.
→ Write .bar file
BonitaToBPMNExporter.export()
→ Load Bonita model (EMF)
→ Transform to BPMN 2.0 spec model
→ Map Bonita elements to BPMN elements
→ Preserve diagram notation (GMF)
→ Serialize to BPMN XML
ModelLoader detects old version
→ HistoryUtils.getMigrator()
→ Load process.history (EMF Edapt)
→ Apply automatic migrations
→ CustomMigrationUtil.applyCustomMigrations()
→ Apply 60+ custom migrations in sequence
→ Update model version
→ Save migrated model
- Code Generation: Java classes auto-generated from .ecore models
- Package Structure:
*.impl- Implementation classes (generated)*.util- Utilities (generated + custom)- Root packages - Interfaces and factories (generated)
- Model Files:
.ecore- Model definition.genmodel- Generation configuration.history- Migration history (Edapt)
Each bundle follows Eclipse plugin conventions:
META-INF/MANIFEST.MF- OSGi bundle metadataplugin.xml/plugin.properties- Plugin configurationpom.xml- Maven Tycho build configuration- Packaging:
eclipse-pluginoreclipse-feature
bonita-process-model/
├── pom.xml # Parent aggregator POM
├── releng/target-platform/ # Eclipse target platform definition
├── bundles/ # OSGi bundles (plugins)
├── features/ # Eclipse features (bundle groups)
├── tests/ # Test fragments
├── sites/ # P2 update site (Eclipse repository)
└── releng/coverage-report/ # Aggregated Jacoco reports
The BAR builder uses a provider pattern for extensibility:
interface BarArtifactProvider {
void build(BusinessArchiveBuilder, Pool, ProcessPom, Configuration)
}This allows adding new artifact types without modifying the core builder.
BarBuilderFactory- Creates configured BarBuilder instances- EMF Factories (e.g.,
ProcessFactory) - Create model objects
EMF Resources abstract file I/O:
Resource resource = resourceSet.getResource(uri, true);
Pool process = (Pool) resource.getContents().get(0);- Automatic structural migrations tracked in
.historyfiles - Custom migrations for complex transformations
- Ensures backward compatibility across versions
- Formatter:
formatter.xml(Eclipse Java formatter) - Import Order:
eclipse.importorder(java, javax, org, com) - License Header:
header.txt(GPL v2.0) - Enforcement: Runs on
mvn validatephase via Spotless
type(scope): subject
- feat: Nouvelle fonctionnalité
- fix: Correction de bug
- chore: Tâches de maintenance (deps, CI, etc.)
- refactor: Refactoring (pas de changement fonctionnel)
- test: Ajout ou modification de tests
- docs: Documentation
- perf: Amélioration de performance
- style: Formatage, style (pas de changement de logique)
- ✅ Impératif: "fix bug" pas "fixed bug"
- ✅ Concis: < 72 caractères
- ✅ Minuscules pour type et scope
- ❌ PAS d'emojis
- ❌ PAS de mention "Claude", "AI", "Generated"
- ❌ PAS de "Co-Authored-By: Claude"
feat(config): restore dependencies configuration page
fix(tests): resolve timeout in ProfileSWTBotIT
chore(deps): update Tycho to 4.0.10
refactor(uib): simplify Docker health check logictests/
├── org.bonitasoft.bpm.model.tests/ # Core model tests
├── org.bonitasoft.bpm.model.tests-utils/ # Test utilities
├── org.bonitasoft.bpm.model.edit.tests/ # Edit support tests
├── org.bonitasoft.bonita2bar.tests/ # BAR export tests
├── org.bonitasoft.bonita2bpmn.tests/ # BPMN export tests
├── org.bonitasoft.bpm.migration.tests/ # Migration tests
└── standalone-tests/ # Integration tests (non-OSGi)
- Eclipse Fragment Projects: Tests are fragments of the bundles they test
- OSGi Tests: Run with
tycho-surefire-pluginin Eclipse runtime - Standalone Tests: Pure Maven tests without Eclipse runtime
- Test Resources:
.procfiles and sample projects inresources/orsrc/test/resources/
The project generates a P2 update site for Eclipse RCP integration:
- Location:
sites/org.bonitasoft.bpm/ - Maven Coordinates:
mvn:org.bonitasoft.bpm:org.bonitasoft.bpm.eclipse-repository:<version>:zip
Defined in sites/org.bonitasoft.bpm/category.xml:
- Bonita Business Process Model - Core process models and transformations
- Developer Resources - Test resources
- Third party dependencies - Jackson, Bonita artifacts model
- Definition:
releng/target-platform/target-platform.target - Source:
releng/target-platform/target-platform.tpd(TPD editor format) - Validation:
./mvnw -f releng/target-platform/pom.xml validate -Pvalidate
.github/workflows/build.yml - Continuous Integration
- Triggers: Push to develop, release/, support/
- Steps: Setup Java 17, Setup Groovy, Maven build, SonarQube analysis
- Command:
./mvnw -B -ntp deploy sonar:sonar -Pjacoco
.github/workflows/release.yml - Release Management
- Trigger: Manual (workflow_dispatch)
- Uses: gitflow-maven-plugin
- Command:
./mvnw gitflow:release
.github/workflows/build-pr.yml - Pull Request validation
.github/workflows/publish.yml - Publish to Maven Central
.github/workflows/codeql.yml - Security analysis
- Host: https://sonarcloud.io
- Organization: bonitasoft
- Project Key: bonitasoft_bonita-process-model
- Coverage: Aggregated Jacoco reports from
releng/coverage-report/ - Exclusions:
src-gen/**/*(generated code)
- Edit
.ecorefile (use Eclipse EMF editor) - Regenerate code from
.genmodel - Update
.historyfile if breaking changes - Add custom migration if needed
- Run tests to ensure backward compatibility
- Implement
BarArtifactProviderinterface - Implement
build()method to add artifacts to BAR - Optionally implement
configure()for environment configs - Register provider in
BarBuilderFactoryor via OSGi service
- Create class implementing EMF Edapt migration interface or custom migration interface
- Add to
process.history(automatic) or custom migration list - Test with old process files
- Document in migration tests
- Format:
.procfiles (EMF XMI serialization) - Loading: Use
ModelLoader.loadModel(URI) - Saving: Use EMF Resource API
- Migration: Automatic on load if version mismatch
Versions are managed in pom.xml properties.
Key libraries: EMF (ecore, edapt), GMF Notation, Jackson, Groovy, Maven Artifact, bonita-artifacts-model.
pom.xml- Root Maven configuration (all version properties defined here)formatter.xml,eclipse.importorder,header.txt- Spotless code style config
bundles/org.bonitasoft.bpm.model/model/*.ecore- EMF domain modelsbundles/org.bonitasoft.bpm.model/model/process.genmodel- Generation configbundles/org.bonitasoft.bpm.model/model/process.history- Migration history (Edapt)
releng/target-platform/- Eclipse target platform definitionreleng/coverage-report/- Jacoco aggregation
sites/org.bonitasoft.bpm/- P2 update site (Eclipse repository)bundles/process-reader-archetype/- Maven archetype for process reader projects
Problem: Tycho build fails with "Cannot resolve project dependencies"
Solution: Ensure target platform is up to date: ./mvnw clean install -U
Problem: Spotless formatting failures
Solution: Apply formatting: ./mvnw spotless:apply or skip with -Poffline
Problem: Tests fail with Groovy compilation errors
Solution: Install Groovy: sudo apt-get install groovy (Linux) or ensure GROOVY_HOME is set
Problem: "Cannot load process model - version mismatch" Solution: Ensure migration bundles are on classpath and process.history is accessible
Problem: "Resource cannot be loaded" Solution: Check ModelLoader prerequisites are initialized and EMF packages are registered
Problem: Eclipse cannot find dependencies
Solution: Set target platform to target-platform.target in Eclipse preferences
- EMF Official Docs: https://eclipse.dev/emf/docs.html
- SonarCloud: https://sonarcloud.io/project/overview?id=bonitasoft_bonita-process-model