BPMN Editor API
Complete API reference for @oge-ui/bpmn. The engine — XML reader/writer, geometry, orthogonal routing, snapping and the snapshot command stack — is the framework-free @oge-ui/bpmn-engine package and its user-facing surface (readBpmnXml, writeBpmnXml, the model types) is re-exported from the same barrel; live demos are on the overview page.
Properties Methods Events Types
OgeBpmnEditor
oge-bpmn-editorProperties 22
| Name | Type | Default | Description |
|---|---|---|---|
readOnly | boolean | false | Disables every mutation: palette, context pad, keyboard editing and drags. Selection, pan, zoom and element search keep working. |
gridVisible | boolean | true | Shows the dotted background grid. |
snapEnabled | boolean | true | Enables grid and neighbor-alignment snapping (with guide lines) while moving and placing. |
paletteItems | readonly BpmnPaletteItemType[] | all 18 entries | Palette entries offered, in render order: every placeable node type plus the 'pool' pseudo-entry, which creates a collaboration participant. Event sub-processes and transactions are reached by morphing a sub-process via the panel type select. |
showPropertiesPanel | boolean | true | Shows the right-side properties panel (always hidden in readOnly). |
showMinimap | boolean | true | Shows the bottom-right minimap overlay (hidden while the diagram is empty). Click or drag the minimap to pan the main viewport. |
showHeader | boolean | true | Shows the header toolbar: the inline-editable diagram name, undo/redo, zoom out / percentage (fit) / zoom in, the properties-panel collapse toggle, the optional edit/view mode toggle and the fullscreen button (native Fullscreen API with a fixed-position maximized fallback). |
mode | model<'edit' | 'view'> | 'edit' | The UI mode — two-way. 'view' locks every mutating surface exactly like readOnly; zoom, pan, search and fullscreen stay available. |
allowModeToggle | boolean | false | Shows the edit/view toggle in the header (hidden while readOnly — the app-level lock always wins). |
showBranding | boolean | true | The badge in the canvas corner — a bare logo with no chrome, removable exclusively from code via false. Branding is a courtesy, never a license term (unlike bpmn-js's mandatory watermark). |
brandLogoUrl | string | undefined | — | Badge image URL (per instance, or app-wide via provideOgeBpmnConfig({ brandLogoUrl })); unset renders the built-in drawn mark — no bundled bitmap, no network dependency by default. |
Panel resizing | built-in | — | The palette rail and the properties panel carry role="separator" drag handles — pointer drag (Escape cancels) or Tab + Arrow keys / Home / End, the APG window-splitter keys. The header panel-toggle collapses the properties panel entirely. |
messages | Partial<OgeBpmnMessages> | {} | Per-instance message overrides, merged over the provideOgeBpmnConfig() defaults. |
zoom | model<number> | 1 | Two-way zoom factor ([(zoom)]); wheel zooming writes it back. Clamped to the configured zoomMin/zoomMax. |
lint | boolean | false | Live validation: every model change re-runs the rules, offending shapes, pools and flows get a severity badge (the problem text is appended to their accessible name, the badge itself is aria-hidden), the header shows a problems toggle with the count and the problems panel lists every issue — click or Enter selects the element and pans it into view. validate() works with it off. |
lintRules | OgeBpmnLintRulesInput | — | Rules merged with OGE_BPMN_DEFAULT_LINT_RULES: a full rule ({ id, severity, check(model, context) }) is added, or replaces the built-in with the same id; an override re-grades one ({ id: 'no-implicit-split', severity: 'info' }) or disables it (severity: 'off'). |
propertiesProviders | readonly OgeBpmnPropertiesProvider[] | — | Pluggable properties panel: each provider returns groups of typed entries (text, textarea, select, checkbox, expression, list, custom) for the selected element (or the process), and every entry's set(value) returns the undoable command to run. Merged with OGE_BPMN_DEFAULT_PROPERTIES_PROVIDERS by id — reuse an id to replace a built-in. Pass OGE_BPMN_CAMUNDA_PROVIDERS for the Camunda 7 / Zeebe fields or bpmnElementTemplatesProvider(templates) for element templates. |
paletteProvider | OgeBpmnPaletteProvider | — | Custom palette entries after the built-ins: { id, label, icon, hotkey?, action(api) }. Icons are bpmnSvg trees (sanitized — no markup path); the entries join the palette's roving tabindex; a single-character hotkey works on the canvas (keys the canvas already uses are ignored); api.armPlace(type, { template }) arms click-then-place. |
contextPadProvider | OgeBpmnContextPadProvider | — | Custom context-pad actions of the single selected element: ({ diagram, elementId }) => OgeBpmnContextPadEntry[], each { id, label, icon, hotkey?, action(api, elementId) } — real buttons with aria-keyshortcuts; api.execute(command) keeps every change undoable. |
renderers | OgeBpmnRenderers | — | Per-type shape overrides: { serviceTask: ({ node, width, height, fill, stroke }) => bpmnSvg nodes | null }. The returned tree replaces the built-in glyph (labels, markers, selection and badges are still drawn) in the canvas and in exportSvg() / exportPng(); null or a throwing renderer falls back to the built-in shape. |
Custom properties entries
| Name | Type | Default | Description |
|---|---|---|---|
OgeBpmnPropertiesEntryTemplate ([ogeBpmnPropertiesEntry]) | ng-template directive | — | Draws a provider entry of type custom whose id matches: <ng-template ogeBpmnPropertiesEntry="sla" let-entry let-commit="commit" let-id="inputId">. The context (OgeBpmnPropertiesEntryContext) carries the entry, commit(value) (one undoable command through the entry's set) and the id the entry's label carries for aria-labelledby. |
Canvas keyboard
| Name | Type | Default | Description |
|---|---|---|---|
role="application" canvas | Tab / Shift+Tab · arrows (Shift = 1px) · C · A · H / L / S · F2 / Enter · Delete · Ctrl+Z / Ctrl+Y · Ctrl+C / Ctrl+X / Ctrl+V · Ctrl+A · Ctrl+F · + / − / F · Escape | — | Tab cycles elements (never trapped on an empty selection — leave with Escape then Tab, announced in the canvas hint), arrows move the selection by one grid step, C arms the connect tool (Tab/arrows walk candidate targets, Enter commits), A appends a connected task, H/L/S switch to the hand / lasso / space tool (edit mode only), F zooms to fit, F2/Enter edit the label, Ctrl+C/X/V copy/cut/paste via the internal clipboard, Ctrl+A selects all, Ctrl+F opens the element search overlay, Escape cancels the active tool or drag. The selected element is exposed via aria-activedescendant and every action is narrated in a polite live region. |
Methods 21
Import & export
| Name | Type | Description |
|---|---|---|
importXml(xml: string) | Promise<BpmnImportResult> | Parses BPMN XML and loads it into the editor, resetting undo history and fitting the viewport. Resolves with the import result (model + warnings); on a fatal parse error the current diagram is left untouched. |
exportXml() | string | Serializes the current diagram to deterministic BPMN 2.0 XML — same model, same bytes. |
exportJson() | BpmnDiagramJson | Wraps the current diagram in the versioned JSON persistence envelope — the shape to store in an application database and the payload of the diagramChanged autosave stream. |
importJson(value: unknown) | { error?: string } | Validates a JSON persistence envelope (see fromBpmnJson) and loads it, resetting undo history and fitting the viewport exactly like importXml. On a validation error the current diagram is left untouched and the error message is returned. |
exportSvg() | string | Renders the current diagram as a self-contained static SVG string (neutral hardcoded colors, no grid or selection, viewBox fitted to the content) via renderDiagramSvg — writable to a file or embeddable as-is. |
exportPng(options?: OgeBpmnPngExportOptions) | Promise<Blob | null> | Rasterizes the SVG export onto a canvas and resolves a PNG blob (pixelRatio default 2, background default white, padding) — no library, nothing leaves the page. Resolves null where there is no canvas (server rendering, jsdom). |
newDiagram() | void | Replaces the diagram with an empty one and resets history and viewport. |
Validation
| Name | Type | Description |
|---|---|---|
validate() | readonly OgeBpmnLintIssue[] | Runs the effective rules (built-ins plus lintRules) over the current diagram and returns every issue, errors first — whether or not lint is on; with it on, the problems panel opens too. |
Selection, history & navigation
| Name | Type | Description |
|---|---|---|
zoomToFit() | void | Fits and centers the whole diagram in the canvas. |
centerOn(id: string) | void | Pans the viewport (keeping the current zoom) so the given element is centered in the canvas. Unknown ids are ignored. Used by the element search overlay; public for app-driven navigation. |
select(ids: readonly string[]) | void | Selects the given element ids, pools included (unknown ids are ignored). |
getSelection() | readonly string[] | The currently selected element ids. |
deleteSelection() | void | Deletes the selected elements, cascading to their attached edges and clearing orphaned default-flow markers. |
undo() / redo() | void | Undoes / re-applies the most recent command. Snapshot-based: each command — including every arrow-key step — is exactly one entry. |
canUndo() / canRedo() | boolean | Whether at least one command can be undone / redone. |
isDirty() | boolean | True when the model differs from the last save point. |
markSaved() | void | Marks the current model as saved; isDirty() reports false until the model changes again. |
focus() | void | Moves keyboard focus onto the diagram canvas. |
Overlays
| Name | Type | Description |
|---|---|---|
addOverlay(overlay: OgeBpmnOverlay) | string | Attaches an HTML badge to a diagram element and returns a handle for removeOverlay. The badge tracks the element through pan/zoom and model changes; a dangling elementId hides it without removing the registration. The html renders through Angular's sanitizing [innerHTML] binding. |
removeOverlay(id: string) | void | Removes the overlay registered under the given handle. Unknown handles are ignored. |
clearOverlays(elementId?: string) | void | Removes every registered overlay, or — when elementId is given — only the overlays attached to that element. |
Events 6
| Name | Type | Description |
|---|---|---|
selectionChanged | OgeBpmnSelectionEvent | The selection changed (user interaction or select()): { ids, elements } with per-element { id, type, name? } summaries. |
elementsChanged | OgeBpmnElementsChangedEvent | The diagram model changed: { source, label }, where source is execute | undo | redo | import | new and label is the command label. |
diagramChanged | OgeBpmnDiagramChangedEvent | Debounced autosave stream: after model changes settle for autoSaveDebounceMs (default 500ms; 0 emits synchronously) the diagram is serialized once to both JSON and XML and emitted together with the change source. Emitted for every source including import and new — filter on source to persist only user edits. No serialization happens mid-drag (gestures commit one command on release); a pending emission is cancelled on destroy. |
importCompleted | OgeBpmnImportEvent | An importXml() call finished parsing; carries the fidelity warnings ({ warnings }) — emitted on fatal errors too. |
dirtyChanged | boolean | The dirty state flipped — the model diverged from, or returned to, the save point. |
lintChanged | OgeBpmnLintChangedEvent | The live validation result changed (only while lint is on): { issues, errors, warnings, infos }. Emitted once after an import and after every edit that changes the issue list. |
Types 69
Event payloads & overlays
| Name | Type | Description |
|---|---|---|
OgeBpmnSelectionEvent | { ids: readonly string[]; elements: readonly OgeBpmnElementInfo[] } | Payload of selectionChanged. |
OgeBpmnElementInfo | { id: string; type: BpmnNodeType | BpmnEdgeType | 'pool'; name?: string } | Summary of one diagram element carried in editor event payloads. |
OgeBpmnElementsChangedEvent | { source: OgeBpmnChangeSource; label: string } | Payload of elementsChanged: what changed the model and the command label. |
OgeBpmnChangeSource | 'execute' | 'undo' | 'redo' | 'import' | 'new' | Origin of a model change reported by elementsChanged and diagramChanged. |
OgeBpmnDiagramChangedEvent | { json: BpmnDiagramJson; xml: string; source: OgeBpmnChangeSource } | Payload of the debounced diagramChanged autosave stream: the diagram in both persistence formats plus what caused the change. |
OgeBpmnImportEvent | { warnings: readonly BpmnImportWarning[] } | Payload of importCompleted: the fidelity warnings collected during import. |
OgeBpmnOverlay | { elementId: string; html: string; position: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center'; offset?: Point } | A programmatic HTML badge attached to a diagram element (process-monitoring overlays), registered via addOverlay(). position picks which corner (or the center) of the element's bounds the badge anchors to; offset is extra diagram-unit displacement applied before the screen transform. html is bound through Angular's sanitizing [innerHTML] — script tags and inline event handlers are stripped; a link that keeps target always gets rel="noopener noreferrer" and role is dropped, matching the React layer. |
OgeBpmnPaletteItem | { type: BpmnPaletteItemType } | One entry of the elements palette. |
BpmnPaletteItemType | BpmnNodeType | 'pool' | Everything the palette can place: node types plus the 'pool' pseudo-entry, which creates a collaboration participant. |
Engine — import & export
| Name | Type | Description |
|---|---|---|
readBpmnXml(xml: string) | BpmnImportResult | Standalone, prefix-agnostic BPMN 2.0 reader (bpmn:, bpmn2: or no prefix) — pure TypeScript, usable outside the component. Missing DI is auto-laid-out with a warning. |
writeBpmnXml(model: BpmnDiagram) | string | Standalone byte-deterministic BPMN 2.0 writer with fixed, normalized prefixes; preserved extensionElements/documentation/unknown attributes are written back verbatim. |
toBpmnJson(model: BpmnDiagram) | BpmnDiagramJson | Wraps the diagram model in the versioned JSON persistence envelope — the standalone twin of OgeBpmnEditor.exportJson(). |
fromBpmnJson(value: unknown) | BpmnJsonParseResult | Structurally validates a value produced by toBpmnJson (typically after a JSON.parse round trip through a database) and returns the diagram model, or an error describing the first problem found. Unknown extra keys are tolerated for forward compatibility; version mismatches, missing required maps and broken id cross-references are not. |
renderDiagramSvg(model, options?) | (model: BpmnDiagram, options?: BpmnSvgExportOptions) => string | Renders the diagram as a self-contained static <svg> string: shapes, edges (with arrowhead markers) and labels re-rendered with inline fill/stroke attributes, viewBox fitted to the content bounds plus padding. No grid, no selection state, no external CSS. |
BpmnSvgExportOptions | { padding?: number } | Options of renderDiagramSvg: padding in diagram units added around the content bounds (default 20). |
createEmptyDiagram(processId?) | BpmnDiagram | A fresh empty diagram model with default <definitions> attributes. |
BpmnDiagramJson | { version: 1; diagram: BpmnDiagram } | Versioned JSON envelope for persisting a diagram to an application database; version guards forward compatibility of the envelope shape. |
BpmnJsonParseResult | { model: BpmnDiagram | null; error?: string } | Result of fromBpmnJson: the model, or null plus an error message. |
BpmnImportResult | { model: BpmnDiagram | null; warnings: readonly BpmnImportWarning[]; error?: string } | Result of importing BPMN XML: the model (null on fatal errors) plus fidelity warnings. |
BpmnImportWarning / BpmnImportWarningCode | { code, message, elementId?, localName? } · 'unsupported-element' | 'missing-di' | 'multiple-processes' | 'dangling-ref' | 'event-definition-stripped' | 'invalid-event-definition' | 'nested-lanes-flattened' | A non-fatal fidelity loss reported while importing — dropped flow elements, stripped or position-invalid event definitions, dangling references, missing DI, flattened nested lanes. |
Engine — alignment
| Name | Type | Description |
|---|---|---|
alignElements(rects, mode) | (rects: Readonly<Record<string, Rect>>, mode: BpmnAlignMode) => Record<string, Point> | Computes the per-element move deltas that align the given rectangles (bpmn-js align-elements semantics): edge modes move to the outermost matching edge, center modes to the center of the joint bounding box. Every input id appears in the result (zero delta when already aligned); fewer than 2 rectangles produce an empty result. Pure — no model involved. |
distributeElements(rects, axis) | (rects: Readonly<Record<string, Rect>>, axis: BpmnDistributeAxis) => Record<string, Point> | Computes the deltas that spread the elements at equal center gaps along one axis (3+ elements). Pure — no model involved. |
BpmnAlignMode | 'left' | 'centerX' | 'right' | 'top' | 'centerY' | 'bottom' | Alignment edge/axis of alignElements: edge values align the matching edges, centerX/centerY align the centers on the horizontal / vertical axis of the selection's bounding box. |
BpmnDistributeAxis | 'x' | 'y' | Distribution axis of distributeElements: x spreads horizontally. |
Engine — model
| Name | Type | Description |
|---|---|---|
BpmnDiagram | readonly plain-object graph | The complete immutable diagram model: the default process, optional collaboration pools, nodes/edges records, a deterministic order list, per-element DI bounds/waypoints and the preserved foreign XML fragments. All nodes and edges of every pool's process live in the single flat maps; a node's poolId decides which <bpmn:process> it is serialized into. |
BpmnNode / BpmnNodeType | 'startEvent' | 'endEvent' | 'intermediateThrowEvent' | 'intermediateCatchEvent' | 'boundaryEvent' | 'task' | 'userTask' | 'serviceTask' | 'scriptTask' | 'callActivity' | 'subProcess' | 'eventSubProcess' | 'transaction' | 'exclusiveGateway' | 'parallelGateway' | 'dataObject' | 'dataStore' | 'group' | 'textAnnotation' | A diagram node and every node kind that can appear on the canvas. Events carry eventDefinition (and boundary events attachedToRef/cancelActivity), gateways carry defaultFlowId, activities carry marker/isForCompensation, call activities calledElement, sub-process children parentId, annotations text. |
BpmnEdge / BpmnEdgeType | 'sequenceFlow' | 'association' | 'messageFlow' | 'dataAssociation' | A connection with sourceRef/targetRef: sequence flows (may carry name and conditionExpression), annotation associations, cross-pool message flows and data associations (v0.4 — one endpoint must be an activity). |
BpmnEventDefinitionKind | 'message' | 'timer' | 'error' | 'signal' | 'escalation' | 'conditional' | 'link' | 'compensate' | 'terminate' | The nine standard BPMN event definition kinds (single definition per event). |
VALID_EVENT_DEFINITIONS | Readonly<Record<event position, readonly BpmnEventDefinitionKind[]>> | Which event definition kinds each event position accepts (BPMN 2.0 table 10.87 subset), enforced by the reader and the panel definition select. v0.3 simplification: error on a start event is allowed unconditionally although the spec restricts it to event sub-processes. |
BpmnActivityMarker | 'loop' | 'multiInstanceParallel' | 'multiInstanceSequential' | 'compensation' | Loop/multi-instance/compensation markers rendered at an activity's bottom center. |
BpmnSubProcessType | 'subProcess' | 'eventSubProcess' | 'transaction' | The three sub-process container kinds (children carry parentId). |
BpmnDataNodeType | 'dataObject' | 'dataStore' | Data element kinds (v0.4): the page-with-fold object and the cylinder store. |
BpmnPool / BpmnLane | interfaces | A collaboration participant and its swimlanes. A pool without a processRef is a black-box pool: it renders as an empty band and is a valid message-flow endpoint, but has no process contents. Lane membership is the ordered flowNodeRefs id list, auto-maintained from geometry on every editing command. |
BpmnMessageFlow | interface | A message flow between elements of different pools. Either endpoint may be a participant (pool) id or a flow-node id; serialized inside the <bpmn:collaboration> element. |
BpmnClipboard | interface | A deep-cloned diagram subgraph held by the editor's internal clipboard: the copied nodes plus every edge whose both endpoints were copied, with their DI. Ids still refer to the source diagram; pasting remaps them. |
Point / Rect | { x, y } · { x, y, width, height } | Geometry primitives used by DI bounds and waypoints. |
Validation
| Name | Type | Description |
|---|---|---|
OgeBpmnLintRule | { id: string; severity: OgeBpmnLintSeverity; check(model, context): OgeBpmnLintReport[] } | A validation rule — pure data plus a pure check over the immutable model (runs on a server or in CI too). context.messages carries the localized lint strings and context.displayName(id) an element's display name; a throwing rule is skipped. |
OgeBpmnLintRuleOverride | { id: string; severity: OgeBpmnLintSeverity | 'off' } | Re-grades or disables a rule inside lintRules. |
OgeBpmnLintRulesInput | readonly (OgeBpmnLintRule | OgeBpmnLintRuleOverride)[] | The lintRules input type. |
OgeBpmnLintIssue | { key; ruleId; severity; elementId; message } | One problem — listed in the problems panel, counted in lintChanged, returned by validate(). |
OgeBpmnLintChangedEvent | { issues; errors; warnings; infos } | Payload of lintChanged. |
OgeBpmnLintSeverity | 'error' | 'warning' | 'info' | Severity of a rule and its issues. |
OGE_BPMN_DEFAULT_LINT_RULES | readonly OgeBpmnLintRule[] | The bpmnlint-like built-ins: start-event-required, end-event-required, no-disconnected, superfluous-gateway (a gateway must fork or join), conditional-flows (exclusive-gateway conditions and default flow), no-implicit-split, no-implicit-join, label-required, no-duplicate-ids, sub-process-start-event, message-flow-pools, boundary-event-attached and no-unreachable. |
lintBpmnDiagram(model, rules?, messages?) | readonly OgeBpmnLintIssue[] | The engine function behind validate() — usable without an editor (lintBpmnDiagram(readBpmnXml(xml).model)). resolveBpmnLintRules(input) applies a lintRules list to the defaults. |
Extensibility
| Name | Type | Description |
|---|---|---|
OgeBpmnPropertiesProvider | { id: string; getGroups(context: OgeBpmnPropertiesContext): OgeBpmnPropertiesGroup[] } | A source of panel groups. context.target is the process (nothing selected) or the selected node, edge or pool; context.messages the resolved catalog. A provider that throws contributes nothing. |
OgeBpmnPropertiesGroup | { id: string; label: string; entries: OgeBpmnPropertiesEntry[] } | A titled group (an empty label renders the entries without a heading; a labelled group is a role="group" named by its heading). |
OgeBpmnPropertiesEntry | { id; label; type; value; options?; columns?; description?; placeholder?; disabled?; data?; set?(value) } | One field. value is a string, a boolean (checkbox) or rows (list, with columns); set(value) returns the command a commit runs (Enter / blur / pick — one undo step), or null. description is wired with aria-describedby; list cells are named {entry} {column} {row}. |
OgeBpmnPropertiesEntryContext | { $implicit: entry; entry; commit(value); inputId } | Template context of [ogeBpmnPropertiesEntry]. |
OGE_BPMN_DEFAULT_PROPERTIES_PROVIDERS | readonly OgeBpmnPropertiesProvider[] | The built-in G5b fields as providers: event-definition details (oge-event-details) and "Move to…" + documentation (oge-general). |
OgeBpmnPaletteEntry / OgeBpmnPaletteProvider | { id; label; icon: OgeBpmnSvgNode[]; hotkey?; action(api) } | A custom palette entry and its provider. |
OgeBpmnContextPadEntry / OgeBpmnContextPadProvider | { id; label; icon: OgeBpmnSvgNode[]; hotkey?; action(api, elementId) } | A custom context-pad action and its provider. |
OgeBpmnEditorApi | { getDiagram; getSelection; select; execute; armPlace; appendElement; announce; focus } | What palette and context-pad actions may do — execute(command) runs any engine command as one undo step; armPlace(type, { template }) / appendElement(sourceId, type, { template }) create (templated) elements. |
OgeBpmnRenderers / OgeBpmnElementRenderer / OgeBpmnRenderContext | (context: { node; width; height; fill; stroke }) => OgeBpmnSvgNode[] | null | The renderers input types. |
bpmnSvg | { g, path, rect, circle, ellipse, line, polyline, polygon, text } | The safe SVG builders every icon and renderer uses (bpmnSvg.circle(12, 12, 8, { 'stroke-width': 2 })). Trees pass sanitizeBpmnSvg before they render: unknown tags and attributes, on* handlers, href, style and external url(…) are dropped; text is a text node. |
OgeBpmnSvgNode | { tag; attrs?; children?; text? } | One element of a safe SVG tree. |
OgeBpmnElementTemplate / OgeBpmnTemplateProperty | { id; name; version?; appliesTo; elementType?; icon?; properties } | Element templates modeled on Camunda Modeler's: each property (String, Text, Boolean, Dropdown, Hidden) is bound to name / calledElement / a vendor attribute, the documentation, zeebe:taskDefinition, zeebe:input / zeebe:output, zeebe:taskHeader or camunda:inputParameter / camunda:outputParameter. |
applyElementTemplateCommand(id, template) | BpmnCommand | Applies a template programmatically (what the provider's select runs): morph, defaults, template id — one undo step. Run it with api.execute() from a palette / pad action or after importXml(). |
setForeignAttributeCommand(id, name, value, namespaces?) | BpmnCommand | Sets (or, with '', removes) a qualified vendor attribute (oge:dueWithin, camunda:asyncBefore) on a node, edge, pool or the process, declaring namespaces on <definitions>. bpmnForeignAttribute(model, id, name) reads one back — the pair custom providers store their values with. |
bpmnForeignAttribute(model, id, name) | string | A vendor attribute of an element, or ''. |
setElementColorsCommand(ids, patch) | BpmnCommand | Sets or clears (null) the DI fill / stroke of elements — the command behind the panel's appearance section, handy in context-pad actions. |
bpmnElementTemplatesProvider(templates) | OgeBpmnPropertiesProvider | A "Template" select on every element a template applies to and, once applied, the template's visible properties as typed fields. applyElementTemplateCommand(id, template) morphs to elementType, writes every default and records zeebe:modelerTemplate (or camunda:modelerTemplate) — one undo step. |
Camunda / Zeebe
| Name | Type | Description |
|---|---|---|
OGE_BPMN_CAMUNDA_PROVIDERS | readonly OgeBpmnPropertiesProvider[] | The opt-in camundaProviders preset: OGE_BPMN_ZEEBE_PROVIDER (task definition job type + retries and task headers on service / script tasks, input / output mappings on activities and non-start events) and OGE_BPMN_CAMUNDA7_PROVIDER (camunda:assignee / candidateGroups / formKey on user tasks, camunda:inputOutput text parameters on activities). Edits write the extension tree and declare xmlns:zeebe / xmlns:camunda when needed; complex parameters (camunda:list, map, script) are kept untouched. |
OgeBpmnPropertyBinding | { type: 'property' | 'documentation' | 'zeebe:taskDefinition' | 'zeebe:input' | 'zeebe:output' | 'zeebe:taskHeader' | 'camunda:inputParameter' | 'camunda:outputParameter'; … } | Where a value lives; read with bpmnBindingValue(model, id, binding), written with setBpmnBindingCommand(id, binding, value). |
BpmnXmlElement | { name; attributes?; children?; text? } | The editable tree of <bpmn:extensionElements> (qualified names, #text / #comment for mixed content), written back deterministically. Unknown vendor elements stay in the tree untouched. |
Engine — G5b modeling & payloads
| Name | Type | Description |
|---|---|---|
BpmnEventDetails | { id?; timer?: { kind: BpmnTimerKind; expression }; ref?; condition?; linkName? } | The event-definition payload: timer timeDate / timeDuration / timeCycle, the messageRef / signalRef / errorRef / escalationRef, the conditional condition and the link name — imported, editable in the panel and exported (no more dropped-payload warning). |
BpmnRootElement | { id; type: 'message' | 'signal' | 'error' | 'escalation'; name?; code? } | Definitions-level root elements (BpmnDiagram.rootElements); the panel's reference select offers the existing ones and a "New …" option (addRootElementCommand). |
setDocumentationCommand(id, text) | BpmnCommand | Sets or clears <bpmn:documentation> on any node, edge or pool, or the process (BPMN_PROCESS_TARGET). |
moveToContainerCommand(id, targetId) | BpmnCommand | Re-parenting — the keyboard twin of the drag drop ("Move to…" in the panel): moves the element inside a pool, lane or expanded sub-process and re-parents it in one undo step; sequence flows that would cross pools or scopes are removed. reparentElementsCommand(ids, target) is the drop's half. |
OgeBpmnPngExportOptions | { pixelRatio?: number; background?: string; padding?: number } | Options of exportPng(). |
Configuration
Properties 36
OgeBpmnConfig
| Name | Type | Default | Description |
|---|---|---|---|
gridSize | number | 10 | Grid step in diagram units used for placement and arrow-key movement. |
snapThreshold | number | 5 | Neighbor-alignment snapping threshold in diagram units — center/edge alignment beats the grid inside it. |
zoomMin / zoomMax | number | 0.2 / 4 | Bounds of the zoom factor. |
autoSaveDebounceMs | number | 500 | Debounce in milliseconds for the editor's diagramChanged autosave stream: rapid model changes collapse into one emission carrying the final state; 0 emits synchronously after every change. Serialization happens only on emit and never while dragging (move/bend gestures commit a single command on release). |
colorPresets | readonly string[] | OGE_DEFAULT_BPMN_COLOR_PRESETS | Fill color presets (any CSS color strings) offered as swatch buttons in the properties panel's appearance section. Presets set the fill only; the stroke has its own picker. |
messages | OgeBpmnMessages | — | Every user-facing string the editor renders, including aria labels. |
OgeBpmnMessages
| Name | Type | Default | Description |
|---|---|---|---|
canvasLabel / canvasHint | string | — | Accessible name of the role="application" canvas, and the focus hint explaining how to leave the diagram (appended to the label). |
emptyText | string | — | Centered hint shown while the diagram has no elements. |
paletteLabel | string | — | Accessible name of the elements palette toolbar. |
paletteLabels | Readonly<Record<BpmnPaletteItemType, string>> | — | Label (tooltip + aria label) of each palette entry, per palette item type (including 'pool') — a full record, so an override supplies every key. |
tools | OgeBpmnToolsMessages | — | Labels of the tool strip below the palette: label (the toolbar's accessible name), hand, lasso, space, globalConnect and search. |
align | OgeBpmnAlignMessages | — | Labels of the align/distribute flyout on multi-element selections: menuLabel, the six align* entries and distributeHorizontal/distributeVertical (equal gaps, 3+ elements). |
search | OgeBpmnSearchMessages | — | Labels of the element search overlay (Ctrl+F): label, placeholder and noResults. |
minimapLabel | string | — | Accessible name of the minimap navigation overlay. |
contextPad | OgeBpmnContextPadMessages | — | Aria labels and titles of the context-pad actions: connect, appendTask, appendGateway, appendEndEvent, editLabel, toggleDefault, deleteElement. |
announcements | OgeBpmnAnnouncementMessages | — | Live-region announcement templates; {token} placeholders are substituted. |
elementNames | Readonly<Record<BpmnElementNameKey, string>> | — | Fallback display name per element type — node/edge types plus pools and lanes — used when an element has no name. |
lint / extensions / camunda | OgeBpmnLintMessages / OgeBpmnExtensionMessages / OgeBpmnCamundaMessages | — | The G5b strings — badges, problems panel and rule messages; documentation, "Move to", event details, list fields and templates; the Camunda / Zeebe fields. Optional blocks: a catalog without them (or with a partial block) is filled key by key from English (fillBpmnMessages). |
properties | OgeBpmnPropertiesMessages | — | Labels of the properties panel: headings, field labels and templates. |
OgeBpmnPropertiesMessages
| Name | Type | Default | Description |
|---|---|---|---|
panelLabel / processHeading / name / id / executable | string | — | The panel region's accessible name, the no-selection (process) heading, the name field label, the read-only id row label and the process "is executable" checkbox label. |
condition / defaultFlow / annotationText / selectionCount | string | — | The sequence-flow condition textarea, the "default flow" checkbox on an exclusive gateway's flow, the text-annotation textarea and the multi-selection summary ({count}). |
appearanceHeading / fillLabel / strokeLabel / clearColors / presetLabel | string | — | The appearance (colors) section: heading, fill/stroke picker labels, the "clear colors" button and the aria label of a preset swatch ({color}). |
typeLabel / eventDefinition / noneOption / eventDefinitionNames | string · Readonly<Record<BpmnEventDefinitionKind, string>> | — | The element type (morph) select, the event definition select on events, the shared "None" option and the display name per event definition kind. |
interrupting / collapsed / marker / markerNames / forCompensation / calledElement | string · Readonly<Record<marker, string>> | — | The boundary event "Interrupting" checkbox, the sub-process "Collapsed" checkbox, the activity marker select with its per-marker display names, the "For compensation" checkbox and the call activity "Called element" field. |
lanesHeading / addLane / removeLane / laneName | string | — | The lanes section of the pool panel: heading, "Add lane" button, per-lane "Remove" button ({name}) and lane name input aria label ({name}). |
OgeBpmnAnnouncementMessages
| Name | Type | Default | Description |
|---|---|---|---|
created / moved / connected / deleted | string templates | — | After a palette placement ({type}), a move ({name}), a connection ({source}/{target}) and a deletion ({count}). |
undone / redone | string templates | — | After undo/redo; {label} is the affected command label. |
selected / selectionCleared | string templates | — | When an element becomes selected ({name}) and when the selection is cleared. |
imported / importedWithWarnings | string templates | — | After a clean import, and after an import that produced warnings ({count}). |
connectDenied / labelEdited | string templates | — | When a requested connection is not allowed by the rules, and after an inline label edit is committed. |
copied / cut / pasted | string templates | — | After a clipboard copy, cut and paste; {count} is the number of affected elements. |
recolored / resized / typeChanged | string templates | — | After a recolor ({count}), a resize ({name}) and a properties-panel type morph ({name}/{type}). |
attached / attachDenied / collapsedToggled | string templates | — | After a boundary event attaches ({name}/{host}), when a boundary-event placement finds no activity border, and after a sub-process collapse/expand ({name}). |
poolCreated / laneAdded / laneRemoved | string templates | — | After a pool is placed from the palette and after a lane is added to / removed from a pool ({name} is the pool's display name). |
aligned / distributed / spaceAdjusted | string templates | — | After an align, distribute and space-tool commit; {count} is the number of moved/shifted elements. |
searchResults / labelMoved / waypointRemoved | string templates | — | When the search result set changes ({count}), after an external label drag ({name}) and after a bend-point handle was removed by double click. |
Types 7
| Name | Type | Description |
|---|---|---|
provideOgeBpmnConfig(config: OgeBpmnConfigInput) | Provider | Application- or component-scoped editor defaults; messages is a partial merged over the built-in English strings. |
OgeBpmnConfigInput | Partial<OgeBpmnConfig> with Partial<OgeBpmnMessages> | Argument shape of provideOgeBpmnConfig(). |
OGE_BPMN_CONFIG | InjectionToken<OgeBpmnConfig> | The DI token the editor reads; defaults to OGE_DEFAULT_BPMN_CONFIG. |
OGE_DEFAULT_BPMN_CONFIG / OGE_DEFAULT_BPMN_MESSAGES | OgeBpmnConfig / OgeBpmnMessages | The built-in defaults — handy as a base for wholesale message replacement. |
OGE_DEFAULT_BPMN_COLOR_PRESETS | readonly string[] | The default fill presets of the properties panel's appearance section: eight soft pastel tones that keep dark strokes and labels readable. Override per app via colorPresets. |
BpmnElementNameKey | BpmnNodeType | BpmnEdgeType | 'pool' | 'lane' | Every key of elementNames: node/edge types plus pools and lanes. |
OgeBpmnContextPadMessages / OgeBpmnToolsMessages / OgeBpmnAlignMessages / OgeBpmnSearchMessages / OgeBpmnPropertiesMessages / OgeBpmnHeaderMessages | interfaces | The message blocks referenced above — context-pad actions, tool strip, align/distribute flyout, search overlay and properties panel. |
Notes
- There is no
[diagram]input — the model is owned by the editor's command stack so undo can never desynchronize. Load withimportXml(), observe withelementsChanged, read back withexportXml(). - Import never fails silently: the few constructs the model cannot represent (nested lane sets, extra event definitions on one event) are dropped with an explicit
BpmnImportWarning. Event-definition payloads (timers, message / signal / error / escalation references, conditions, link names),documentationandextensionElementsare read into editable fields, and unknown attributes and vendor elements are preserved verbatim and written back on export — Camunda / Zeebe files round-trip byte-identically. - Persistence has three formats: BPMN XML (
importXml/exportXml), the versioned JSON envelope (importJson/exportJson, also emitted by the debounceddiagramChangedautosave stream) and static SVG (exportSvg, one-way).