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
close icon

How to dynamically add a BPMN Pool to a diagram?

How would I add a pool, with say 3 lanes, dynamically to the diagram?

I am trying the following code to add the pool, so in theory I can call the addLanes method on the diagram object, but I am getting errors in the console

this.diagram.addNode({
      shape: { type: 'SwimLane',
      header: {
        annotation: { content: 'Pool', },
        height: 70style: { fontSize: 11 , fill: 'pink' },
        orientation: 'Horizontal',
        }
      },
      id: "pool",
      offsetX: 200,
      offsetY: 200
    });

errors

Error: <rect> attribute x: Expected length, "NaN".
5
Error: <rect> attribute width: Expected length, "NaN".
6
Error: <rect> attribute transform: Trailing garbage, "rotate(0,NaN,200.5)".
ej2-diagrams.es2015.js:16310 Error: <text> attribute transform: Trailing garbage, "rotate(0,NaN,200.5)transl…".

3 Replies

SG Shyam G Syncfusion Team September 18, 2019 05:16 AM UTC

Hi Charlie, 

You didn't set swimlane width and height in your code example, so only the swimlane is not rendered during runtime. We have modified your code example and provided below. 

Code example: 
    //add swimlane 
    this.diagram.addNode({ 
      shape: { type: 'SwimLane', 
      header: { 
        annotation: { content: 'Pool', }, 
        height: 70, style: { fontSize: 11 , fill: 'pink' }, 
        orientation: 'Horizontal', 
       
      }, 
      id: "pool", 
      offsetX: 200, 
      offsetY: 200, width: 300, height: 500 
    }); 


Please refer to below help documentation to know more about swimlane. 


Regards, 
Shyam G 



SS Swetha Srikumar Syncfusion Team September 18, 2019 08:53 AM UTC

Hi,  
Can I request a feature in which case to give a friendly error message rather than the error I received which was not as informative as your good selves?  
It may also prevent further such support tickets from us Rookies :)  
Thanks  
Charlie


SG Shyam G Syncfusion Team September 19, 2019 12:29 PM UTC

Hi Charlie, 
 
Reported Issue : Exception raised while not setting its size in swimlane rendering 
 
We have confirmed this as a defect. We have logged a defect report for this issue. We will fix this issue and include it in our volume 3, 2019 release which is scheduled to release by end of September, 2019. 
 
Now, you can track the status of your request through below feedback link. 
 
 
Regards, 
Shyam G 


Loader.
Live Chat Icon For mobile
Up arrow icon