Separate pre-existing and new elements

If I programmatically load an existing BPMN file, is there a way to allow a user to add new tasks / events / gateways etc., in a different ‘layer’ or color, automatically, so as to be able to identify, visually and in terms of metadata, which are the ‘old’ and ‘new’ elements?

Depends. You can mark elements that got imported during import (and color them differently based on that mark).

What exactly is your use-case?

I import a pre-existing BPMN file generated by mining a client’s SAP logs. I then want to allow the client to add new elements to this graph manually, but maintain a clear separation between the imported elements and the manually added ones.

Then the direction could be like I described:

  • Mark elements during import (i.e. by plugging into the bpmnElement.added event)
  • Render them differently (custom renderer)

Thanks. This accomplishes what I wanted:

const eventBus = bpmnModeler.get("eventBus");
      eventBus.on("bpmnElement.added", function (context) {
        let element = context.element;
        let modeling = bpmnModeler.get('modeling');
        modeling.setColor([element], {fill:'#FFF', stroke:'#060'});
      });
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.