| title | Bpmn Interop |
|---|---|
| description | Bpmn Interop protocol schemas |
{/*
@module automation/bpmn-interop
BPMN XML Interoperability Protocol
Defines the specification for importing and exporting BPMN 2.0 XML
process definitions. This enables interoperability with external BPM
tools (Camunda, Activiti, jBPM, etc.) via a plugin-based approach.
Priority: Low — long-term planning, not a core requirement.
**Source:** `packages/spec/src/automation/bpmn-interop.zod.ts`import { BpmnDiagnostic, BpmnElementMapping, BpmnExportOptions, BpmnImportOptions, BpmnInteropResult, BpmnUnmappedStrategy, BpmnVersion } from '@objectstack/spec/automation';
import type { BpmnDiagnostic, BpmnElementMapping, BpmnExportOptions, BpmnImportOptions, BpmnInteropResult, BpmnUnmappedStrategy, BpmnVersion } from '@objectstack/spec/automation';
// Validate data
const result = BpmnDiagnostic.parse(data);Diagnostic message from BPMN import/export
| Property | Type | Required | Description |
|---|---|---|---|
| severity | Enum<'info' | 'warning' | 'error'> |
✅ | Diagnostic severity |
| message | string |
✅ | Diagnostic message |
| bpmnElementId | string |
optional | BPMN element ID related to this diagnostic |
| nodeId | string |
optional | ObjectStack node ID related to this diagnostic |
Mapping between BPMN XML element and ObjectStack FlowNodeAction
| Property | Type | Required | Description |
|---|---|---|---|
| bpmnType | string |
✅ | BPMN XML element type (e.g., "bpmn:parallelGateway") |
| flowNodeAction | string |
✅ | ObjectStack FlowNodeAction value |
| bidirectional | boolean |
✅ | Whether the mapping supports both import and export |
| notes | string |
optional | Notes about mapping limitations |
Options for exporting an ObjectStack flow as BPMN 2.0 XML
| Property | Type | Required | Description |
|---|---|---|---|
| version | Enum<'2.0' | '2.0.2'> |
✅ | Target BPMN specification version |
| includeLayout | boolean |
✅ | Include BPMN DI layout data from canvas positions |
| includeExtensions | boolean |
✅ | Include ObjectStack extensions in BPMN extensionElements |
| customMappings | { bpmnType: string; flowNodeAction: string; bidirectional: boolean; notes?: string }[] |
optional | Custom element mappings for export |
| prettyPrint | boolean |
✅ | Pretty-print XML output with indentation |
| namespacePrefix | string |
✅ | XML namespace prefix for BPMN elements |
Options for importing BPMN 2.0 XML into an ObjectStack flow
| Property | Type | Required | Description |
|---|---|---|---|
| unmappedStrategy | Enum<'skip' | 'warn' | 'error' | 'comment'> |
✅ | How to handle unmapped BPMN elements |
| customMappings | { bpmnType: string; flowNodeAction: string; bidirectional: boolean; notes?: string }[] |
optional | Custom element mappings to override or extend defaults |
| importLayout | boolean |
✅ | Import BPMN DI layout positions into canvas node coordinates |
| importDocumentation | boolean |
✅ | Import BPMN documentation elements as node descriptions |
| flowName | string |
optional | Override flow name (defaults to BPMN process name) |
| validateAfterImport | boolean |
✅ | Validate imported flow against FlowSchema after import |
Result of a BPMN import/export operation
| Property | Type | Required | Description |
|---|---|---|---|
| success | boolean |
✅ | Whether the operation completed successfully |
| diagnostics | { severity: Enum<'info' | 'warning' | 'error'>; message: string; bpmnElementId?: string; nodeId?: string }[] |
✅ | Diagnostic messages from the operation |
| mappedCount | integer |
✅ | Number of elements successfully mapped |
| unmappedCount | integer |
✅ | Number of elements that could not be mapped |
Strategy for unmapped BPMN elements during import
skipwarnerrorcomment
BPMN specification version for export
2.02.0.2