How do I save element (shape) properties to xml of the diagram


#1

I would like to attach some properties to an event (shape) which I wanted them to be saved when diagram is saved.


#2

Please be more specific:

  • what would you like to add to the shape
  • how (under which circumstances) would you like to add them (on import / export, …)

#3

Lets say I am creating a shape programatically:

    task    = elementFactory.createShape({
                     type       : 'bpmn:Task',
                     event      : 'myevent',
                     properties : {
                            text : 'xyz',
                            mode: 'abc'
                      }
    });
    modeling.createShape(task, {x : e.getX() , y : e.getY() }, rootElement);

So here I have an object ‘properties’ attached to the task. How do I write that to the bpmn xml?Hope that was clear


#4

Any help on this is much appreciated. I am a newbie so please ask away if my question isn’t clear enough.

Thanks in advance.


#5

Have you had a look at the custom-meta-model example? It sounds like this might be what you are looking for?