# diagram-bpmn-editor

> BPMN editor with a symbol palette, drag-drop shapes, and a context menu.

**Framework:** vue  **Component:** Diagram  **Variant:** bpmn-editor

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/vue/diagram-bpmn-editor.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-vue-diagrams
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/diagram-bpmn-editor/Diagram.vue

```vue
<template>
  <div class="control-section diagram-bpmn">
    <div style="width:100%;height:550px">
      <div id="diagram-space" class="sb-diagram" style="height:550px;border-color: rgba(0, 0, 0, 0.12);border-width: 1px;border-style: solid;">
        <ejs-diagram
          style="display:block"
          ref="diagramObject"
          id="diagram"
          :width="width"
          :height="height"
          :nodes="nodes"
          :connectors="connectors"
          :getNodeDefaults="getNodeDefaults"
          :getConnectorDefaults="getConnectorDefaults"
          :snapSettings="snapSettings"
          :tool="tool"
        ></ejs-diagram>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import {
  DiagramComponent,
  SnapConstraints,
  BpmnDiagrams,
  DiagramTools
} from "@syncfusion/ej2-vue-diagrams";
import { bpmnEditorData, bpmnEditorConnectors } from '../datasource/diagram-data';

export default {
  components: {
    'ejs-diagram': DiagramComponent
  },
  data() {
    return {
      width: '100%',
      height: '550px',
      nodes: bpmnEditorData,
      connectors: bpmnEditorConnectors,
      tool: DiagramTools.Default,
      snapSettings: {
        constraints: SnapConstraints.SnapToObject
      }
    };
  },
  provide() {
    return {
      diagram: [BpmnDiagrams]
    };
  },
  methods: {
    getNodeDefaults(node: any) {
      if (node.shape?.type !== 'Bpmn') {
        node.style = { fill: '#6BA3D6', strokeColor: '#6BA3D6' };
      }
      if (node.annotations?.length > 0) {
        node.annotations[0].style = { color: 'white', fontSize: 12 };
      }
      return node;
    },
    getConnectorDefaults(connector: any) {
      connector.style = { strokeColor: '#6BA3D6', strokeWidth: 2 };
      connector.targetDecorator = { shape: 'Arrow', width: 12, height: 12 };
      connector.type = 'Orthogonal';
      return connector;
    }
  }
};
</script>

<style scoped>
.control-section {
  padding: 20px;
}
.diagram-bpmn {
  padding: 20px;
}
</style>

```
