We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to dynamically add start node to diagram

I am utilising the trial period so still very green, so apologies in advance for the rookie question. Also I am not getting answers to my support tickets so am trying out the forum to see if this is the best route to getting resolutions to issues in a reasonable timeframe that allows me to perform my evaluation of your product within the trial period.

This code works :

this.diagram.addNode( {
        shape: { type: 'Text'content: 'Basic Shapes' },
        style: { fontSize: 16fill: 'None'fontFamily: 'sans-serif'bold: truestrokeWidth: 0 },
        offsetX: 300,
        offsetY: 300

This code doesn't work, and doesn't give any errors :

this.diagram.addNode( {
        shape: { type: 'Bpmn'shape: 'Event',
        event: {
            event: 'Start',
            trigger: 'None'
        offsetX: 200,
        offsetY: 200

What am I doing wrong?

1 Reply

SG Shyam G Syncfusion Team September 18, 2019 04:48 AM UTC

Hi Charlie, 

We should inject BpmnDiagrams module to render a BPMN Node in the diagram. Please refer to a code example below. 

Code example:  
import { 
} from '@syncfusion/ej2-diagrams'; 

Please refer to the help documentation below that shows the list of diagram features module you can inject it in your application. 
Here is an sample with your code 

Shyam G 

Live Chat Icon For mobile
Up arrow icon