# diagram-bpmn-editor

> BPMN process editor with a diagram canvas and a symbol palette of BPMN shapes, events, and tasks.

**Framework:** aspnet-core  **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/aspnet-core/diagram-bpmn-editor.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.AspNetCore.Diagram
```

**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.cshtml

```cshtml
@page
@namespace aspnet_core.Diagram.BpmnEditor
@model EJ2CoreSampleBrowser.Diagram.BpmnEditor.BpmnEditorModel
@using Syncfusion.EJ2

    <div class="control-section">
        <div class="content-wrapper" style="display: flex; gap: 12px;">
            <div style="width: 240px;">
                <ejs-symbolpalette id="symbolpalette" width="100%" height="640px">
                    <e-symbolpalette-palettes>
                        <e-symbolpalette-palette id="events" expanded="true"></e-symbolpalette-palette>
                        <e-symbolpalette-palette id="tasks" expanded="true"></e-symbolpalette-palette>
                        <e-symbolpalette-palette id="gateways" expanded="true"></e-symbolpalette-palette>
                    </e-symbolpalette-palettes>
                </ejs-symbolpalette>
            </div>
            <div style="flex: 1;">
                <ejs-diagram id="diagram" width="100%" height="640px" nodes="@Model.Nodes" connectors="@Model.Connectors">
                </ejs-diagram>
            </div>
        </div>
    </div>

    <script>
        // Define the BPMN shape palette in JavaScript so the .cshtml stays
        // focused on layout. Each palette group contains a small set of
        // generic BPMN shapes (events, tasks, gateways).
        document.addEventListener('DOMContentLoaded', function () {
            var palette = document.getElementById('symbolpalette') &&
                document.getElementById('symbolpalette').ej2_instances[0];
            if (palette) {
                palette.palettes = [
                    {
                        id: 'events',
                        symbols: [
                            { id: 'start', shape: { type: 'Bpmn', shape: 'Event', event: { event: 'Start' } } },
                            { id: 'end',   shape: { type: 'Bpmn', shape: 'Event', event: { event: 'End' } } }
                        ]
                    },
                    {
                        id: 'tasks',
                        symbols: [
                            { id: 'task', shape: { type: 'Bpmn', shape: 'Activity', activity: { activity: 'Task' } } }
                        ]
                    },
                    {
                        id: 'gateways',
                        symbols: [
                            { id: 'gateway', shape: { type: 'Bpmn', shape: 'Gateway', gateway: { type: 'Exclusive' } } }
                        ]
                    }
                ];
                palette.dataBind();
            }
        });
    </script>

```

### src/components/diagram-bpmn-editor/diagram.cshtml.cs

```cs
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Syncfusion.EJ2.Diagrams;

namespace EJ2CoreSampleBrowser.Diagram.BpmnEditor
{
    public class BpmnEditorModel : PageModel
    {
        // The diagram starts empty; the user drags shapes from the palette
        // onto the canvas and connects them with flow arrows.
        public List<DiagramNode> Nodes { get; set; } = new List<DiagramNode>();
        public List<DiagramConnector> Connectors { get; set; } = new List<DiagramConnector>();

        public void OnGet()
        {
        }
    }
}

```
