BPMN Transformer
bloge-bpmn-transformer translates BPMN 2.0 models into BLOGE artifacts. It can validate a BPMN process, generate .bloge DSL, or materialize an executable Graph directly when an OperatorRegistry is available.
Translation pipeline
BLOGE's BPMN support follows a conservative, diagnostics-first pipeline:
BpmnXmlParserreads BPMN XML into an internal process modelBpmnToBlogeTranslatorlowers supported BPMN constructs into BLOGE's intermediate representationDslCodeGeneratorrenders.blogetext, orGraphTranslatorproduces an executableGraphTranslationResult<T>returns the generated artifact together with warnings and errors
The public entry point is BpmnTranslator.
Quick start
Path bpmnFile = Path.of("src/main/resources/order-process.bpmn");
OperatorMappingConfig mapping = new OperatorMappingConfig(
List.of(
new OperatorMappingRule(
new BpmnMappingSelector("fetchCustomer", "serviceTask"),
new BlogeMappingTarget("FetchCustomerOperator", ""),
Map.of("customerId", "ctx.customerId")
)
),
Map.of("scriptTask", new DefaultMappingRule("__script__", "groovy"))
);
BpmnTranslator translator = new BpmnTranslator(
mapping,
new TranslationOptions(true, true, true, Duration.ofSeconds(5), ExpressionTranslationMode.AUTO)
);
TranslationResult<String> dsl = translator.translateToDsl(bpmnFile);Supported BPMN scope
The module currently focuses on orchestration-oriented BPMN constructs that map cleanly to BLOGE:
- start and end events
- service, script, and user tasks
- exclusive and parallel gateways
- timer, message, and signal events
- call activities and subprocess structures
- sequence flows with task input/output mapping metadata
If a construct cannot be mapped safely, the translator emits diagnostics instead of inventing semantics.
Diagnostics model
TranslationResult<T> keeps both the translated output and the diagnostics produced during translation.
| Code | Meaning |
|---|---|
UNSUPPORTED_ELEMENT | The BPMN file contains an unsupported construct |
UNMAPPED_OPERATOR | No operator mapping matched a BPMN task that should become executable |
COMPLEX_EXPRESSION | An expression could not be translated one-to-one |
POTENTIAL_DATA_LOSS | Translation is possible, but some BPMN meaning may be weakened |
In strict mode, warnings can be promoted into hard failures for CI use.
Operator mapping strategy
Translation quality depends on the operator mapping table. BLOGE supports two layers:
- explicit
OperatorMappingRuleentries for deterministic task mappings DefaultMappingRulefallbacks for broader task categories such as script tasks
This keeps important tasks predictable while still allowing exploratory translation of larger BPMN models.
Known limitations
- vendor-specific BPMN extensions are outside the public compatibility promise
- unsupported gateway types remain diagnostics, not synthesized behavior
- complex expression languages may require manual cleanup in generated DSL
- direct graph translation still depends on a valid operator registry for the final executable graph
Recommended workflow
- translate BPMN to DSL
- review diagnostics
- inspect the generated
.blogefile in Studio or editor tooling - adjust operator mappings until the result is explicit and production-safe
- compile and execute the DSL through the normal BLOGE pipeline
Next steps
- Edit generated assets with Bloge Studio
- Validate DSL output with Maven Plugin & Lint
- See larger orchestration examples in Example Catalog