Metadata-Version: 2.4
Name: bpmn-lib
Version: 4.0.5
Summary: BPMN Process Navigation Library
Author-email: Hennig IT Consulting GmbH <contact@hennig-it-consulting.de>
License: MIT License
        
        Copyright (c) 2026 Hennig IT Consulting GmbH
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/hennig-ai/bpmn-lib
Project-URL: Repository, https://github.com/hennig-ai/bpmn-lib
Project-URL: Issues, https://github.com/hennig-ai/bpmn-lib
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: basic-framework<4.0.0,>=3.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.5.0; extra == "dev"
Requires-Dist: pyright>=1.1.0; extra == "dev"
Dynamic: license-file

# bpmn-lib

A Python library for navigating BPMN (Business Process Model and Notation) element hierarchies and managing in-memory process data. Designed for use in Python-based process automation and tooling pipelines.

## What it does

bpmn-lib lets you load a BPMN process model from markdown-defined schemas and data files, then navigate it programmatically:

- Traverse parent-child element hierarchies (e.g. `bpmn_element → activity → task → user_task`)
- Navigate sequence flows forward and backward
- Query element attributes across inheritance chains
- Resolve data associations (inputs/outputs)
- Validate element type specificity and FK constraints

## Installation

```bash
pip install bpmn-lib
```

Install with dev dependencies (for development):

```bash
pip install -e ".[dev]"
```

## Quick Start

```python
from bpmn_lib.navigator.navigator_factory import create_navigator

navigator = create_navigator(
    schema_file="path/to/schema.md",
    data_file="path/to/data.md",
    hierarchy_file="path/to/hierarchy.md",
    log_dir="path/to/logs",
    schema_name="My BPMN Schema"
)

# Navigate sequence flows
next_elements = navigator.next_elements_in_flow(element_id)

# Get all elements in a process
elements = navigator.get_process_elements(process_id)

# Read an attribute (traverses inheritance chain)
value = navigator.get_element_attribute(element_id, "attribute_name")
```

## Architecture

```
┌─────────────────────────────────────┐
│         Navigation Layer            │  ← BPMNHierarchyNavigator
├─────────────────────────────────────┤
│     Database Instance Layer         │  ← DatabaseInstance, DatabaseBuilder
├─────────────────────────────────────┤
│       Database Schema Layer         │  ← DatabaseSchema, TableDefinition
├─────────────────────────────────────┤
│          Parsing Layer              │  ← DatabaseSchemaParser, MarkdownDocument
└─────────────────────────────────────┘
```

Schema definitions and instance data are loaded from markdown files. The factory function orchestrates the full pipeline: parse schema → load data → validate constraints → build indexes → create navigator.

## Testing

```bash
pytest tests/ -v
pytest tests/unit/ -v
pytest tests/integration/ -v
pytest tests/ --cov=bpmn_lib --cov-report=term-missing
```

## License

MIT — see [LICENSE](LICENSE)
