Adding Custom Attribute to BPMN Elements


I want to add custom properties to my bpmn elements
I tried these codes

        var elementInfo : any = {}; ="Hüseyin";
        var elementRegistry = this.snaps.bpmDesigner.getDesignerInstance().get('elementRegistry');
        var elementr = elementRegistry.get(;

The code above adds to xml but when I import xml , cannot see anything.

var newCondition = moddle.create('bpmn:FormalExpression',{ body : JSON.stringify(elementInfo)});    
elementr.businessObject.elementInfo = newCondition;

The code above yes adds attribute to the element but doesnt exports to xml.

I want to add custome attributes about my businesss to elements . I need to export and import it with the custom attributes.

Please help me about it.

This is one of the most frequently asked question in this forum. Please make sure to use search for existing topics before opening new ones.

This example should help you:

1 Like

Thanks for your speedly reply. I searched again. I used this . Thanks again.

1 Like