-
Install dependencies:
pip install lark-parser lxml click
-
Clone/download the project:
# The project is ready to use from this directory cd windsurf-project
Create a .bpm file with your process:
process "My First Process" {
id: "my-first-process"
version: "1.0"
start "Process Started" {
id: "start-1"
}
scriptCall "Do Something" {
id: "task-1"
script: "doSomething(input)"
inputVars: ["input"]
outputVars: ["result"]
}
end "Process Complete" {
id: "end-1"
}
flow {
"start-1" -> "task-1"
"task-1" -> "end-1"
}
}
PYTHONPATH=src python3 -m bpm_dsl.cli convert my-process.bpmThis generates my-process.bpmn ready for Camunda Zeebe!
PYTHONPATH=src python3 -m bpm_dsl.cli validate my-process.bpmPYTHONPATH=src python3 -m bpm_dsl.cli info my-process.bpmprocess "Process Name" {
id: "unique-process-id"
version: "1.0"
// Elements go here
flow {
// Flow definitions go here
}
}
start "Event Name" {
id: "unique-id"
}
end "Event Name" {
id: "unique-id"
}
scriptCall "Task Name" {
id: "unique-id"
script: "javascript_expression"
inputVars: ["var1", "var2"]
outputVars: ["result1", "result2"]
}
gateway "Decision Name" {
id: "unique-id"
type: xor
}
Supported types: xor (exclusive) and parallel.
flow {
"source-id" -> "target-id"
"gateway-id" -> "task-id" [when: "variable == value"]
"gateway-id" -> "fallback-id" [otherwise]
}
The project includes several examples:
examples/example_process.bpm- Complex order processing workflowexamples/simple_approval.bpm- Document approval processexamples/test_simple.bpm- Minimal example
from bpm_dsl.parser import parse_bpm_file
from bpm_dsl.bpmn_generator import BPMNGenerator
from bpm_dsl.validator import ProcessValidator
# Parse a DSL file
process = parse_bpm_file("my-process.bpm")
# Validate the process
validator = ProcessValidator()
result = validator.validate(process)
if result.is_valid:
# Generate BPMN
generator = BPMNGenerator()
xml_content = generator.generate(process)
# Save to file
generator.save_to_file(process, "output.bpmn")The generated BPMN files are fully compatible with Camunda Zeebe:
-
Deploy using Zeebe CLI:
zbctl deploy my-process.bpmn
-
Deploy using Camunda Modeler:
- Open the generated
.bpmnfile - Deploy to your Zeebe cluster
- Open the generated
-
Deploy programmatically:
from zeebe_grpc import ZeebeClient client = ZeebeClient() client.deploy_process("my-process.bpmn")
✅ Complete DSL with 4 primitive elements
✅ BPMN 2.0 XML generation
✅ Zeebe compatibility with proper extensions
✅ Process validation with error reporting
✅ CLI interface for easy usage
✅ Programmatic API for integration
✅ Comprehensive tests ensuring reliability
-
Module not found errors:
# Make sure to set PYTHONPATH PYTHONPATH=src python3 -m bpm_dsl.cli --help -
Parse errors:
- Check syntax against the grammar in
docs/DSL_GRAMMAR.md - Ensure all IDs are unique
- Verify all quotes are properly closed
- Check syntax against the grammar in
-
Validation errors:
- Run
validatecommand to see specific issues - Check that all flow references point to existing elements
- Ensure process has at least one start and end event
- Run
- Check
docs/DSL_GRAMMAR.mdfor complete syntax reference - Run
python3 examples/demos/demo.pyfor a complete demonstration - Look at example files in
examples/directory - Run tests with
PYTHONPATH=src python3 -m pytest tests/
- Create your own processes using the DSL syntax
- Integrate with your workflow using the programmatic API
- Deploy to Camunda Zeebe for execution
- Extend the DSL by adding new primitives as needed
Happy process modeling! 🚀